Use Html:rawElement() where possible in special pages.
[lhc/web/wiklou.git] / includes / exception / LocalizedException.php
index cbdb53e..c0182d5 100644 (file)
@@ -45,8 +45,9 @@ class LocalizedException extends Exception implements ILocalizedException {
 
        /**
         * @param string|array|MessageSpecifier $messageSpec See Message::newFromSpecifier
-        * @param int $code Exception code
-        * @param Exception|Throwable $previous The previous exception used for the exception chaining.
+        * @param int $code
+        * @param Exception|Throwable|null $previous The previous exception used for the exception
+        *  chaining.
         */
        public function __construct( $messageSpec, $code = 0, $previous = null ) {
                $this->messageSpec = $messageSpec;
@@ -56,7 +57,7 @@ class LocalizedException extends Exception implements ILocalizedException {
                // customizations, and make a basic attempt to turn markup into text.
                $msg = $this->getMessageObject()->inLanguage( 'en' )->useDatabase( false )->text();
                $msg = preg_replace( '!</?(var|kbd|samp|code)>!', '"', $msg );
-               $msg = html_entity_decode( strip_tags( $msg ), ENT_QUOTES | ENT_HTML5 );
+               $msg = Sanitizer::stripAllTags( $msg );
                parent::__construct( $msg, $code, $previous );
        }