From b1deacfef3cac1466596f0ea72bb132c921871bb Mon Sep 17 00:00:00 2001 From: Jacob Barkdull Date: Sun, 6 Nov 2022 12:07:34 -0800 Subject: [PATCH] Addressing #335 --- backend/classes/writecomments.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/backend/classes/writecomments.php b/backend/classes/writecomments.php index dec67379..e4d93490 100644 --- a/backend/classes/writecomments.php +++ b/backend/classes/writecomments.php @@ -27,7 +27,7 @@ class WriteComments extends Secrets protected $login; protected $cookies; protected $crypto; - protected $avatar; + protected $avatars; protected $templater; protected $mail; @@ -417,7 +417,7 @@ protected function setupCommentData ($editing = false) $url_regex = '/((http|https|ftp):\/\/[a-z0-9-@:;%_\+.~#?&\/=]+)/i'; // Extract URLs from comment - $clean_code = preg_replace_callback ($url_regex, 'self::urlExtractor', $clean_code); + $clean_code = preg_replace_callback ($url_regex, [$this, 'urlExtractor'], $clean_code); // Escape all HTML tags excluding allowed tags $clean_code = $this->htmlSelectiveEscape ($clean_code); @@ -429,8 +429,8 @@ protected function setupCommentData ($editing = false) $clean_code = $this->tagCloser (array ('code'), $clean_code); // Escape HTML inside of tags and markdown code blocks - $clean_code = preg_replace_callback ('/()(.*?)(<\/code>)/is', 'self::codeEscaper', $clean_code); - $clean_code = preg_replace_callback ('/(```)(.*?)(```)/is', 'self::codeEscaper', $clean_code); + $clean_code = preg_replace_callback ('/()(.*?)(<\/code>)/is', [$this, 'codeEscaper'], $clean_code); + $clean_code = preg_replace_callback ('/(```)(.*?)(```)/is', [$this, 'codeEscaper'], $clean_code); // Close remaining tags $clean_code = $this->tagCloser ($this->closeTags, $clean_code);