Update antispamimage.php

If imagecreate fail, we can't see error message
This commit is contained in:
Frédéric FRANCE 2014-11-05 20:02:58 +01:00
parent b601afc92b
commit 4cb3dc4238

View File

@ -51,8 +51,6 @@ for($i = 0; $i < $length; $i++)
$sessionkey='dol_antispam_value';
$_SESSION[$sessionkey]=$string;
header("Content-type: image/png");
$img = imagecreate(80,32);
if (empty($img))
{
@ -60,6 +58,8 @@ if (empty($img))
exit;
}
header("Content-type: image/png");
$background_color = imagecolorallocate($img, 250, 250, 250);
$ecriture_color = imagecolorallocate($img, 0, 0, 0);
imagestring($img, 4, 24, 8, $string, $ecriture_color);