Skip to content

Commit 0c7703c

Browse files
committed
Use filter_var in getContent
1 parent 2ae1c05 commit 0c7703c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/libraries/NewsPost.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -236,15 +236,15 @@ public function getCategoryId() {
236236
return $this->category_id;
237237
}
238238

239-
public function getContent($prepare) {
240-
if (!$prepare) {
239+
public function getContent(bool $render) {
240+
if (!$render) {
241241
return $this->content;
242242
}
243243
if ($this->options_bitmask & self::OPTION_MARKDOWN) {
244244
$md = new Parsedown();
245245
return $md->text($this->content);
246246
} else {
247-
return htmlspecialchars($this->content, ENT_HTML5, "UTF-8");
247+
return filter_var($this->content, FILTER_SANITIZE_FULL_SPECIAL_CHARS);
248248
}
249249
}
250250

0 commit comments

Comments
 (0)