note 109902 added to reserved.variables.files

From: Date: Sat, 01 Sep 2012 20:59:23 +0000
Subject: note 109902 added to reserved.variables.files
Groups: php.notes 
Request: Send a blank email to php-notes+get-190408@lists.php.net to get a copy of this message
A note of security: Don't ever trust $_FILES["image"]["type"]. It takes whatever is sent from the browser, so don't trust this for the image type. I recommend using finfo_open (http://www.php.net/manual/en/function.finfo-open.php) to verify the MIME type of a file. It will parse the MAGIC in the file and return it's type...this can be trusted (you can also use the "file" program on Unix, but I would refrain from ever making a System call with your PHP code...that's just asking for problems). ---- Server IP: 69.147.83.197 Probable Submitter: 69.124.130.51 ---- Manual Page -- http://www.php.net/manual/en/reserved.variables.files.php Edit -- https://master.php.net/note/edit/109902 Del: integrated -- https://master.php.net/note/delete/109902/integrated Del: useless -- https://master.php.net/note/delete/109902/useless Del: bad code -- https://master.php.net/note/delete/109902/bad+code Del: spam -- https://master.php.net/note/delete/109902/spam Del: non-english -- https://master.php.net/note/delete/109902/non-english Del: in docs -- https://master.php.net/note/delete/109902/in+docs Del: other reasons-- https://master.php.net/note/delete/109902 Reject -- https://master.php.net/note/reject/109902 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#190408) next »