API: Fix regression from r32224 with caused bug 18597 (internal error for empty gener...
authorRoan Kattouw <catrope@users.mediawiki.org>
Mon, 27 Apr 2009 14:21:16 +0000 (14:21 +0000)
committerRoan Kattouw <catrope@users.mediawiki.org>
Mon, 27 Apr 2009 14:21:16 +0000 (14:21 +0000)
RELEASE-NOTES
includes/api/ApiBase.php

index 24b9dca..05900b1 100644 (file)
@@ -437,6 +437,7 @@ The following extensions are migrated into MediaWiki 1.15:
   users
 * (bug 13049) "API must be accessed from the primary script entry point" error
 * (bug 18601) generator=backlinks returns invalid continue parameter
+* (bug 18597) Internal error with empty generator= parameter
 
 === Languages updated in 1.15 ===
 
index fc221bd..4f86832 100644 (file)
@@ -610,7 +610,7 @@ abstract class ApiBase {
        * @return mixed (allowMultiple ? an_array_of_values : a_single_value)
        */
        protected function parseMultiValue($valueName, $value, $allowMultiple, $allowedValues) {
-               if( trim($value) === "" )
+               if( trim($value) === "" && $allowMultiple)
                        return array();
                $sizeLimit = $this->mMainModule->canApiHighLimits() ? self::LIMIT_SML2 : self::LIMIT_SML1;
                $valuesList = explode('|', $value, $sizeLimit + 1);