|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2014-05-06 15:24 UTC] nicolas dot grekas+php at gmail dot com
Description:
------------
See test script.
__FILE__, __DIR__, ReflectionClass::getFilename(), etc. are also affected (but getcwd() is OK).
Test script:
---------------
<?php
var_dump(realpath('/Users') === realpath('/users'));
Expected result:
----------------
bool(true)
Actual result:
--------------
bool(false)
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 14:00:01 2025 UTC |
Well, I am still somewhat sympathetic to this though. The native OSX realpath() call does normalize the case. eg. #include <stdio.h> #include <stdlib.h> int main(int argc, char **argv) { printf("%s %s\n",realpath("/Users",NULL),realpath("/users",NULL)); return(0); } Outputs: /Users /Users And we used to do so as well when we relied on the system-level realpath() call. However, after we optimized realpath() to allow us to do intra-path caching, we now use our own implementation. Fixing this particular issue isn't that easy, and you are right, we don't promise to do path normalization in this function.