Followup r80122, protected, just incase it's needed..
[lhc/web/wiklou.git] / includes / specials / SpecialSearch.php
index 5069552..64394b6 100644 (file)
@@ -39,10 +39,11 @@ class SpecialSearch extends SpecialPage {
         * @param $par String or null
         */
        public function execute( $par ) {
-               global $wgRequest, $wgUser;
+               global $wgRequest, $wgUser, $wgOut;
 
                $this->setHeaders();
                $this->outputHeader();
+               $wgOut->allowClickjacking();
 
                // Strip underscores from title parameter; most of the time we'll want
                // text form here. But don't strip underscores from actual text params!
@@ -102,8 +103,13 @@ class SpecialSearch extends SpecialPage {
                }
                # If there's an exact or very near match, jump right there.
                $t = SearchEngine::getNearMatch( $term );
+               
+               if ( !wfRunHooks( 'SpecialSearchGo', array( &$t, &$term ) ) ) {
+                       # Hook requested termination
+                       return;
+               }
+               
                if( !is_null( $t ) ) {
-                       wfRunHooks( 'SpecialSearchGomatch', array( &$t ) );
                        $wgOut->redirect( $t->getFullURL() );
                        return;
                }
@@ -285,6 +291,7 @@ class SpecialSearch extends SpecialPage {
                        wfRunHooks( 'SpecialSearchNoResults', array( $term ) );
                } 
 
+               $wgOut->parserOptions()->setEditSection( false );
                if( $titleMatches ) {
                        if( $numTitleMatches > 0 ) {
                                $wgOut->wrapWikiMsg( "==$1==\n", 'titlematches' );
@@ -587,7 +594,7 @@ class SpecialSearch extends SpecialPage {
                        if( $img ) {
                                $thumb = $img->transform( array( 'width' => 120, 'height' => 120 ) );
                                if( $thumb ) {
-                                       $desc = $img->getShortDesc();
+                                       $desc = wfMsgExt( 'parentheses', 'parseinline', $img->getShortDesc() );
                                        wfProfileOut( __METHOD__ );
                                        // Float doesn't seem to interact well with the bullets.
                                        // Table messes up vertical alignment of the bullets.