Просмотр исходного кода

Change: PHP 8.5: GdImage freed automatically

https://www.php.net/manual/en/migration85.deprecated.php#migration85.deprecated.gd
Berbe 2 недель назад
Родитель
Сommit
545136665c
1 измененных файлов с 3 добавлено и 1 удалено
  1. 3 1
      lib/Vizhash16x16.php

+ 3 - 1
lib/Vizhash16x16.php

@@ -123,7 +123,9 @@ class Vizhash16x16
         imagepng($image);
         $imagedata = ob_get_contents();
         ob_end_clean();
-        imagedestroy($image);
+        if (version_compare(PHP_VERSION, '8.5', '<') && defined('imagedestroy')) {
+            imagedestroy($image);
+        }
 
         return $imagedata;
     }