#32744 [NEW]: possible twice including by require_once() after chdir()
| From: | vovik at getart dot ru | Date: | Mon, 18 Apr 2005 14:29:24 +0000 |
| Subject: | #32744 [NEW]: possible twice including by require_once() after chdir() | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-77792@lists.php.net to get a copy of this message | ||
From: vovik at getart dot ru
Operating system: Windows XP
PHP version: 4.3.11
PHP Bug Type: Filesystem function related
Bug description: possible twice including by require_once() after chdir()
Description:
------------
When script started and do require_once() by relative filename, this
function remembers lower case real path.
If script changes working dir via chdir() and directory name consist of
not lower-case letters, require_once() will include the file again.
Reproduce code:
---------------
<?php
// This file located under directory with non-lowercase name, i.e. "TesT"
print "<pre>";
require_once("./inc.php"); // single print line there
chdir("./..");
chdir("./TesT");
require_once("./inc.php");
var_dump(get_included_files());
?>
Expected result:
----------------
I expect to single include of inc.php.
Actual result:
--------------
Actually, got two :)
--
Edit bug report at http://bugs.php.net/?id=32744&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=32744&r=trysnapshot4
Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=32744&r=trysnapshot50
Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=32744&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=32744&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=32744&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=32744&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=32744&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=32744&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=32744&r=support
Expected behavior: http://bugs.php.net/fix.php?id=32744&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=32744&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=32744&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=32744&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=32744&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=32744&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=32744&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=32744&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=32744&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=32744&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=32744&r=mysqlcfg