diff --git a/includes/types/spell.class.php b/includes/types/spell.class.php index 09e6c0d2..14b3c7ad 100644 --- a/includes/types/spell.class.php +++ b/includes/types/spell.class.php @@ -1800,6 +1800,13 @@ class SpellList extends BaseType } } + // this should be 0 if all went well + if ($condBrktCnt > 0) + { + trigger_error('SpellList::handleConditions() - string contains unbalanced condition', E_USER_WARNING); + $condParts[3] = $condParts[3] ?? ''; + } + // check if it is know-compatible $know = 0; if (preg_match('/\(?(\!?)[as](\d+)\)?$/i', $condParts[0], $m)) @@ -1889,7 +1896,7 @@ class SpellList extends BaseType // scaling information - spellId:min:max:curr $x .= ''; - return [$x, $btt[1]]; + return [$x, Util::parseHtmlText($btt[1])]; } public function renderTooltip($level = MAX_LEVEL, $interactive = false) @@ -2038,7 +2045,7 @@ class SpellList extends BaseType // scaling information - spellId:min:max:curr $x .= ''; - return [$x, $desc[1]]; + return [$x, Util::parseHtmlText($desc[1])]; } public function getTalentHeadForCurrent() diff --git a/includes/utilities.php b/includes/utilities.php index 4ba5f6f5..a3a2c056 100644 --- a/includes/utilities.php +++ b/includes/utilities.php @@ -671,8 +671,16 @@ abstract class Util } // pageText for Books (Item or GO) and questText - public static function parseHtmlText(string $text, bool $markdown = false) : string + public static function parseHtmlText(/*string|array*/ $text, bool $markdown = false) // : /*string|array*/ { + if (is_array($text)) + { + foreach ($text as &$t) + $t = self::parseHtmlText($t, $markdown); + + return $text; + } + if (stristr($text, '')) // text is basically a html-document with weird linebreak-syntax { $pairs = array(