【程序目录】image_base64增加数据验证

This commit is contained in:
吴昊天 2022-08-26 09:55:29 +08:00
parent 172564b121
commit db2116f3d3

View File

@ -300,6 +300,9 @@ class PublicController
['image', ''],
['code', ''],
], true);
if (!preg_match('/.*(\.png|\.jpg|\.jpeg|\.gif)$/', $imageUrl) || !preg_match('/.*(\.png|\.jpg|\.jpeg|\.gif)$/', $codeUrl)) {
return app('json')->fail(100100);
}
try {
$code = CacheService::get($codeUrl, function () use ($codeUrl) {
$codeTmp = $code = $codeUrl ? image_to_base64($codeUrl) : false;