* Fix explicit s-maxage=0 on raw pages; should help with proxy issues in
[lhc/web/wiklou.git] / includes / SpecialImagelist.php
index b889cf7..6438e9c 100644 (file)
@@ -9,8 +9,8 @@
  *
  */
 function wfSpecialImagelist() {
-       global $wgUser, $wgOut, $wgLang, $wgContLang, $wgRequest;
-       
+       global $wgUser, $wgOut, $wgLang, $wgRequest, $wgMiserMode;
+
        $sort = $wgRequest->getVal( 'sort' );
        $wpIlMatch = $wgRequest->getText( 'wpIlMatch' );
        $dbr =& wfGetDB( DB_SLAVE );
@@ -22,7 +22,7 @@ function wfSpecialImagelist() {
        $bydate = wfMsg( "bydate" );
        $bysize = wfMsg( "bysize" );
 
-       if ( !empty( $wpIlMatch ) ) {
+       if ( !$wgMiserMode && !empty( $wpIlMatch ) ) {
                $nt = Title::newFromUrl( $wpIlMatch );
                if($nt ) {
                        $m = $dbr->strencode( strtolower( $nt->getDBkey() ) );
@@ -56,16 +56,17 @@ function wfSpecialImagelist() {
        $wgOut->addHTML( "<p>{$text}\n</p>" );
 
        $sk = $wgUser->getSkin();
-       $cap = wfMsg( "ilshowmatch" );
        $sub = wfMsg( "ilsubmit" );
        $titleObj = Title::makeTitle( NS_SPECIAL, "Imagelist" );
        $action = $titleObj->escapeLocalURL(  "sort={$sort}&limit={$limit}" );
 
-       $wgOut->addHTML( "<form id=\"imagesearch\" method=\"post\" action=\"" .
-         "{$action}\">" .
-         "{$cap}: <input type='text' size='8' name=\"wpIlMatch\" value=\"" .
-         htmlspecialchars( $wpIlMatch ) . "\" /> " .
-         "<input type='submit' name=\"wpIlSubmit\" value=\"{$sub}\" /></form>" );
+       if ( !$wgMiserMode ) {
+               $wgOut->addHTML( "<form id=\"imagesearch\" method=\"post\" action=\"" .
+                 "{$action}\">" .
+                 "<input type='text' size='20' name=\"wpIlMatch\" value=\"" .
+                 htmlspecialchars( $wpIlMatch ) . "\" /> " .
+                 "<input type='submit' name=\"wpIlSubmit\" value=\"{$sub}\" /></form>" );
+       }
        $nums = array( 50, 100, 250, 500 );
        $here = Title::makeTitle( NS_SPECIAL, 'Imagelist' );
 
@@ -116,7 +117,7 @@ function wfSpecialImagelist() {
                }
 
                $ilink = "<a href=\"" . htmlspecialchars( Image::imageUrl( $name ) ) .
-                 "\">" . htmlspecialchars( $name ) . "</a>";
+                 "\">" . strtr(htmlspecialchars( $name ), '_', ' ') . "</a>";
 
                $nb = wfMsg( "nbytes", $wgLang->formatNum( $s->img_size ) );
                $l = "(" .