From: Sam Reed Date: Fri, 24 Feb 2012 02:06:39 +0000 (+0000) Subject: Examples can just be a string X-Git-Tag: 1.31.0-rc.0~24548 X-Git-Url: https://git.cyclocoop.org/%27.%24link.%27?a=commitdiff_plain;h=69d011a23f4acc0073dfbb719e91b2766a97d32f;p=lhc%2Fweb%2Fwiklou.git Examples can just be a string So if it's not false, it can be string|array, if it's a string, just put it in an array --- diff --git a/includes/api/ApiParamInfo.php b/includes/api/ApiParamInfo.php index c5d4cba6e0..f226347627 100644 --- a/includes/api/ApiParamInfo.php +++ b/includes/api/ApiParamInfo.php @@ -147,6 +147,9 @@ class ApiParamInfo extends ApiBase { $examples = $obj->getExamples(); $retval['allexamples'] = array(); if ( $examples !== false ) { + if ( is_string( $examples ) ) { + $examples = array( $examples ); + } foreach( $examples as $k => $v ) { if ( strlen( $retval['examples'] ) ) { $retval['examples'] .= ' ';