php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #6385 __FILE__ returns lowercased filenames
Submitted: 2000-08-27 21:28 UTC Modified: 2001-05-28 00:29 UTC
From: waldschrott@php.net Assigned:
Status: Closed Package: Scripting Engine problem
PHP Version: 4.0 Latest CVS (27/08/2000) OS: w32
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
20 + 15 = ?
Subscribe to this entry?

 
 [2000-08-27 21:28 UTC] waldschrott@php.net
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

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-08-31 09:02 UTC] stas@php.net
Does this happen with CGI version? I suspect it might be just IIS which sets your filename lowercase...
 [2000-11-04 06:34 UTC] waldschrott@php.net
tested on CGI+ApacheMod, both return lowercased
 [2001-01-08 15:40 UTC] cynic@php.net
not IIS-specific, reclassifying
 [2001-05-06 15:12 UTC] zeev@php.net
Does this still happen with 4.0.5 or latest CVS?  I can't reproduce it.
 [2001-05-28 00:29 UTC] sniper@php.net
No feedback, closed (can't reproduce either)

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 21:01:27 2024 UTC