* (bug 3073) Keep search parameter on paging in Special:Newimages
authorBrion Vibber <brion@users.mediawiki.org>
Mon, 12 Dec 2005 03:23:01 +0000 (03:23 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Mon, 12 Dec 2005 03:23:01 +0000 (03:23 +0000)
RELEASE-NOTES
includes/SpecialNewimages.php

index 9aca0b8..539513f 100644 (file)
@@ -312,6 +312,7 @@ fully support the editing toolbar, but was found to be too confusing.
 * (bug 1600) Trigger edit conflict on duplicate section=new submissions
 * (bug 4001) Use local variables properly in wikibits.js akeytt()
 * Fix regression: old version missing from edit links on CSS/JS pages
+* (bug 3073) Keep search parameter on paging in Special:Newimages
 
 
 === Caveats ===
index 5d47ca9..98c6c36 100644 (file)
@@ -72,6 +72,7 @@ function wfSpecialNewimages( $par, $specialPage ) {
                        $limit = $parval;
 
        $where = array();
+       $searchpar = '';
        if ( $wpIlMatch != '' ) {
                $nt = Title::newFromUrl( $wpIlMatch );
                if($nt ) {
@@ -79,6 +80,7 @@ function wfSpecialNewimages( $par, $specialPage ) {
                        $m = str_replace( '%', "\\%", $m );
                        $m = str_replace( '_', "\\_", $m );
                        $where[] = "LCASE(img_name) LIKE '%{$m}%'";
+                       $searchpar = '&wpIlMatch=' . urlencode( $wpIlMatch );
                }
        }
 
@@ -153,7 +155,7 @@ function wfSpecialNewimages( $par, $specialPage ) {
 
        $sub = wfMsg( 'ilsubmit' );
        $titleObj = Title::makeTitle( NS_SPECIAL, 'Newimages' );
-       $action = $titleObj->escapeLocalURL(  "limit={$limit}" );
+       $action = $titleObj->escapeLocalURL();
        if(!$hidebots) {
                $action.='&hidebots=0';
        }
@@ -178,18 +180,18 @@ function wfSpecialNewimages( $par, $specialPage ) {
        }
        $now = wfTimestampNow();
        $date = $wgLang->timeanddate( $now );
-       $dateLink = $sk->makeKnownLinkObj( $titleObj, wfMsg( 'rclistfrom', $date ), 'from='.$now.$botpar );
+       $dateLink = $sk->makeKnownLinkObj( $titleObj, wfMsg( 'rclistfrom', $date ), 'from='.$now.$botpar.$searchpar );
 
-       $botLink = $sk->makeKnownLinkObj($titleObj, wfMsg( 'showhidebots', ($hidebots ? wfMsg('show') : wfMsg('hide'))),'hidebots='.($hidebots ? '0' : '1'));
+       $botLink = $sk->makeKnownLinkObj($titleObj, wfMsg( 'showhidebots', ($hidebots ? wfMsg('show') : wfMsg('hide'))),'hidebots='.($hidebots ? '0' : '1').$searchpar);
 
        $prevLink = wfMsg( 'prevn', $wgLang->formatNum( $limit ) );
        if( $firstTimestamp && $firstTimestamp != $latestTimestamp ) {
-               $prevLink = $sk->makeKnownLinkObj( $titleObj, $prevLink, 'from=' . $firstTimestamp . $botpar );
+               $prevLink = $sk->makeKnownLinkObj( $titleObj, $prevLink, 'from=' . $firstTimestamp . $botpar . $searchpar );
        }
 
        $nextLink = wfMsg( 'nextn', $wgLang->formatNum( $limit ) );
        if( $shownImages > $limit && $lastTimestamp ) {
-               $nextLink = $sk->makeKnownLinkObj( $titleObj, $nextLink, 'until=' . $lastTimestamp.$botpar );
+               $nextLink = $sk->makeKnownLinkObj( $titleObj, $nextLink, 'until=' . $lastTimestamp.$botpar.$searchpar );
        }
 
        $prevnext = '<p>' . $botLink . ' '. wfMsg( 'viewprevnext', $prevLink, $nextLink, $dateLink ) .'</p>';