作者 刘锟

update

@@ -782,15 +782,18 @@ function check_remote_url_down($url,$project_id,$domain,$is_complete=0){ @@ -782,15 +782,18 @@ function check_remote_url_down($url,$project_id,$domain,$is_complete=0){
782 $host_arr = explode('.',$host); 782 $host_arr = explode('.',$host);
783 $path = $arr['path'] ?? ''; 783 $path = $arr['path'] ?? '';
784 784
785 - $url_complete = ($scheme ?: 'https') . '://' . ($host ?: $domain) . $path; 785 + if($path && substr($path,0,1) != '/'){
  786 + $path = '/'.$path;
  787 + }
786 788
787 if ( 789 if (
788 (empty($scheme) || $scheme == 'https' || $scheme == 'http') 790 (empty($scheme) || $scheme == 'https' || $scheme == 'http')
789 && (empty($host) || (strpos($host_arr[0], 'cdn') === false)) 791 && (empty($host) || (strpos($host_arr[0], 'cdn') === false))
790 && $path 792 && $path
791 - && (substr($path, 0, 1) == '/')  
792 && (strpos($path, '.') !== false) 793 && (strpos($path, '.') !== false)
793 ) { 794 ) {
  795 + $url_complete = ($scheme ?: 'https') . '://' . ($host ?: $domain) . $path;
  796 +
794 $new_url = CosService::uploadRemote($project_id,'image_product',$url_complete); 797 $new_url = CosService::uploadRemote($project_id,'image_product',$url_complete);
795 if($new_url){ 798 if($new_url){
796 return $is_complete ? getImageUrl($new_url) : $new_url; 799 return $is_complete ? getImageUrl($new_url) : $new_url;