Actually format search error Status objects nicely
authorChad Horohoe <chadh@wikimedia.org>
Tue, 17 Jun 2014 16:51:03 +0000 (09:51 -0700)
committerChad Horohoe <chadh@wikimedia.org>
Tue, 17 Jun 2014 16:51:03 +0000 (09:51 -0700)
htmlspecialchars() on wikitext that's passed to addHtml()?

Change-Id: I6cff09ebc052841b923bbed8b9fa02a208e7d61c

includes/specials/SpecialSearch.php

index 965885e..1cc5930 100644 (file)
@@ -412,7 +412,7 @@ class SpecialSearch extends SpecialPage {
                if ( $num === 0 ) {
                        if ( $textStatus ) {
                                $out->addHTML( '<div class="error">' .
-                                       htmlspecialchars( $textStatus->getWikiText( 'search-error' ) ) . '</div>' );
+                                       $textStatus->getMessage( 'search-error' ) . '</div>' );
                        } else {
                                $out->wrapWikiMsg( "<p class=\"mw-search-nonefound\">\n$1</p>",
                                        array( 'search-nonefound', wfEscapeWikiText( $term ) ) );