From 0bef3afdc622127dc1e661f0089207b7dd126289 Mon Sep 17 00:00:00 2001 From: Nick Jenkins Date: Tue, 19 Dec 2006 05:38:55 +0000 Subject: [PATCH] Prevent: * Strict Standards: Undefined variable: dbr in includes/SpecialAllpages.php on line 266 * Fatal error: Call to a member function select() on a non-object in includes/SpecialAllpages.php on line 266 * Strict Standards: Undefined variable: n in includes/SpecialAllpages.php on line 308 Above could be repo-ed with error_reporting(E_ALL | E_STRICT) set, by supplying bad input, such as this command line: curl --silent --include --globoff -F 'from'='\<' 'http://localhost/wiki/index.php?title=Special%3AAllpages' (or easier is to just type "<" into the "Display pages starting at:" field on [[Special:Allpages]], and click "Go") --- includes/SpecialAllpages.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/includes/SpecialAllpages.php b/includes/SpecialAllpages.php index c68026af57..737e6834f4 100644 --- a/includes/SpecialAllpages.php +++ b/includes/SpecialAllpages.php @@ -210,7 +210,8 @@ function showChunk( $namespace = NS_MAIN, $from, $including = false ) { $sk = $wgUser->getSkin(); $fromList = $this->getNamespaceKeyAndText($namespace, $from); - + $n = 0; + if ( !$fromList ) { $out = wfMsgWikiHtml( 'allpagesbadtitle' ); } else { @@ -231,7 +232,6 @@ function showChunk( $namespace = NS_MAIN, $from, $including = false ) { ) ); - $n = 0; $out = ''; while( ($n < $this->maxPerPage) && ($s = $dbr->fetchObject( $res )) ) { @@ -263,6 +263,7 @@ function showChunk( $namespace = NS_MAIN, $from, $including = false ) { } else { # Get the last title from previous chunk + $dbr =& wfGetDB( DB_SLAVE ); $res_prev = $dbr->select( 'page', 'page_title', -- 2.20.1