note 86343 deleted from function.basename by danbrown
| From: | danbrown@php.net | Date: | Tue, 14 Oct 2008 13:15:30 +0000 |
| Subject: | note 86343 deleted from function.basename by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-145342@lists.php.net to get a copy of this message | ||
Note Submitter: Pax
Reason: bad code
----
@pvollma at pcvsoftware dot net
13-Jul-2005 06:43
/*
<?php
$filen = stripslashes($_FILES['userfile']['name']);
$newfile = basename($filen);
if (strpos($newfile,'\\') !== false) {
$tmp = preg_split("[\\\]",$newfile);
$newfile = $tmp[count($tmp) - 1];
}
?>
*/
Why not work around the bug?
basename(strip_slashes("\\","/",$windowsFilePath));