* (bug 28702) Undefined offset in ApiParamInfo.php
authorSam Reed <reedy@users.mediawiki.org>
Mon, 25 Apr 2011 22:56:08 +0000 (22:56 +0000)
committerSam Reed <reedy@users.mediawiki.org>
Mon, 25 Apr 2011 22:56:08 +0000 (22:56 +0000)
Followup r85758 (bug 28254)

If no DFLT is set, fall back to "null", which means a string parameter

RELEASE-NOTES
includes/api/ApiParamInfo.php

index 4b5ceab..2a032cb 100644 (file)
@@ -352,6 +352,7 @@ PHP if you have not done so prior to upgrading MediaWiki.
 * (bug 26882) Allow listing of indefinite protections with the api
 * (bug 27344) add drprefix param to list=deletedrevs
 * (bug 28560) list=deletedrevs should die, if combination of param is invalid
+* (bug 28702) Undefined offset in ApiParamInfo.php
 
 === Languages updated in 1.18 ===
 
index ac91ea3..ed3b450 100644 (file)
@@ -131,7 +131,7 @@ class ApiParamInfo extends ApiBase {
 
                        //handle missing type
                        if ( !isset( $p[ApiBase::PARAM_TYPE] ) ) {
-                               $dflt = $p[ApiBase::PARAM_DFLT];
+                               $dflt = isset( $p[ApiBase::PARAM_DFLT] ) ? $p[ApiBase::PARAM_DFLT] : null;
                                if ( is_bool( $dflt ) ) {
                                        $p[ApiBase::PARAM_TYPE] = 'bool';
                                } elseif ( is_string( $dflt ) || is_null( $dflt ) ) {