Ver código fonte

Wesmiler 三勾多商户商城提交

wesmiler 4 anos atrás
pai
commit
50713f18c4
1 arquivos alterados com 2 adições e 2 exclusões
  1. 2 2
      app/api/common.php

+ 2 - 2
app/api/common.php

@@ -9,9 +9,9 @@ if (!function_exists('getPreview')) {
     function getPreview($url){
         if ($url) {
             $host = request()->header('host');
-            $url = preg_match("/^(http|https):\/\//", trim($url,'//')) ? $url : '//'.$host . '/' . ltrim($url, '/');
+            $url = preg_match("/^(http):\/\//", trim($url,'//')) ? $url : '//'.$host . '/' . ltrim($url, '/');
         }
-        $url = $url? preg_replace("/^(https|http):\/\//", '//', $url) : '';
+        $url = $url? preg_replace("/^(https):\/\//", '//', $url) : '';
         if(preg_match("/127.0|localhost/", $host) && $url){
             $url = preg_replace("/^\/\//", 'http://', $url);
         }