[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] CVS: infolog/inc class.vfs.inc.php,1.3.2.2,1.3.2.3
From: |
Ralf Becker <address@hidden> |
Subject: |
[Phpgroupware-cvs] CVS: infolog/inc class.vfs.inc.php,1.3.2.2,1.3.2.3 |
Date: |
Thu, 03 Jul 2003 12:26:33 -0400 |
Update of /cvsroot/phpgroupware/infolog/inc
In directory subversions:/tmp/cvs-serv26825
Modified Files:
Tag: Version-0_9_14-branch
class.vfs.inc.php
Log Message:
improved version of in_docroot, allows for pathnames starting like the docroot
Index: class.vfs.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/infolog/inc/class.vfs.inc.php,v
retrieving revision 1.3.2.2
retrieving revision 1.3.2.3
diff -C2 -r1.3.2.2 -r1.3.2.3
*** class.vfs.inc.php 3 Jul 2003 00:21:24 -0000 1.3.2.2
--- class.vfs.inc.php 3 Jul 2003 16:26:30 -0000 1.3.2.3
***************
*** 103,107 ****
// test if the files-dir is inside the document-root,
and refuse working if so
//
! if (strstr($this->basedir,PHPGW_SERVER_ROOT) ||
strstr($this->basedir,$GLOBALS['HTTP_SERVER_VARS']['DOCUMENT_ROOT']))
{
$GLOBALS['phpgw']->common->phpgw_header();
--- 103,107 ----
// test if the files-dir is inside the document-root,
and refuse working if so
//
! if ($this->in_docroot($this->basedir))
{
$GLOBALS['phpgw']->common->phpgw_header();
***************
*** 156,159 ****
--- 156,184 ----
$this->linked_dirs[] =
$GLOBALS['phpgw']->db->Record;
}
+ }
+
+ /*!
+ @function in_docroot
+ @abstract 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;
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpgroupware-cvs] CVS: infolog/inc class.vfs.inc.php,1.3.2.2,1.3.2.3,
Ralf Becker <address@hidden> <=