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