From 60be1d02b9c1fa1bdd3fe407ddea55e1e12f7dfa Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Fri, 12 Dec 2008 01:05:51 +0000 Subject: [PATCH] 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. :) --- includes/Article.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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) ) { -- 2.20.1