|
|
|
@ -87,11 +87,14 @@ Class DirScanner {
@@ -87,11 +87,14 @@ Class DirScanner {
|
|
|
|
|
//snapshot相对路径完善,支持secure_link |
|
|
|
|
private function parseDescriptionFiles($realpath) { |
|
|
|
|
$pathinfo = pathinfo($realpath); |
|
|
|
|
$field = preg_replace('/^.+_/', '', $pathinfo['filename']); |
|
|
|
|
$content = file_get_contents($realpath); |
|
|
|
|
$tmp = explode('_', $pathinfo['filename']); |
|
|
|
|
$field = array_pop($tmp); |
|
|
|
|
$content = @file_get_contents($realpath); |
|
|
|
|
if (empty($content)) {return [];} |
|
|
|
|
$content = trim($content); |
|
|
|
|
|
|
|
|
|
$data = []; |
|
|
|
|
if (in_array($field, ['title', 'snapshot'])) { |
|
|
|
|
$content = preg_replace('/\s/', '', $content); |
|
|
|
|
if ($field == 'snapshot') { |
|
|
|
|
$img_realpath = realpath("{$pathinfo['dirname']}/{$content}"); |
|
|
|
|
if (file_exists($img_realpath)) { |
|
|
|
@ -112,8 +115,9 @@ Class DirScanner {
@@ -112,8 +115,9 @@ Class DirScanner {
|
|
|
|
|
|
|
|
|
|
//解析快捷方式文件内容 |
|
|
|
|
private function parseShortCuts($realpath, $filename) { |
|
|
|
|
$content = file_get_contents($realpath); |
|
|
|
|
$content = @file_get_contents($realpath); |
|
|
|
|
if (empty($content) || !preg_match('/\[InternetShortcut\]/i', $content)) {return false;} |
|
|
|
|
$content = trim($content); |
|
|
|
|
|
|
|
|
|
preg_match('/URL=(\S+)/i', $content, $matches); |
|
|
|
|
if (empty($matches) || empty($matches[1])) { |
|
|
|
@ -608,6 +612,7 @@ Class DirScanner {
@@ -608,6 +612,7 @@ Class DirScanner {
|
|
|
|
|
|
|
|
|
|
$content = @file_get_contents($file['realpath']); |
|
|
|
|
if (empty($content)) {return [];} |
|
|
|
|
$content = trim($content); |
|
|
|
|
|
|
|
|
|
# standardize line breaks |
|
|
|
|
$content = str_replace(array("\r\n", "\r"), "\n", $content); |
|
|
|
|