From 7ec5fffa2fc455432606db7ebc7b5ac403052731 Mon Sep 17 00:00:00 2001 From: Christoph Michael Becker Date: Fri, 17 Mar 2017 12:12:36 +0000 Subject: [PATCH] Fix #74239: getimagesize returns incorrect value for corrupt file. We promote the respective notice to a caution, move it up, and explain that the returned array may contain nonsense. git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@342146 c90b9560-bf6c-de11-be94-00142212c4b1 --- reference/image/functions/getimagesize.xml | 25 +++++++++++----------- 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/reference/image/functions/getimagesize.xml b/reference/image/functions/getimagesize.xml index d5e98f22f5..c953d47819 100644 --- a/reference/image/functions/getimagesize.xml +++ b/reference/image/functions/getimagesize.xml @@ -23,6 +23,19 @@ getimagesize can also return some more information in imageinfo parameter. + + + This function expects filename to be a valid + image file. If a non-image file is supplied, it may be incorrectly + detected as an image and the function will return successfully, but + the array may contain nonsentical values. + + + Do not use getimagesize to check that a given + file is a valid image. Use a purpose-built solution such as the + Fileinfo extension instead. + + Note that JPC and JP2 are capable of having components with different @@ -279,18 +292,6 @@ if (isset($info["APP13"])) { &reftitle.notes; ¬e.gd.notrequired; - - - This function expects filename to be a valid - image file. If a non-image file is supplied, it may be incorrectly - detected as an image and the function will return successfully. - - - Do not use getimagesize to check that a given - file is a valid image. Use a purpose-built solution such as the - Fileinfo extension instead. - -