From 36e343cba9d5759d99fadd2bcf5414c00df83067 Mon Sep 17 00:00:00 2001 From: Aryeh Gregor Date: Tue, 3 Aug 2010 20:50:46 +0000 Subject: [PATCH] Fix bug in sorting due to $wgRequest eating nulls I'll fix this up so that the query string looks nicer later. Embedding nulls in query strings is not a great idea. --- includes/CategoryPage.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/includes/CategoryPage.php b/includes/CategoryPage.php index b12c13fe78..9dee97263d 100644 --- a/includes/CategoryPage.php +++ b/includes/CategoryPage.php @@ -55,11 +55,14 @@ class CategoryPage extends Article { $from = $until = array(); foreach ( array( 'page', 'subcat', 'file' ) as $type ) { - $from[$type] = $wgRequest->getVal( "{$type}from" ); - $until[$type] = $wgRequest->getVal( "{$type}until" ); + # Use $_GET instead of $wgRequest, because the latter helpfully + # normalizes Unicode, which removes nulls. TODO: do something + # smarter than passing nulls in URLs. :/ + $from[$type] = isset( $_GET["{$type}from"] ) ? $_GET["{$type}from"] : null; + $until[$type] = isset( $_GET["{$type}until"] ) ? $_GET["{$type}until"] : null; } - $viewer = new CategoryViewer( $this->mTitle, $from, $until, $wgRequest->getValues() ); + $viewer = new CategoryViewer( $this->mTitle, $from, $until, $_GET ); $wgOut->addHTML( $viewer->getHTML() ); } } -- 2.20.1