Clarify the $section parameter a bit on Article::replaceSection() to indicate accepta...
authorBrion Vibber <brion@users.mediawiki.org>
Fri, 12 Dec 2008 01:05:51 +0000 (01:05 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Fri, 12 Dec 2008 01:05:51 +0000 (01:05 +0000)
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

index b6ba6a3..523f9eb 100644 (file)
@@ -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) ) {