作者 刘锟

update

@@ -255,13 +255,17 @@ class HtmlCollect extends Command @@ -255,13 +255,17 @@ class HtmlCollect extends Command
255 $query = $arr['query'] ?? ''; 255 $query = $arr['query'] ?? '';
256 256
257 $path_arr = explode('.', $path); 257 $path_arr = explode('.', $path);
  258 + $path_end = end($path_arr);
258 if ( 259 if (
259 (empty($scheme) || $scheme == 'https' || $scheme == 'http') 260 (empty($scheme) || $scheme == 'https' || $scheme == 'http')
260 && (empty($host) || (strpos($web_url_domain, $host) !== false) || (strpos($home_url, $host) !== false)) 261 && (empty($host) || (strpos($web_url_domain, $host) !== false) || (strpos($home_url, $host) !== false))
261 && $path 262 && $path
262 && (substr($path, 0, 1) == '/') 263 && (substr($path, 0, 1) == '/')
263 && (strpos($path, '.') !== false) 264 && (strpos($path, '.') !== false)
264 - && (!in_array(end($path_arr), ['html', 'php', 'com', 'xml'])) 265 + && (strpos($path_end, 'html') === false)
  266 + && (strpos($path_end, 'php') === false)
  267 + && (strpos($path_end, 'com') === false)
  268 + && (strpos($path_end, 'xml') === false)
265 ) { 269 ) {
266 $source = CollectSource::where('project_id', $project_id)->where('origin', $url)->first(); 270 $source = CollectSource::where('project_id', $project_id)->where('origin', $url)->first();
267 if (!$source) { 271 if (!$source) {
@@ -255,13 +255,17 @@ class HtmlLanguageCollect extends Command @@ -255,13 +255,17 @@ class HtmlLanguageCollect extends Command
255 $query = $arr['query'] ?? ''; 255 $query = $arr['query'] ?? '';
256 256
257 $path_arr = explode('.', $path); 257 $path_arr = explode('.', $path);
  258 + $path_end = end($path_arr);
258 if ( 259 if (
259 (empty($scheme) || $scheme == 'https' || $scheme == 'http') 260 (empty($scheme) || $scheme == 'https' || $scheme == 'http')
260 && (empty($host) || (strpos($web_url_domain, $host) !== false) || (strpos($home_url, $host) !== false)) 261 && (empty($host) || (strpos($web_url_domain, $host) !== false) || (strpos($home_url, $host) !== false))
261 && $path 262 && $path
262 && (substr($path, 0, 1) == '/') 263 && (substr($path, 0, 1) == '/')
263 && (strpos($path, '.') !== false) 264 && (strpos($path, '.') !== false)
264 - && (!in_array(end($path_arr), ['html', 'php', 'com', 'xml'])) 265 + && (strpos($path_end, 'html') === false)
  266 + && (strpos($path_end, 'php') === false)
  267 + && (strpos($path_end, 'com') === false)
  268 + && (strpos($path_end, 'xml') === false)
265 ) { 269 ) {
266 $source = CollectSource::where('project_id', $project_id)->where('origin', $url)->first(); 270 $source = CollectSource::where('project_id', $project_id)->where('origin', $url)->first();
267 if (!$source) { 271 if (!$source) {