php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #40912 getImagesize returns Array for php files
Submitted: 2007-03-25 01:42 UTC Modified: 2007-03-25 14:21 UTC
From: programmer at serbiansite dot com Assigned:
Status: Not a bug Package: GetImageSize related
PHP Version: 5.2.1 OS: Windows + Linux
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: programmer at serbiansite dot com
New email:
PHP Version: OS:

 

 [2007-03-25 01:42 UTC] programmer at serbiansite dot com
Description:
------------
getimagesize returns Array for php files if you add GIF at beginning of the file.

Reproduce code:
---------------
phpgif.php

GIF
<?php 
echo "PHP CODE";
?>


test.php
<?
$image = "phpgif.php";
$image_size = getimagesize($image);
echo"<pre>";
print_r($image_size);
echo"</pre>";
?>


Expected result:
----------------
Nothing. Because phpgif.php is not a picture.

Actual result:
--------------
Array
(
    [0] => 28735
    [1] => 28776
    [2] => 1
    [3] => width="28735" height="28776"
    [channels] => 3
    [mime] => image/gif
)



Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-03-25 14:21 UTC] iliaa@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

As long as the file contains a header resembling that of a GIF image 
getimagesize() function will report it as such.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Dec 22 06:01:30 2024 UTC