r18439 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r18438‎ | r18439 | r18440 >
Date:05:38, 19 December 2006
Author:nickj
Status:old
Tags:
Comment:
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")
Modified paths:
  • /trunk/phase3/includes/SpecialAllpages.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/SpecialAllpages.php
@@ -210,7 +210,8 @@
211211 $sk = $wgUser->getSkin();
212212
213213 $fromList = $this->getNamespaceKeyAndText($namespace, $from);
214 -
 214+ $n = 0;
 215+
215216 if ( !$fromList ) {
216217 $out = wfMsgWikiHtml( 'allpagesbadtitle' );
217218 } else {
@@ -231,7 +232,6 @@
232233 )
233234 );
234235
235 - $n = 0;
236236 $out = '<table style="background: inherit;" border="0" width="100%">';
237237
238238 while( ($n < $this->maxPerPage) && ($s = $dbr->fetchObject( $res )) ) {
@@ -263,6 +263,7 @@
264264 } else {
265265
266266 # Get the last title from previous chunk
 267+ $dbr =& wfGetDB( DB_SLAVE );
267268 $res_prev = $dbr->select(
268269 'page',
269270 'page_title',