* (bug 12505) Fixed section=0 with action=raw
authorBrion Vibber <brion@users.mediawiki.org>
Wed, 9 Jan 2008 02:18:58 +0000 (02:18 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Wed, 9 Jan 2008 02:18:58 +0000 (02:18 +0000)
PHP's fuzzy type comparisons strike again! A check for $this->mSection != '', probably intended to protect against an unset value, matched for integer values of 0 as well. (The fun part is that 0=='' and 0=='0' but '0'!='' :) Since the parameter is validated through getIntOrNull(), only the null check is necessary here.

RELEASE-NOTES
includes/RawPage.php

index 45bdc1a..5d74b84 100644 (file)
@@ -292,6 +292,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 * (bug 12493) Removed hardcoded MAX_FILE_SIZE from Special:Import upload form
 * (bug 12489) Special:Userrights listed in restricted section again
 * (bug 12553) Fixed invalid XHTML in edit conflict screen
+* (bug 12505) Fixed section=0 with action=raw
 
 
 == Parser changes in 1.12 ==
index 22a5ac4..f96c8b9 100644 (file)
@@ -193,7 +193,7 @@ class RawPage {
                                        $lastmod = wfTimestamp( TS_RFC2822, $rev->getTimestamp() );
                                        header( "Last-modified: $lastmod" );
 
-                                       if ( !is_null($this->mSection) && $this->mSection != '' ) {
+                                       if ( !is_null($this->mSection ) ) {
                                                global $wgParser;
                                                return $wgParser->getSection ( $rev->getText(), $this->mSection );
                                        } else