CMS MADE SIMPLE FORGE

CGSmartImage

 

[#10757] CGSmartImage breaks on imagecreatefromstring php 5.5.9 and 5.6.12 are affected

avatar
Created By: Deleted User (deleteduser_11200)
Date Submitted: Thu Nov 19 15:44:36 -0500 2015

Assigned To: Robert Campbell (calguy1000)
Version: None
CMSMS Version: 1.11.9
Severity: Trivial
Resolution: Accepted
State: Open
Summary:
CGSmartImage breaks on imagecreatefromstring php 5.5.9 and 5.6.12 are affected
Detailed Description:
This is something you can't fix but I report it for reference purpose!

* About:

I was transfering an existing website to a new host using php 5.5.9 all images
using CGSmatImage broke:

In the Apache log files I spotted:

PHP Fatal error:  Call to undefined function imagecreatefromstring() in
/var/www/website/public/modules/CGSmartImage/lib/class.CGImageBase.php

* My PHP version:

php -v
PHP 5.5.9-1ubuntu4.14 (cli) (built: Oct 28 2015 01:34:46) 
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies
    with Zend OPcache v7.0.3, Copyright (c) 1999-2014, by Zend Technologies


* PHP bugtracker:

Seems a bug that is effected by PHP 5.5.9 and 5.6.12.

https://bugs.php.net/bug.php?id=70315

Description:
------------
Condition: display_errors is off.

If you use imagecreatefromstring() with an invalid string, it returns a 500
Internal Server Error in the HTTP headers, but the page is fully renderized. It
should return 200 OK (and the full page), or a 500 Error but without the full
HTML. Not both at the same time.

5.3.10 and 5.4.44 are not affected.
5.5.9 and 5.6.12 are affected.

Test script:
---------------
<?php
ini_set("display_errors", 0);

$data = "iVBORw0KGgoAAAANSUhEUgAAAuwAAAUeCAYAAAAl3WR...LkAAAAAElFTkSuQmCC";
$data = base64_decode($data);
$im = imagecreatefromstring($data);

echo "This should not render";


History

Updates

Updated: 2017-07-29 09:46
resolution_id: => 6