Followup r70479
authorSam Reed <reedy@users.mediawiki.org>
Wed, 4 Aug 2010 21:21:35 +0000 (21:21 +0000)
committerSam Reed <reedy@users.mediawiki.org>
Wed, 4 Aug 2010 21:21:35 +0000 (21:21 +0000)
If string is required, but it's value === '', that's missing!

includes/api/ApiBase.php

index 44acdda..8c79da5 100644 (file)
@@ -662,6 +662,10 @@ abstract class ApiBase {
                                        case 'NULL': // nothing to do
                                                break;
                                        case 'string': // nothing to do
+                                               if ( $value === '' ) {
+                                                       $this->dieUsageMsg( array( 'missingparam', $paramName ) );
+                                               }
+                                       
                                                break;
                                        case 'integer': // Force everything using intval() and optionally validate limits