From 5d383466e1653002ff8dd889f8c677b45a02635b Mon Sep 17 00:00:00 2001 From: Sam Reed Date: Thu, 19 Aug 2010 14:54:09 +0000 Subject: [PATCH] Minor followup to r70480 Only throw missingparam for string === '' when it is required RELEASE-NOTES for breaking change --- RELEASE-NOTES | 3 ++- includes/api/ApiBase.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 08bfc52373..7755b79754 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -350,7 +350,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * (bug 24330) Add &redirect parameter to ?action=edit * (bug 24722) For list=allusers&auprop=blockinfo, only show blockedby and blockreason if the user is actually blocked. -* Add format=dump and format=dumpfm, outputs results in PHP's var_dump() format. +* Add format=dump and format=dumpfm, outputs results in PHP's var_dump() format +* For required string parameters, if '' is provided, this is now classed as missing === Languages updated in 1.17 === diff --git a/includes/api/ApiBase.php b/includes/api/ApiBase.php index 93d57d64d9..29881e7e1a 100644 --- a/includes/api/ApiBase.php +++ b/includes/api/ApiBase.php @@ -664,7 +664,7 @@ abstract class ApiBase { case 'NULL': // nothing to do break; case 'string': - if ( $value === '' ) { + if ( $required && $value === '' ) { $this->dieUsageMsg( array( 'missingparam', $paramName ) ); } -- 2.20.1