From 4cb3dc4238a97ca1045b0243d0361708bca841f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 5 Nov 2014 20:02:58 +0100 Subject: [PATCH] Update antispamimage.php If imagecreate fail, we can't see error message --- htdocs/core/antispamimage.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/antispamimage.php b/htdocs/core/antispamimage.php index c3bc217e100..a16844dd715 100644 --- a/htdocs/core/antispamimage.php +++ b/htdocs/core/antispamimage.php @@ -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);