Minor followup to r70480
authorSam Reed <reedy@users.mediawiki.org>
Thu, 19 Aug 2010 14:54:09 +0000 (14:54 +0000)
committerSam Reed <reedy@users.mediawiki.org>
Thu, 19 Aug 2010 14:54:09 +0000 (14:54 +0000)
Only throw missingparam for string === '' when it is required

RELEASE-NOTES for breaking change

RELEASE-NOTES
includes/api/ApiBase.php

index 08bfc52..7755b79 100644 (file)
@@ -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 ===
 
index 93d57d6..29881e7 100644 (file)
@@ -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 ) );
                                                }