PHP 4.0 Bug #6385: __FILE__ returns lowercased filenames
| From: | waldschrott@php.net | Date: | Mon, 28 Aug 2000 01:28:47 +0000 |
| Subject: | PHP 4.0 Bug #6385: __FILE__ returns lowercased filenames | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-30893@lists.php.net to get a copy of this message | ||
From: waldschrott@php.net
Operating system: w32
PHP version: 4.0 Latest CVS (27/08/2000)
PHP Bug Type: Scripting Engine problem
Bug description: __FILE__ returns lowercased filenames
if I´m calling a file "FooBar.php", echo __FILE__; will
output "foobar.php".
Although w32 allows files only in-sensitive (no FooBar.php
and foobar.php concurrently) it saves the case information
and thus __FILE__ (and related) should contain this cased
information too.
This will bug will also cause scripts not to be platform
independend:
// filename lowercased
$filename=basename(__FILE__);
// HTTP REQUEST, w cased filename
$fullpage=substr($tmp=strtolower(getenv('SERVER_PROTOCOL')),0,strpos($tmp,'/')).'://'.getenv('HTTP_HOST').getenv('REQUEST_URI');
$pageonly=substr($fullpage,0,strpos($fullpage,$filename)+strlen($filename));
hile this script should work on *nix calling "foobar.php" it
does not on w32