|
...
|
...
|
@@ -1491,7 +1491,14 @@ function thumbImageByUrl($url, $width = 360) |
|
|
|
}
|
|
|
|
|
|
|
|
//获取图片完整访问地址
|
|
|
|
$url_complete = getImageUrl($url, 0, 0, 0);//先用v6-file地址
|
|
|
|
if (strpos($url_complete, 'v6-file') !== false) {
|
|
|
|
$is_exists = checkRemoteFileExists($url_complete);
|
|
|
|
if (!$is_exists) {
|
|
|
|
//不存在,再用cdn地址
|
|
|
|
$url_complete = getImageUrl($url);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//获取与原图存储路径相同的压缩路径
|
|
|
|
$path = parse_url($url_complete, PHP_URL_PATH);
|
|
...
|
...
|
@@ -1525,6 +1532,23 @@ function thumbImageByUrl($url, $width = 360) |
|
|
|
return $url;
|
|
|
|
}
|
|
|
|
|
|
|
|
function checkRemoteFileExists($url)
|
|
|
|
{
|
|
|
|
$curl = curl_init($url);
|
|
|
|
curl_setopt($curl, CURLOPT_NOBODY, true);
|
|
|
|
$result = curl_exec($curl);
|
|
|
|
$found = false;
|
|
|
|
if ($result !== false) {
|
|
|
|
$statusCode = curl_getinfo($curl, CURLINFO_HTTP_CODE);
|
|
|
|
if ($statusCode == 200) {
|
|
|
|
$found = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
curl_close($curl);
|
|
|
|
|
|
|
|
return $found;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!function_exists('httpGetSsl')) {
|
|
|
|
/**
|
|
|
|
* 获取通配符证书
|
...
|
...
|
|