作者 刘锟

合并分支 'akun' 到 'master'

Akun



查看合并请求 !167
@@ -390,6 +390,7 @@ class HtmlCollect extends Command @@ -390,6 +390,7 @@ class HtmlCollect extends Command
390 $js_html = curl_c(getImageUrl($new_source), false); 390 $js_html = curl_c(getImageUrl($new_source), false);
391 preg_match_all("/[large|thumb]+URL:['\"]+(\s*[^>]+?)['\"]+,/i", $js_html, $result_js_source); 391 preg_match_all("/[large|thumb]+URL:['\"]+(\s*[^>]+?)['\"]+,/i", $js_html, $result_js_source);
392 $js_source = $result_js_source[1] ?? []; 392 $js_source = $result_js_source[1] ?? [];
  393 + if($js_source){
393 foreach ($js_source as $vjs) { 394 foreach ($js_source as $vjs) {
394 $vjs_result = $this->url_check($vjs, $project_id, $domain, $web_url_domain, $home_url); 395 $vjs_result = $this->url_check($vjs, $project_id, $domain, $web_url_domain, $home_url);
395 if (!$vjs_result) { 396 if (!$vjs_result) {
@@ -416,11 +417,13 @@ class HtmlCollect extends Command @@ -416,11 +417,13 @@ class HtmlCollect extends Command
416 CosService::uploadRemote($project_id, 'source', $new_source, $new_source, $js_html); 417 CosService::uploadRemote($project_id, 'source', $new_source, $new_source, $js_html);
417 } 418 }
418 } 419 }
  420 + }
419 } elseif(substr($vs['url_complete'], -2, 2) == 'js') { 421 } elseif(substr($vs['url_complete'], -2, 2) == 'js') {
420 422
421 $js_html = curl_c(getImageUrl($vs['url_complete']), false); 423 $js_html = curl_c(getImageUrl($vs['url_complete']), false);
422 preg_match_all("/[large|thumb]+URL:['\"]+(\s*[^>]+?)['\"]+,/i", $js_html, $result_js_source); 424 preg_match_all("/[large|thumb]+URL:['\"]+(\s*[^>]+?)['\"]+,/i", $js_html, $result_js_source);
423 $js_source = $result_js_source[1] ?? []; 425 $js_source = $result_js_source[1] ?? [];
  426 + if($js_source){
424 foreach ($js_source as $vjs) { 427 foreach ($js_source as $vjs) {
425 $vjs_result = $this->url_check($vjs, $project_id, $domain, $web_url_domain, $home_url); 428 $vjs_result = $this->url_check($vjs, $project_id, $domain, $web_url_domain, $home_url);
426 if (!$vjs_result) { 429 if (!$vjs_result) {
@@ -445,6 +448,7 @@ class HtmlCollect extends Command @@ -445,6 +448,7 @@ class HtmlCollect extends Command
445 } 448 }
446 449
447 CosService::uploadRemote($project_id, 'source', $vs['url_complete'], $vs['url_complete'], $js_html); 450 CosService::uploadRemote($project_id, 'source', $vs['url_complete'], $vs['url_complete'], $js_html);
  451 + }
448 }else{ 452 }else{
449 $html = str_replace($vs['url'], getImageUrl($vs['url_complete']), $html); 453 $html = str_replace($vs['url'], getImageUrl($vs['url_complete']), $html);
450 } 454 }