Do not use function is_resource().

PHP 8.1 replaces some kind of resources by built-in class instances.
As is_resource() is always used to test for failures, replace calls by
simple Boolean checks.
This commit is contained in:
Patrick Monnerat
2022-05-30 20:13:04 +02:00
committed by Deon George
parent f129579f45
commit b035e8a0f4
2 changed files with 19 additions and 17 deletions

View File

@@ -40,7 +40,7 @@ switch ($request['location']) {
if (! isset($jpeg_data[$request['attr']][$request['index']])) {
if (function_exists('imagecreate')) {
$im = imagecreate(160,30);
if (is_resource($im)) {
if ($im) {
header('Content-type: image/png');
# Set the background