From what I understand in PHP '/etc/passwd/' or '/etc/passwd/./././' should be treated just the same as '/etc/passwd'
I am using PHP 5.4 and this does not seem to be true:
php -r "include('/etc/passwd'); "
works fine but
php -r "include('/etc/passwd/'); "
Warning: include(/etc/passwd/): failed to open stream: No such file or directory in Command line code on line 1
Warning: include(): Failed opening '/etc/passwd/' for inclusion (include_path='.:') in Command line code on line 1
The same is true for :
php -r "include('/etc/./././passwd'); "
works!
php -r "include('/etc/./././passwd/'); "
Warning: include(/etc/./././passwd/): failed to open stream: No such file or directory in Command line code on line 1
Warning: include(): Failed opening '/etc/./././passwd/' for inclusion (include_path='.:') in Command line code on line 1
does not work!
Can someone please let me know if I am doing anything wrong or is the path truncation issue fixed?