Fix URL used to redirect
[lhc/web/wiklou.git] / includes / SpecialImagelist.php
index c5f7115..cc42ad4 100644 (file)
@@ -1,8 +1,15 @@
 <?php
-
-function wfSpecialImagelist()
-{
-       global $wgUser, $wgOut, $wgLang, $wgRequest;
+/**
+ *
+ * @package MediaWiki
+ * @subpackage SpecialPage
+ */
+
+/**
+ *
+ */
+function wfSpecialImagelist() {
+       global $wgUser, $wgOut, $wgLang, $wgContLang, $wgRequest;
        
        $sort = $wgRequest->getVal( 'sort' );
        $wpIlMatch = $wgRequest->getText( 'wpIlMatch' );
@@ -31,6 +38,7 @@ function wfSpecialImagelist()
                $sql .= " ORDER BY img_name";
                $st = $byname;
        } else {
+               $sort = "bydate";
                $sql .= " ORDER BY img_timestamp DESC";
                $st = $bydate;
        }
@@ -59,7 +67,7 @@ function wfSpecialImagelist()
          htmlspecialchars( $wpIlMatch ) . "\" /> " .
          "<input type='submit' name=\"wpIlSubmit\" value=\"{$sub}\" /></form>" );
        $nums = array( 50, 100, 250, 500 );
-       $here = $wgLang->specialPage( "Imagelist" );
+       $here = $wgContLang->specialPage( "Imagelist" );
 
        $fill = "";
        $first = true;
@@ -102,21 +110,21 @@ function wfSpecialImagelist()
                $name = $s->img_name;
                $ut = $s->img_user_text;
                if ( 0 == $s->img_user ) { $ul = $ut; }
-               else { $ul = $sk->makeLink( $wgLang->getNsText(
+               else { $ul = $sk->makeLink( $wgContLang->getNsText(
                  Namespace::getUser() ) . ":{$ut}", $ut ); }
 
-               $ilink = "<a href=\"" . Image::wfImageUrl( $name ) .
-                 "\">{$name}</a>";
+               $ilink = "<a href=\"" . htmlspecialchars( Image::wfImageUrl( $name ) ) .
+                 "\">" . htmlspecialchars( $name ) . "</a>";
 
                $nb = wfMsg( "nbytes", $wgLang->formatNum( $s->img_size ) );
                $l = "(" .
-                 $sk->makeKnownLink( $wgLang->getNsText(
+                 $sk->makeKnownLink( $wgContLang->getNsText(
                  Namespace::getImage() ) . ":{$name}", wfMsg( "imgdesc" ) ) .
                  ") {$ilink} . . {$nb} . . {$ul} . . " .
                  $wgLang->timeanddate( $s->img_timestamp, true );
 
                if ( "" != $s->img_description ) {
-                       $l .= " <em>({$s->img_description})</em>";
+                       $l .= ' <i>(' . $sk->formatComment( $s->img_description ) . ')</i>';
                }
                $wgOut->addHTML( "{$l}<br />\n" );
        }