Pārlūkot izejas kodu

Wesmiler 三勾多商户商城提交

wesmiler 4 gadi atpakaļ
vecāks
revīzija
50713f18c4
1 mainītis faili ar 2 papildinājumiem un 2 dzēšanām
  1. 2 2
      app/api/common.php

+ 2 - 2
app/api/common.php

@@ -9,9 +9,9 @@ if (!function_exists('getPreview')) {
     function getPreview($url){
     function getPreview($url){
         if ($url) {
         if ($url) {
             $host = request()->header('host');
             $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){
         if(preg_match("/127.0|localhost/", $host) && $url){
             $url = preg_replace("/^\/\//", 'http://', $url);
             $url = preg_replace("/^\/\//", 'http://', $url);
         }
         }