|
...
|
...
|
@@ -188,13 +188,13 @@ class TranslateLogic extends BaseLogic |
|
|
|
// $contentData[] = $trimmedString;
|
|
|
|
// }
|
|
|
|
$contentData = array_values($textContentArray);
|
|
|
|
$pattern = '/<meta\s+([^>]*\s+)?name=[\'"](keywords|description)[\'"]([^>]*\s+)?content=[\'"]([^\'"]+)[\'"]([^>]*)?>/i'; // 匹配 name 为 "keywords" 或 "description" 的 meta 标签的正则表达式
|
|
|
|
$pattern = '/<meta\s+[^>]*name=[\'"](keywords|description)[\'"][^>]*content=[\'"]([^\'"]+)[\'"]>/i'; // 匹配 name 为 "keywords" 或 "description" 的 meta 标签的正则表达式
|
|
|
|
$matches = array();
|
|
|
|
preg_match_all($pattern, $strippedContent, $matches);
|
|
|
|
$metaData = array();
|
|
|
|
@file_put_contents(storage_path('logs/lyh_error.log'), var_export($matches[2], true) . PHP_EOL, FILE_APPEND);
|
|
|
|
foreach ($matches[2] as $index => $content) {
|
|
|
|
if(!empty($content)){
|
|
|
|
if(!empty(trim($content))){
|
|
|
|
$metaData[] = $content;
|
|
|
|
}
|
|
|
|
}
|
...
|
...
|
|