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
This commit is contained in:
Christoph Michael Becker 2017-03-17 12:12:36 +00:00
parent 36e4bf067b
commit 7ec5fffa2f

View file

@ -23,6 +23,19 @@
<function>getimagesize</function> can also return some more information
in <parameter>imageinfo</parameter> parameter.
</para>
<caution>
<para>
This function expects <parameter>filename</parameter> 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.
</para>
<para>
Do not use <function>getimagesize</function> to check that a given
file is a valid image. Use a purpose-built solution such as the
<link linkend="book.fileinfo">Fileinfo</link> extension instead.
</para>
</caution>
<note>
<simpara>
Note that JPC and JP2 are capable of having components with different
@ -279,18 +292,6 @@ if (isset($info["APP13"])) {
<refsect1 role="notes">
&reftitle.notes;
&note.gd.notrequired;
<note>
<para>
This function expects <parameter>filename</parameter> 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.
</para>
<para>
Do not use <function>getimagesize</function> to check that a given
file is a valid image. Use a purpose-built solution such as the
<link linkend="book.fileinfo">Fileinfo</link> extension instead.
</para>
</note>
</refsect1>
<refsect1 role="seealso">