|
|
@@ -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);
|
|
|
}
|