Use OutputPage::wrapWikiTextAsInterface() to add safe <div> wrappers
[lhc/web/wiklou.git] / includes / specials / SpecialTags.php
index 9a9f4f2..ca8ce89 100644 (file)
@@ -321,8 +321,7 @@ class SpecialTags extends SpecialPage {
                        $out->addBacklinkSubtitle( $this->getPageTitle() );
                        return true;
                } else {
-                       $out->addWikiTextAsInterface( "<div class=\"error\">\n" . $status->getWikiText() .
-                               "\n</div>" );
+                       $out->wrapWikiTextAsInterface( 'error', $status->getWikiText() );
                        return false;
                }
        }
@@ -340,8 +339,7 @@ class SpecialTags extends SpecialPage {
                // is the tag actually able to be deleted?
                $canDeleteResult = ChangeTags::canDeleteTag( $tag, $user );
                if ( !$canDeleteResult->isGood() ) {
-                       $out->addWikiTextAsInterface( "<div class=\"error\">\n" . $canDeleteResult->getWikiText() .
-                               "\n</div>" );
+                       $out->wrapWikiTextAsInterface( 'error', $canDeleteResult->getWikiText() );
                        if ( !$canDeleteResult->isOK() ) {
                                return;
                        }
@@ -402,8 +400,7 @@ class SpecialTags extends SpecialPage {
                $func = $activate ? 'canActivateTag' : 'canDeactivateTag';
                $result = ChangeTags::$func( $tag, $user );
                if ( !$result->isGood() ) {
-                       $out->addWikiTextAsInterface( "<div class=\"error\">\n" . $result->getWikiText() .
-                               "\n</div>" );
+                       $out->wrapWikiTextAsInterface( 'error', $result->getWikiText() );
                        if ( !$result->isOK() ) {
                                return;
                        }
@@ -455,8 +452,7 @@ class SpecialTags extends SpecialPage {
                        $out->addReturnTo( $this->getPageTitle() );
                        return true;
                } else {
-                       $out->addWikiTextAsInterface( "<div class=\"error\">\n" . $status->getWikitext() .
-                               "\n</div>" );
+                       $out->wrapWikiTextAsInterface( 'error', $status->getWikitext() );
                        return false;
                }
        }