note 88344 added to function.move-uploaded-file
| From: | lucazd at gmail dot com | Date: | Tue, 20 Jan 2009 21:06:36 +0000 |
| Subject: | note 88344 added to function.move-uploaded-file | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-149553@lists.php.net to get a copy of this message | ||
@sedativchunk
At first sight the function looks very buggy.
<?php
$key = array_search($file_type, $files);
if($key) {
echo '<b>File allowed!</b><br />';
} else {
echo '<b>ILLEGAL FILE TYPE</b><br />';
exit();
}
?>
The condition should be if($key !== false). Because array_search may return the index 0.
----
Server IP: 201.216.232.3
Probable Submitter: 201.231.32.11
----
Manual Page -- http://www.php.net/manual/en/function.move-uploaded-file.php
Edit -- https://master.php.net/note/edit/88344
Del: integrated -- https://master.php.net/note/delete/88344/integrated
Del: useless -- https://master.php.net/note/delete/88344/useless
Del: bad code -- https://master.php.net/note/delete/88344/bad+code
Del: spam -- https://master.php.net/note/delete/88344/spam
Del: non-english -- https://master.php.net/note/delete/88344/non-english
Del: in docs -- https://master.php.net/note/delete/88344/in+docs
Del: other reasons-- https://master.php.net/note/delete/88344
Reject -- https://master.php.net/note/reject/88344
Search -- https://master.php.net/manage/user-notes.php