(bug 14771) Thumbnail links to individual DjVu pages have two "page" parameters
authorChad Horohoe <demon@users.mediawiki.org>
Fri, 13 Mar 2009 15:02:28 +0000 (15:02 +0000)
committerChad Horohoe <demon@users.mediawiki.org>
Fri, 13 Mar 2009 15:02:28 +0000 (15:02 +0000)
RELEASE-NOTES
includes/Linker.php

index 170eefe..61c5f59 100644 (file)
@@ -263,6 +263,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 * (bug 17778) MediaWiki:Catseparator can now have HTML entities
 * (bug 17676) Error on Special:ListFiles when using Postgres
 * Special:Export doesn't use raw SQL queries anymore
+* (bug 14771) Thumbnail links to individual DjVu pages have two no longer have
+  two "page" parameters
 
 
 == API changes in 1.15 ==
index c9d4db1..b739244 100644 (file)
@@ -882,10 +882,13 @@ class Linker {
                        }
                }
 
-               if( $page ) {
-                       $query = $query ? '&page=' . urlencode( $page ) : 'page=' . urlencode( $page );
-               }
+               # ThumbnailImage::toHtml() already adds page= onto the end of DjVu URLs
+               # So we don't need to pass it here in $query. However, the URL for the
+               # zoom icon still needs it, so we make a unique query for it. See bug 14771
                $url = $title->getLocalURL( $query );
+               if( $page ) { 
+                       $url = wfAppendQuery( $url, 'page=' . urlencode( $page ) );
+               }
 
                $more = htmlspecialchars( wfMsg( 'thumbnail-more' ) );