is_image() problem - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: is_image() problem (/showthread.php?tid=42252) |
is_image() problem - El Forum - 06-01-2011 [eluser]nuclearmaker[/eluser] why fake png file(empty test.txt renamed to test.png) is return true as image? im using Code: $this->is_image(); is_image() problem - El Forum - 06-01-2011 [eluser]WanWizard[/eluser] What is $this? And where is this is_image() method defined? And what does it do? edit: If you're referring to the method in the upload class, that just checks the mime type of the file, which doesn't say anything about the actual contents. You can execute a getimagesize() on the file. If it doesn't return FALSE, you're fairly sure it's a valid image. is_image() problem - El Forum - 06-01-2011 [eluser]nuclearmaker[/eluser] so, is_image() is useless ? is_image() problem - El Forum - 06-02-2011 [eluser]WanWizard[/eluser] From a security point of view, yes. is_image() problem - El Forum - 06-02-2011 [eluser]cideveloper[/eluser] Is_image is the second parameter for the xss clean |