mirror of
https://github.com/e107inc/e107.git
synced 2025-08-05 22:27:34 +02:00
Issue #2956 PHP 7.1/7.2 captcha
This commit is contained in:
@@ -349,7 +349,9 @@ class secure_image
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(isset($secureimg['font']) && !is_readable($fontpath.$secureimg['font']))
|
$fontFile = isset($secureimg['font']) ? realpath($fontpath.$secureimg['font']) : false;
|
||||||
|
|
||||||
|
if(!empty($fontFile) && !is_readable($fontFile))
|
||||||
{
|
{
|
||||||
echo "Font missing"; // for debug only. translation not necessary.
|
echo "Font missing"; // for debug only. translation not necessary.
|
||||||
exit;
|
exit;
|
||||||
@@ -399,10 +401,11 @@ class secure_image
|
|||||||
}
|
}
|
||||||
|
|
||||||
header("Content-type: image/{$type}");
|
header("Content-type: image/{$type}");
|
||||||
|
|
||||||
|
|
||||||
if(isset($secureimg['font']) && is_readable($fontpath.$secureimg['font']))
|
if(!empty($fontFile))
|
||||||
{
|
{
|
||||||
imagettftext($image, $secureimg['size'],$secureimg['angle'], $secureimg['x'], $secureimg['y'], $text_color,$fontpath.$secureimg['font'], $code);
|
imagettftext($image, $secureimg['size'],$secureimg['angle'], $secureimg['x'], $secureimg['y'], $text_color, $fontFile, $code);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user