phpgroupware-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Phpgroupware-cvs] CVS: setup config.php,1.72.2.5,1.72.2.6


From: Ralf Becker <address@hidden>
Subject: [Phpgroupware-cvs] CVS: setup config.php,1.72.2.5,1.72.2.6
Date: Thu, 03 Jul 2003 12:27:12 -0400

Update of /cvsroot/phpgroupware/setup
In directory subversions:/tmp/cvs-serv27581

Modified Files:
      Tag: Version-0_9_14-branch
        config.php 
Log Message:
improved version of in_docroot, allows for pathnames starting like the docroot

Index: config.php
===================================================================
RCS file: /cvsroot/phpgroupware/setup/config.php,v
retrieving revision 1.72.2.5
retrieving revision 1.72.2.6
diff -C2 -r1.72.2.5 -r1.72.2.6
*** config.php  2 Jul 2003 23:41:55 -0000       1.72.2.5
--- config.php  3 Jul 2003 16:27:10 -0000       1.72.2.6
***************
*** 32,40 ****
  
        // test if $path lies within the webservers document-root
        function in_docroot($path)
        {
!               $ret = strstr($path,PHPGW_SERVER_ROOT) || 
strstr($path,$GLOBALS['HTTP_SERVER_VARS']['DOCUMENT_ROOT']);
!               //echo "<p>in_docroot('$path') = '$ret', 
PHPGW_SERVER_ROOT='".PHPGW_SERVER_ROOT."',DOCUMENT_ROOT='".$GLOBALS['HTTP_SERVER_VARS']['DOCUMENT_ROOT']."'</p>\n";
!               return $ret;
        }
  
--- 32,55 ----
  
        // test if $path lies within the webservers document-root
+       //
        function in_docroot($path)
        {
!               $docroots = 
array(PHPGW_SERVER_ROOT,$GLOBALS['HTTP_SERVER_VARS']['DOCUMENT_ROOT']);
!               
!               foreach ($docroots as $docroot)
!               {
!                       $len = strlen($docroot);
! 
!                       if ($docroot == substr($path,0,$len))
!                       {
!                               $rest = substr($path,$len);
! 
!                               if (!strlen($rest) || $rest[0] == 
DIRECTORY_SEPARATOR)
!                               {
!                                       return True;
!                               }
!                       }
!               }
!               return False;
        }
  





reply via email to

[Prev in Thread] Current Thread [Next in Thread]