r49956 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r49955‎ | r49956 | r49957 >
Date:14:21, 27 April 2009
Author:catrope
Status:ok (Comments)
Tags:
Comment:
API: Fix regression from r32224 with caused bug 18597 (internal error for empty generator= parameter)
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/api/ApiBase.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/api/ApiBase.php
@@ -610,7 +610,7 @@
611611 * @return mixed (allowMultiple ? an_array_of_values : a_single_value)
612612 */
613613 protected function parseMultiValue($valueName, $value, $allowMultiple, $allowedValues) {
614 - if( trim($value) === "" )
 614+ if( trim($value) === "" && $allowMultiple)
615615 return array();
616616 $sizeLimit = $this->mMainModule->canApiHighLimits() ? self::LIMIT_SML2 : self::LIMIT_SML1;
617617 $valuesList = explode('|', $value, $sizeLimit + 1);
Index: trunk/phase3/RELEASE-NOTES
@@ -437,6 +437,7 @@
438438 users
439439 * (bug 13049) "API must be accessed from the primary script entry point" error
440440 * (bug 18601) generator=backlinks returns invalid continue parameter
 441+* (bug 18597) Internal error with empty generator= parameter
441442
442443 === Languages updated in 1.15 ===
443444

Follow-up revisions

RevisionCommit summaryAuthorDate
r50217API backports:...tstarling13:12, 5 May 2009

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r32224Handle empty sets correctlyvasilievvv16:28, 20 March 2008

Comments

#Comment by Brion VIBBER (talk | contribs)   17:44, 27 April 2009

Note this just changes it out for a more graceful error. :)

#Comment by Catrope (talk | contribs)   17:53, 27 April 2009

Yeah, but at least this one is machine-parseable and doesn't contain a backtrace. Since generator= is invalid, a well-formatted error is expected behavior.

Status & tagging log