note 75217 deleted from function.realpath by danbrown
| From: | danbrown@php.net | Date: | Mon, 01 Jun 2009 13:01:39 +0000 |
| Subject: | note 75217 deleted from function.realpath by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-156235@lists.php.net to get a copy of this message | ||
Note Submitter: Sebastian
----
Who ever wrote the rp()-function. First of all, your function skips filenames or directories with
"0" because you use == instead of === when comparing to an "empty" value.
Second, the idea of realpath() isn't fixing useless "../" etc, but to resolve the
full path of a relative directory/file or a symbolic link. So that if you run the script in
'/usr/local/apache2/htdocs/' and exec realpath('uploads/test.txt') the output
becomes '/usr/local/apache2/htdocs/uploads/test.txt' (as in the example)
I also wonder why the implementations aren't using the DIRECTORY_SEPARATOR constant and expect
Unix.