Browse Source

修改base64问题

吴昊天 2 years ago
parent
commit
df6cf097b3
1 changed files with 2 additions and 2 deletions
  1. 2 2
      crmeb/app/api/controller/v1/PublicController.php

+ 2 - 2
crmeb/app/api/controller/v1/PublicController.php

@@ -305,10 +305,10 @@ class PublicController
             ['image', ''],
             ['image', ''],
             ['code', ''],
             ['code', ''],
         ], true);
         ], true);
-        if ($imageUrl !== '' && !preg_match('/.*(\.png|\.jpg|\.jpeg|\.gif)$/', $imageUrl)) {
+        if ($imageUrl !== '' && !preg_match('/.*(\.png|\.jpg|\.jpeg|\.gif)$/', $imageUrl) && strpos($imageUrl, "phar://") !== false) {
             return app('json')->success(['code' => false, 'image' => false]);
             return app('json')->success(['code' => false, 'image' => false]);
         }
         }
-        if ($codeUrl !== '' && !(preg_match('/.*(\.png|\.jpg|\.jpeg|\.gif)$/', $codeUrl) || strpos($codeUrl, 'https://mp.weixin.qq.com/cgi-bin/showqrcode') !== false)) {
+        if ($codeUrl !== '' && !(preg_match('/.*(\.png|\.jpg|\.jpeg|\.gif)$/', $codeUrl) || strpos($codeUrl, 'https://mp.weixin.qq.com/cgi-bin/showqrcode') !== false) && strpos($codeUrl, "phar://") !== false) {
             return app('json')->success(['code' => false, 'image' => false]);
             return app('json')->success(['code' => false, 'image' => false]);
         }
         }
         try {
         try {