From 669a6b4bab141116160838c932870f867d3de2af Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Wed, 9 Jan 2008 02:18:58 +0000 Subject: [PATCH] * (bug 12505) Fixed section=0 with action=raw 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 | 1 + includes/RawPage.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 45bdc1a1e6..5d74b846e8 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -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 == diff --git a/includes/RawPage.php b/includes/RawPage.php index 22a5ac4e63..f96c8b91b0 100644 --- a/includes/RawPage.php +++ b/includes/RawPage.php @@ -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 -- 2.20.1