From 967644b3390cf7aef4ace115e9ba82f036e75ebc Mon Sep 17 00:00:00 2001 From: Anyon Date: Mon, 25 Nov 2019 09:54:34 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=BC=E5=AE=B9GD=E5=AD=97=E4=BD=93=E6=97=A0?= =?UTF-8?q?=E5=87=BD=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- composer.lock | 8 ++++---- vendor/composer/installed.json | 8 ++++---- vendor/services.php | 2 +- .../think-library/src/service/CaptchaService.php | 6 +++++- 4 files changed, 14 insertions(+), 10 deletions(-) diff --git a/composer.lock b/composer.lock index 5d437065b..bddd9d315 100644 --- a/composer.lock +++ b/composer.lock @@ -783,12 +783,12 @@ "source": { "type": "git", "url": "https://github.com/zoujingli/ThinkLibrary.git", - "reference": "a01d99bd039989a587fdc0c9d38e300b86a71045" + "reference": "d59b40f099926275e5ecec372624ab7212c27bc0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/a01d99bd039989a587fdc0c9d38e300b86a71045", - "reference": "a01d99bd039989a587fdc0c9d38e300b86a71045", + "url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/d59b40f099926275e5ecec372624ab7212c27bc0", + "reference": "d59b40f099926275e5ecec372624ab7212c27bc0", "shasum": "", "mirrors": [ { @@ -832,7 +832,7 @@ ], "description": "ThinkPHP v6.0 Development Library", "homepage": "http://framework.thinkadmin.top", - "time": "2019-11-23T10:28:22+00:00" + "time": "2019-11-23T12:12:24+00:00" } ], "packages-dev": [], diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index f4f01cae5..afa85abd7 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -805,12 +805,12 @@ "source": { "type": "git", "url": "https://github.com/zoujingli/ThinkLibrary.git", - "reference": "a01d99bd039989a587fdc0c9d38e300b86a71045" + "reference": "d59b40f099926275e5ecec372624ab7212c27bc0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/a01d99bd039989a587fdc0c9d38e300b86a71045", - "reference": "a01d99bd039989a587fdc0c9d38e300b86a71045", + "url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/d59b40f099926275e5ecec372624ab7212c27bc0", + "reference": "d59b40f099926275e5ecec372624ab7212c27bc0", "shasum": "", "mirrors": [ { @@ -826,7 +826,7 @@ "ext-json": "*", "topthink/framework": "^6.0" }, - "time": "2019-11-23T10:28:22+00:00", + "time": "2019-11-23T12:12:24+00:00", "type": "library", "extra": { "think": { diff --git a/vendor/services.php b/vendor/services.php index bc4b58363..dce2fe5b0 100644 --- a/vendor/services.php +++ b/vendor/services.php @@ -1,5 +1,5 @@ 'think\\app\\Service', diff --git a/vendor/zoujingli/think-library/src/service/CaptchaService.php b/vendor/zoujingli/think-library/src/service/CaptchaService.php index 8999a25a6..7bde88ace 100644 --- a/vendor/zoujingli/think-library/src/service/CaptchaService.php +++ b/vendor/zoujingli/think-library/src/service/CaptchaService.php @@ -146,7 +146,11 @@ class CaptchaService extends Service $_x = $this->width / $this->codelen; for ($i = 0; $i < $this->codelen; $i++) { $this->fontcolor = imagecolorallocate($this->img, mt_rand(0, 156), mt_rand(0, 156), mt_rand(0, 156)); - imagettftext($this->img, $this->fontsize, mt_rand(-30, 30), $_x * $i + mt_rand(1, 5), $this->height / 1.4, $this->fontcolor, $this->font, $this->code[$i]); + if (function_exists('imagettftext')) { + imagettftext($this->img, $this->fontsize, mt_rand(-30, 30), $_x * $i + mt_rand(1, 5), $this->height / 1.4, $this->fontcolor, $this->font, $this->code[$i]); + } else { + imagestring($this->img, 15, $_x * $i + mt_rand(10, 15), mt_rand(10, 30), $this->code[$i], $this->fontcolor); + } } ob_start(); imagepng($this->img);