From 8031e6dc4ed57a78962ddeaca9e436ba70e99d7b Mon Sep 17 00:00:00 2001 From: Brian Wolff Date: Sun, 9 Oct 2011 03:50:03 +0000 Subject: [PATCH] (bug 31549; follow-up r83563) Do not include old-style from links in nav links on categories. They can intefere with contradicting pageuntil links which breaks navigation in categories. Not including release notes since tagging 1.18, and first public release that had bug was 1.18. However bug was present in 1.17wmf1 --- includes/CategoryPage.php | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/includes/CategoryPage.php b/includes/CategoryPage.php index 8e7ee64ca7..1c9585f579 100644 --- a/includes/CategoryPage.php +++ b/includes/CategoryPage.php @@ -68,14 +68,27 @@ class CategoryPage extends Article { // Use these as defaults for back compat --catrope $oldFrom = $wgRequest->getVal( 'from' ); $oldUntil = $wgRequest->getVal( 'until' ); + + $reqArray = $wgRequest->getValues(); $from = $until = array(); foreach ( array( 'page', 'subcat', 'file' ) as $type ) { $from[$type] = $wgRequest->getVal( "{$type}from", $oldFrom ); $until[$type] = $wgRequest->getVal( "{$type}until", $oldUntil ); + + // Do not want old-style from/until propagating in nav links. + if ( !isset( $reqArray["{$type}from"] ) && isset( $reqArray["from"] ) ) { + $reqArray["{$type}from"] = $reqArray["from"]; + } + if ( !isset( $reqArray["{$type}to"] ) && isset( $reqArray["to"] ) ) { + $reqArray["{$type}to"] = $reqArray["to"]; + } } - $viewer = new $this->mCategoryViewerClass( $this->mTitle, $from, $until, $wgRequest->getValues() ); + unset( $reqArray["from"] ); + unset( $reqArray["to"] ); + + $viewer = new $this->mCategoryViewerClass( $this->mTitle, $from, $until, $reqArray ); $wgOut->addHTML( $viewer->getHTML() ); } } -- 2.20.1