Followup r92396
authorSam Reed <reedy@users.mediawiki.org>
Sun, 17 Jul 2011 17:09:51 +0000 (17:09 +0000)
committerSam Reed <reedy@users.mediawiki.org>
Sun, 17 Jul 2011 17:09:51 +0000 (17:09 +0000)
Using action=paraminfo to give help urls (and examples for that matter!!) look awful as a string with an encoded \n in the middle of it

includes/api/ApiParamInfo.php

index 989e55b..eac784e 100644 (file)
@@ -94,7 +94,6 @@ class ApiParamInfo extends ApiBase {
                $retval['classname'] = get_class( $obj );
                $retval['description'] = implode( "\n", (array)$obj->getDescription() );
                $retval['examples'] = implode( "\n", (array)$obj->getExamples() );
-               $retval['helpurl'] = implode( "\n", (array)$obj->getHelpUrls() );
                $retval['version'] = implode( "\n", (array)$obj->getVersion() );
                $retval['prefix'] = $obj->getModulePrefix();
 
@@ -116,6 +115,9 @@ class ApiParamInfo extends ApiBase {
                        return $retval;
                }
 
+               $retval['helpurls'] = (array)$obj->getHelpUrls();
+               $result->setIndexedTagName( $retval['helpurls'], 'helpurl' );
+
                $retval['parameters'] = array();
                $paramDesc = $obj->getFinalParamDescription();
                foreach ( $allowedParams as $n => $p ) {
@@ -197,7 +199,6 @@ class ApiParamInfo extends ApiBase {
 
                // Errors
                $retval['errors'] = $this->parseErrors( $obj->getPossibleErrors() );
-
                $result->setIndexedTagName( $retval['errors'], 'error' );
 
                return $retval;