修复个别资源因标题特殊报错的问题
This commit is contained in:
@@ -68,6 +68,10 @@ class Source extends QfShop
|
|||||||
if(!is_null($result)){
|
if(!is_null($result)){
|
||||||
$result->inc('page_views')->update();
|
$result->inc('page_views')->update();
|
||||||
$result['times'] = substr($result['time'], 0, 10);
|
$result['times'] = substr($result['time'], 0, 10);
|
||||||
|
|
||||||
|
$string = trim($result['title']); // 去除前后空格
|
||||||
|
$string = str_replace("'", "", $string); // 去除所有单引号
|
||||||
|
$result['title'] = $string;
|
||||||
}
|
}
|
||||||
unset($result['time']);
|
unset($result['time']);
|
||||||
return $result;
|
return $result;
|
||||||
@@ -215,6 +219,11 @@ class Source extends QfShop
|
|||||||
$item['name'] = highlightKeywords($item['title'], $searchTitle);
|
$item['name'] = highlightKeywords($item['title'], $searchTitle);
|
||||||
$item['times'] = substr($item['time'], 0, 10);
|
$item['times'] = substr($item['time'], 0, 10);
|
||||||
unset($item['time']);
|
unset($item['time']);
|
||||||
|
|
||||||
|
$string = trim($item['title']); // 去除前后空格
|
||||||
|
$string = str_replace("'", "", $string); // 去除所有单引号
|
||||||
|
$item['title'] = $string;
|
||||||
|
|
||||||
return $item;
|
return $item;
|
||||||
})
|
})
|
||||||
->toArray();
|
->toArray();
|
||||||
|
|||||||
Reference in New Issue
Block a user