Merge "Remove a bunch of trailing spaces and unneeded newlines"
[lhc/web/wiklou.git] / includes / specials / SpecialSearch.php
index 3344436..6c33bb8 100644 (file)
@@ -300,7 +300,7 @@ class SpecialSearch extends SpecialPage {
                        )
                );
                $out->addHtml(
-                       Xml::openElement( 'table', array( 'id'=>'mw-search-top-table', 'border'=>0, 'cellpadding'=>0, 'cellspacing'=>0 ) ) .
+                       Xml::openElement( 'table', array( 'id' => 'mw-search-top-table', 'cellpadding' => 0, 'cellspacing' => 0 ) ) .
                        Xml::openElement( 'tr' ) .
                        Xml::openElement( 'td' ) . "\n" .
                        $this->shortDialog( $term ) .
@@ -423,7 +423,7 @@ class SpecialSearch extends SpecialPage {
 
                if( $t->isKnown() ) {
                        $messageName = 'searchmenu-exists';
-               } elseif( $t->userCan( 'create' ) ) {
+               } elseif( $t->userCan( 'create', $this->getUser() ) ) {
                        $messageName = 'searchmenu-new';
                } else {
                        $messageName = 'searchmenu-new-nocreate';
@@ -449,7 +449,9 @@ class SpecialSearch extends SpecialPage {
                $out = $this->getOutput();
                if( strval( $term ) !== ''  ) {
                        $out->setPageTitle( $this->msg( 'searchresults' ) );
-                       $out->setHTMLTitle( $this->msg( 'pagetitle', $this->msg( 'searchresults-title', $term )->plain() ) );
+                       $out->setHTMLTitle( $this->msg( 'pagetitle' )->rawParams(
+                               $this->msg( 'searchresults-title' )->rawParams( $term )->text()
+                       ) );
                }
                // add javascript specific to special:search
                $out->addModules( 'mediawiki.special.search' );
@@ -559,7 +561,7 @@ class SpecialSearch extends SpecialPage {
                //If page content is not readable, just return the title.
                //This is not quite safe, but better than showing excerpts from non-readable pages
                //Note that hiding the entry entirely would screw up paging.
-               if( !$t->userCan( 'read' ) ) {
+               if( !$t->userCan( 'read', $this->getUser() ) ) {
                        wfProfileOut( __METHOD__ );
                        return "<li>{$link}</li>\n";
                }
@@ -667,10 +669,10 @@ class SpecialSearch extends SpecialPage {
                                        return "<li>" .
                                                '<table class="searchResultImage">' .
                                                '<tr>' .
-                                               '<td width="120" align="center" valign="top">' .
+                                               '<td style="width: 120px; text-align: center; vertical-align: top;">' .
                                                $thumb->toHtml( array( 'desc-link' => true ) ) .
                                                '</td>' .
-                                               '<td valign="top">' .
+                                               '<td style="vertical-align: top;">' .
                                                $link .
                                                $extract .
                                                "<div class='mw-search-result-data'>{$score}{$desc} - {$date}{$related}</div>" .
@@ -868,7 +870,7 @@ class SpecialSearch extends SpecialPage {
                for( $i = 0; $i < $numRows; $i += 4 ) {
                        $namespaceTables .= Xml::openElement(
                                'table',
-                               array( 'cellpadding' => 0, 'cellspacing' => 0, 'border' => 0 )
+                               array( 'cellpadding' => 0, 'cellspacing' => 0 )
                        );
                        for( $j = $i; $j < $i + 4 && $j < $numRows; $j++ ) {
                                $namespaceTables .= Xml::tags( 'tr', null, $rows[$j] );