From: Brion Vibber Date: Fri, 12 Dec 2008 01:05:51 +0000 (+0000) Subject: Clarify the $section parameter a bit on Article::replaceSection() to indicate accepta... X-Git-Tag: 1.31.0-rc.0~44021 X-Git-Url: http://git.cyclocoop.org/ecrire?a=commitdiff_plain;h=60be1d02b9c1fa1bdd3fe407ddea55e1e12f7dfa;p=lhc%2Fweb%2Fwiklou.git Clarify the $section parameter a bit on Article::replaceSection() to indicate acceptable input values. Throw in a strval() around the param on compare so if somebody thinks "hey I'll make it a === because it's 5ns faster" again it won't break anything. :) --- diff --git a/includes/Article.php b/includes/Article.php index b6ba6a35da..523f9eb90a 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -1265,11 +1265,12 @@ class Article { } /** + * @param $section empty/null/false or a section number (0, 1, 2, T1, T2...) * @return string Complete article text, or null if error */ public function replaceSection( $section, $text, $summary = '', $edittime = NULL ) { wfProfileIn( __METHOD__ ); - if( $section == '' ) { + if( strval( $section ) == '' ) { // Whole-page edit; let the whole text through } else { if( is_null($edittime) ) {