From 6bfa89f741aaa082cc9f70209a004899ef1c3e1d Mon Sep 17 00:00:00 2001 From: Anyon Date: Sat, 3 Jan 2026 13:40:48 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E6=AD=A3php8.5=E7=8E=AF?= =?UTF-8?q?=E5=A2=83=E4=B8=8B=E7=9A=84=E8=AD=A6=E5=91=8A=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugin/think-library/src/Plugin.php | 2 +- plugin/think-library/src/service/CaptchaService.php | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/plugin/think-library/src/Plugin.php b/plugin/think-library/src/Plugin.php index 66e7c9df6..bdd0ff723 100644 --- a/plugin/think-library/src/Plugin.php +++ b/plugin/think-library/src/Plugin.php @@ -207,7 +207,7 @@ abstract class Plugin extends Service return app(static::class)->appPath; case 'getappspace': return app(static::class)->appSpace; - case 'getapppackage'; + case 'getapppackage': return app(static::class)->package; default: $class = basename(str_replace('\\', '/', static::class)); diff --git a/plugin/think-library/src/service/CaptchaService.php b/plugin/think-library/src/service/CaptchaService.php index bceb7feea..b9a244ea7 100644 --- a/plugin/think-library/src/service/CaptchaService.php +++ b/plugin/think-library/src/service/CaptchaService.php @@ -14,7 +14,7 @@ // | github 仓库地址 :https://github.com/zoujingli/ThinkLibrary // +---------------------------------------------------------------------- -declare (strict_types=1); +declare(strict_types=1); namespace think\admin\service; @@ -152,7 +152,9 @@ class CaptchaService extends Service imagepng($img); $data = ob_get_contents(); ob_end_clean(); - imagedestroy($img); + if (version_compare(PHP_VERSION, '8.0.0', '<')) { + imagedestroy($img); + } return base64_encode($data); } @@ -182,4 +184,4 @@ class CaptchaService extends Service return false; } } -} \ No newline at end of file +}