note 89446 added to function.getimagesize
| From: | (degreesofzero.com) | Date: | Sun, 08 Mar 2009 05:25:18 +0000 |
| Subject: | note 89446 added to function.getimagesize | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-151622@lists.php.net to get a copy of this message | ||
You should use a text input field in your form for the user to specify a remote URL for an image
they wish to upload. Then check the image size of the image at the URL (among other security checks
you should run), before you have your server download the remote image to the server.
In response to:
"Note that if you specify a remote file (via a URL) to check the size of, PHP will first
download the remote file to your server.
If you're using this function to check the size of user provided image links, this could
constitute a security risk. A malicious user could potentially link to a very large image file and
cause PHP to download it. I do not know what, if any, file size limits are in place for the
download. But suppose the user provided a link to an image that was several gigabytes in size?
It would be nice if there were a way to limit the size of the download performed by this function.
Hopefully there is already a default with some sensible limits."
----
Server IP: 69.147.83.197
Probable Submitter: 71.194.186.21
----
Manual Page -- http://www.php.net/manual/en/function.getimagesize.php
Edit -- https://master.php.net/note/edit/89446
Del: integrated -- https://master.php.net/note/delete/89446/integrated
Del: useless -- https://master.php.net/note/delete/89446/useless
Del: bad code -- https://master.php.net/note/delete/89446/bad+code
Del: spam -- https://master.php.net/note/delete/89446/spam
Del: non-english -- https://master.php.net/note/delete/89446/non-english
Del: in docs -- https://master.php.net/note/delete/89446/in+docs
Del: other reasons-- https://master.php.net/note/delete/89446
Reject -- https://master.php.net/note/reject/89446
Search -- https://master.php.net/manage/user-notes.php