Skip to content

Commit 6f4dd83

Browse files
committed
12976-Blog-meta-description-fix
1 parent 971e35d commit 6f4dd83

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

Model/Author.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ public function getMetaDescription()
114114
$desc = $this->getShortContentExtractor()->execute($this->getData('content'), 500);
115115
}
116116

117-
$stylePattern = "~\<style(.*)\>(.*)\<\/style\>~";
117+
$stylePattern = "~<style\b[^>]*>.*?</style>~is";
118118
$desc = preg_replace($stylePattern, '', $desc);
119119
$desc = trim(strip_tags((string)$desc));
120120
$desc = str_replace(["\r\n", "\n\r", "\r", "\n"], ' ', $desc);

Model/Category.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ public function getMetaDescription()
398398
$desc = $this->getShortContentExtractor()->execute($this->getData('content'), 500);
399399
}
400400

401-
$stylePattern = "~\<style(.*)\>(.*)\<\/style\>~";
401+
$stylePattern = "~<style\b[^>]*>.*?</style>~is";
402402
$desc = preg_replace($stylePattern, '', $desc);
403403
$desc = trim(strip_tags((string)$desc));
404404
$desc = str_replace(["\r\n", "\n\r", "\r", "\n"], ' ', $desc);

Model/Post.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -574,7 +574,7 @@ public function getMetaDescription()
574574
$desc = $this->getShortFilteredContent(500);
575575
}
576576

577-
$stylePattern = "~\<style(.*)\>(.*)\<\/style\>~";
577+
$stylePattern = "~<style\b[^>]*>.*?</style>~is";
578578
$desc = preg_replace($stylePattern, '', $desc);
579579
$desc = trim(strip_tags((string)$desc));
580580
$desc = str_replace(["\r\n", "\n\r", "\r", "\n"], ' ', $desc);

Model/Tag.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ public function getMetaDescription()
187187
$desc = $this->getShortContentExtractor()->execute($this->getData('content'), 500);
188188
}
189189

190-
$stylePattern = "~\<style(.*)\>(.*)\<\/style\>~";
190+
$stylePattern = "~<style\b[^>]*>.*?</style>~is";
191191
$desc = preg_replace($stylePattern, '', $desc);
192192
$desc = trim(strip_tags((string)$desc));
193193
$desc = str_replace(["\r\n", "\n\r", "\r", "\n"], ' ', $desc);

0 commit comments

Comments
 (0)