正在显示
1 个修改的文件
包含
1 行增加
和
1 行删除
| @@ -188,7 +188,7 @@ class TranslateLogic extends BaseLogic | @@ -188,7 +188,7 @@ class TranslateLogic extends BaseLogic | ||
| 188 | // $contentData[] = $trimmedString; | 188 | // $contentData[] = $trimmedString; |
| 189 | // } | 189 | // } |
| 190 | $contentData = array_values($textContentArray); | 190 | $contentData = array_values($textContentArray); |
| 191 | - $pattern = '/<meta\s+[^>]*name=[\'"](keywords|description)[\'"][^>]*content=[\'"]([^\'"]+)[\'"]>/i'; // 匹配 name 为 "keywords" 或 "description" 的 meta 标签的正则表达式 | 191 | + $pattern = '/<meta\s+([^>]*\s+)?name=[\'"](keywords|description)[\'"]([^>]*\s+)?content=[\'"]([^\'"]+)[\'"]([^>]*)?>/i'; // 匹配 name 为 "keywords" 或 "description" 的 meta 标签的正则表达式 |
| 192 | $matches = array(); | 192 | $matches = array(); |
| 193 | preg_match_all($pattern, $strippedContent, $matches); | 193 | preg_match_all($pattern, $strippedContent, $matches); |
| 194 | $metaData = array(); | 194 | $metaData = array(); |
-
请 注册 或 登录 后发表评论