From 9933b9d5a2300edd3232e60016798fb0706bdaa2 Mon Sep 17 00:00:00 2001 From: Cyperghost Date: Thu, 11 Apr 2024 15:38:02 +0200 Subject: [PATCH] Mark `HtmlBBCodeParser` as deprecated --- .../files/lib/system/bbcode/DomBBCodeParser.class.php | 8 +++++++- .../files/lib/system/bbcode/HtmlBBCodeParser.class.php | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/wcfsetup/install/files/lib/system/bbcode/DomBBCodeParser.class.php b/wcfsetup/install/files/lib/system/bbcode/DomBBCodeParser.class.php index 44181ceb03..17f146326d 100644 --- a/wcfsetup/install/files/lib/system/bbcode/DomBBCodeParser.class.php +++ b/wcfsetup/install/files/lib/system/bbcode/DomBBCodeParser.class.php @@ -33,6 +33,12 @@ final class DomBBCodeParser extends SingletonFactory */ private array $useTextNodes = []; + /** + * tag names used to isolate bbcodes contained in source code elements + * @var string[] + */ + public static array $codeTagNames = ['kbd', 'pre']; + /** * Parses bbcodes in the given DOM document. */ @@ -112,7 +118,7 @@ final class DomBBCodeParser extends SingletonFactory private function convertBBCodeToMetacodeMarker(\DOMNode $node): void { - if (\in_array($node->nodeName, HtmlBBCodeParser::$codeTagNames)) { + if (\in_array($node->nodeName, DomBBCodeParser::$codeTagNames)) { // don't parse bbcode inside code tags return; } diff --git a/wcfsetup/install/files/lib/system/bbcode/HtmlBBCodeParser.class.php b/wcfsetup/install/files/lib/system/bbcode/HtmlBBCodeParser.class.php index 19e9409b65..ae94f71c17 100644 --- a/wcfsetup/install/files/lib/system/bbcode/HtmlBBCodeParser.class.php +++ b/wcfsetup/install/files/lib/system/bbcode/HtmlBBCodeParser.class.php @@ -21,6 +21,7 @@ use wcf\util\StringUtil; * @copyright 2001-2019 WoltLab GmbH * @license GNU Lesser General Public License * @since 3.0 + * @deprecated 6.1 use `DomBBCodeParser` instead */ class HtmlBBCodeParser extends BBCodeParser { -- 2.20.1