note 88344 deleted from function.move-uploaded-file by danbrown
| From: | danbrown@php.net | Date: | Tue, 20 Jan 2009 21:18:02 +0000 |
| Subject: | note 88344 deleted from function.move-uploaded-file by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-149554@lists.php.net to get a copy of this message | ||
Note Submitter: lucazd at gmail dot com
----
@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.