diff --git a/lib/DirScanner.php b/lib/DirScanner.php index 2838f87..f1930f7 100644 --- a/lib/DirScanner.php +++ b/lib/DirScanner.php @@ -600,9 +600,10 @@ Class DirScanner { if (!empty($matches)) { foreach ($matches as $url) { - if (preg_match('/^http(s)?:\/\//i', $url)) {continue;} + if (preg_match('/^http(s)?:\/\//i', $url) || preg_match('/^\//i', $url)) {continue;} + + $src_realpath = !preg_match('/^\.\//', $url) ? "{$pathinfo['dirname']}/{$url}" : "{$pathinfo['dirname']}/" . preg_replace('/^\.\//', '', $url); - $src_realpath = "{$pathinfo['dirname']}/{$url}"; if (file_exists($src_realpath)) { $id = $this->getId($src_realpath); $fp = fopen($src_realpath, 'r'); diff --git a/test/init_test_files.sh b/test/init_test_files.sh index 01da4ed..9eaacd2 100755 --- a/test/init_test_files.sh +++ b/test/init_test_files.sh @@ -36,15 +36,21 @@ tee "Readme.md" <谷歌图片搜索 -Bing图片搜索 +Bing图片搜索 +Bing图片搜索 + +网站ICON: +Google +Bing ## 小说 常用的小说网站。 金庸小说 -古龙小说 +古龙小说 EOF