From: Nick Jenkins Date: Tue, 19 Dec 2006 05:38:55 +0000 (+0000) Subject: Prevent: X-Git-Tag: 1.31.0-rc.0~54842 X-Git-Url: http://git.cyclocoop.org/%7B%24admin_url%7Dmembres/modifier.php?a=commitdiff_plain;h=0bef3afdc622127dc1e661f0089207b7dd126289;p=lhc%2Fweb%2Fwiklou.git 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") --- 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',