note 78514 added to function.realpath
| From: | cjunge at author-it dot com | Date: | Mon, 15 Oct 2007 23:18:00 +0000 |
| Subject: | note 78514 added to function.realpath | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-131411@lists.php.net to get a copy of this message | ||
eric at themepark dot com noted that realpath() strips off the trailing directory separator. This is
only correct for PHP4!
PHP5 seems to have silently "corrected" this behaviour, now leaving the trailing
separator. This can result in incorrect behaviour if your path isn't meant to contain a
trailing separator.
eg:
PHP4: realpath("some/path/with/a/trailing/slash/") =>
"[root]/some/path/with/a/trailing/slash"
PHP5: realpath("some/path/with/a/trailing/slash/") =>
"[root]/some/path/with/a/trailing/slash/"
----
Server IP: 202.89.58.1
Probable Submitter: 60.234.58.162
----
Manual Page -- http://www.php.net/manual/en/function.realpath.php
Edit -- https://master.php.net/note/edit/78514
Del: integrated -- https://master.php.net/note/delete/78514/integrated
Del: useless -- https://master.php.net/note/delete/78514/useless
Del: bad code -- https://master.php.net/note/delete/78514/bad+code
Del: spam -- https://master.php.net/note/delete/78514/spam
Del: non-english -- https://master.php.net/note/delete/78514/non-english
Del: in docs -- https://master.php.net/note/delete/78514/in+docs
Del: other reasons-- https://master.php.net/note/delete/78514
Reject -- https://master.php.net/note/reject/78514
Search -- https://master.php.net/manage/user-notes.php