Removed unused code from WSC <3.0
authorAlexander Ebert <ebert@woltlab.com>
Mon, 4 Apr 2022 13:46:30 +0000 (15:46 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Mon, 4 Apr 2022 13:46:30 +0000 (15:46 +0200)
See #4718

wcfsetup/install/files/lib/acp/form/BBCodeAddForm.class.php
wcfsetup/install/files/lib/system/bbcode/BBCodeParser.class.php

index 7b6127c4944223edbbfae72603a6edca33c3804e..3082513b071eae98ec1a1b1bd72faa5658d854cf 100644 (file)
@@ -29,12 +29,6 @@ class BBCodeAddForm extends AbstractForm
      */
     public $activeMenuItem = 'wcf.acp.menu.link.bbcode.add';
 
-    /**
-     * allowed child bbcodes
-     * @var string
-     */
-    public $allowedChildren = 'all';
-
     /**
      * list of attributes
      * @var object[]
@@ -122,9 +116,6 @@ class BBCodeAddForm extends AbstractForm
     {
         parent::readFormParameters();
 
-        if (isset($_POST['allowedChildren'])) {
-            $this->allowedChildren = StringUtil::trim($_POST['allowedChildren']);
-        }
         if (isset($_POST['attributes'])) {
             $this->attributes = $_POST['attributes'];
         }
index ed9724c7c0c8f2251f7572e1027ea8379667c43c..b97fcd1ea7198cfb3596c9fb64da5c76cfa69979 100644 (file)
@@ -380,35 +380,11 @@ class BBCodeParser extends SingletonFactory
      * @param string $tag
      * @param bool $closing
      * @return  bool
+     * @deprecated 5.5 This method is useless since 3.0, do not use it.
      */
     protected function isAllowed(array $openTags, $tag, $closing = false)
     {
-        foreach ($openTags as $openTag) {
-            if ($closing && $openTag == $tag) {
-                continue;
-            }
-            if ($this->bbcodes[$openTag]->allowedChildren == 'all') {
-                continue;
-            }
-            if ($this->bbcodes[$openTag]->allowedChildren == 'none') {
-                return false;
-            }
-
-            $arguments = \explode('^', $this->bbcodes[$openTag]->allowedChildren);
-            if (!empty($arguments[1])) {
-                $tags = \explode(',', $arguments[1]);
-            } else {
-                $tags = [];
-            }
-
-            if ($arguments[0] == 'none' && !\in_array($tag, $tags)) {
-                return false;
-            }
-            if ($arguments[0] == 'all' && \in_array($tag, $tags)) {
-                return false;
-            }
-        }
-
+        // This is a left-over from the pre WoltLab Suite 3.0 era.
         return true;
     }