From d85dc9ae43a0a3d7974c688b18cbb0a71a5c79b0 Mon Sep 17 00:00:00 2001 From: Fraenkiman Date: Fri, 29 Dec 2023 23:05:06 +0100 Subject: [PATCH] Fixes #294 - Fixes PHP Warning: Deprecated: strlen(): Passing null to parameter #1 ($string) of type string is deprecated --- fp-plugins/bbcode/inc/stringparser.class.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/fp-plugins/bbcode/inc/stringparser.class.php b/fp-plugins/bbcode/inc/stringparser.class.php index 2230b03..24a3ef9 100755 --- a/fp-plugins/bbcode/inc/stringparser.class.php +++ b/fp-plugins/bbcode/inc/stringparser.class.php @@ -296,6 +296,10 @@ class StringParser { return false; } $this->_parsing = true; + { + $text = $text ?? ''; // If the value passed into function is null set $text to a blank string + return htmlspecialchars($text, ENT_QUOTES, 'UTF-8', false); // Return escaped string + } $this->_text = $this->_applyPrefilters($text); $this->_output = null; $this->_length = strlen($this->_text);