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 +}