This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "FusionForge".

The branch, master has been updated
       via  b1eebdf3305a20c470049268094e3f40953904f0 (commit)
      from  67d49b1a54f654b5c5773b40fa981afc969cc5c8 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://scm.fusionforge.org/anonscm/gitweb/?p=fusionforge/fusionforge.git;a=commitdiff;h=b1eebdf3305a20c470049268094e3f40953904f0

commit b1eebdf3305a20c470049268094e3f40953904f0
Author: Franck Villaume <[email protected]>
Date:   Sat Sep 10 14:11:33 2016 +0200

    make REQUEST_URI generic. fix docman, frs download with url_prefix

diff --git a/src/common/include/logger.php b/src/common/include/logger.php
index c294fb2..c64a647 100644
--- a/src/common/include/logger.php
+++ b/src/common/include/logger.php
@@ -40,20 +40,10 @@ if (isset($group_id) && is_numeric($group_id) && $group_id) 
{
        }
 } else {
        //
-       //
        //      This is a hack to allow the logger to have a group_id present
        //      for foundry and project summary pages
        //
-       //
-       $pos = strpos (getStringFromServer('REQUEST_URI'),
-                      normalized_urlprefix ());
-       if (($pos !== false) && ($pos == 0)) {
-               $pathwithoutprefix = substr (getStringFromServer('REQUEST_URI'),
-                                            strlen (normalized_urlprefix ()) - 
1);
-       }
-       $pathwithoutprefix_exploded = explode('?', $pathwithoutprefix);
-       $pathwithoutprefix = $pathwithoutprefix_exploded[0];
-       $expl_pathinfo = explode('/',$pathwithoutprefix);
+       $expl_pathinfo = explode('/', getStringFromServer('REQUEST_URI'));
        if (($expl_pathinfo[1]=='foundry') || ($expl_pathinfo[1]=='projects')) {
                $group_name = $expl_pathinfo[2];
                if ($group_name) {
diff --git a/src/common/include/pre.php b/src/common/include/pre.php
index f66bf4b..24c7199 100644
--- a/src/common/include/pre.php
+++ b/src/common/include/pre.php
@@ -22,6 +22,7 @@
  * with FusionForge; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
+
 require_once $gfcommon.'include/escapingUtils.php';
 require_once $gfcommon.'include/utils.php';
 
@@ -101,6 +102,20 @@ if (isset($GLOBALS) && array_key_exists('PHP_SELF', 
$GLOBALS) && $GLOBALS['PHP_S
        }
 }
 
+if (isset($_SERVER) && array_key_exists('REQUEST_URI', $_SERVER) && 
$_SERVER['REQUEST_URI']) {
+       $_SERVER['REQUEST_URI'] = htmlspecialchars($_SERVER['REQUEST_URI']);
+       if (substr($_SERVER['REQUEST_URI'], 0, strlen($url_prefix)) == 
$url_prefix) {
+               $_SERVER['REQUEST_URI'] = '/'.substr($_SERVER['REQUEST_URI'], 
strlen($url_prefix));
+       }
+}
+
+if (isset($GLOBALS) && array_key_exists('REQUEST_URI', $GLOBALS) && 
$GLOBALS['REQUEST_URI']) {
+       $GLOBALS['REQUEST_URI'] = htmlspecialchars($GLOBALS['REQUEST_URI']);
+       if (substr($GLOBALS['REQUEST_URI'], 0, strlen($url_prefix)) == 
$url_prefix) {
+               $GLOBALS['REQUEST_URI'] = '/'.substr($GLOBALS['REQUEST_URI'], 
strlen($url_prefix));
+       }
+}
+
 if (forge_get_config('use_ssl')) {
        header('Access-Control-Allow-Origin: 
http://'.forge_get_config('web_host'));
 }
@@ -274,7 +289,7 @@ if (getenv('FUSIONFORGE_NO_DB') != 'true' and 
forge_get_config('database_name')
 
                // Mandatory login
                if (!session_loggedin() && forge_get_config ('force_login') == 
1 ) {
-                       $expl_pathinfo = 
explode('/',getStringFromServer('REQUEST_URI'));
+                       $expl_pathinfo = explode('/', 
getStringFromServer('REQUEST_URI'));
                        if (getStringFromServer('REQUEST_URI')!='/' && 
$expl_pathinfo[1]!='account' && $expl_pathinfo[1]!='export' && 
$expl_pathinfo[1]!='plugins') exit_not_logged_in();
                        // Show proj* export even if not logged in when force 
login
                        // If not default web project page would be broken

-----------------------------------------------------------------------

Summary of changes:
 src/common/include/logger.php | 12 +-----------
 src/common/include/pre.php    | 17 ++++++++++++++++-
 2 files changed, 17 insertions(+), 12 deletions(-)


hooks/post-receive
-- 
FusionForge

_______________________________________________
Fusionforge-commits mailing list
[email protected]
http://lists.fusionforge.org/cgi-bin/mailman/listinfo/fusionforge-commits

Reply via email to