正在显示
1 个修改的文件
包含
4 行增加
和
1 行删除
| @@ -308,7 +308,10 @@ class Body { | @@ -308,7 +308,10 @@ class Body { | ||
| 308 | * @time 2024/9/21 9:55 | 308 | * @time 2024/9/21 9:55 |
| 309 | */ | 309 | */ |
| 310 | public function getText():string { | 310 | public function getText():string { |
| 311 | - return $this->getHtmlOrText('text/plain') ? : strip_tags($this->getHtml()); | 311 | + $text = $this->getHtmlOrText('text/plain') ? : $this->getHtml(); |
| 312 | + $text = preg_replace('/<style.*?<\/style>/is', '', $text); | ||
| 313 | + $text = preg_replace('/<script.*?<\/script>/is', '', $text); | ||
| 314 | + return strip_tags($text); | ||
| 312 | } | 315 | } |
| 313 | 316 | ||
| 314 | /** | 317 | /** |
-
请 注册 或 登录 后发表评论