From: Daniel Cannon Date: Wed, 26 Mar 2008 23:19:45 +0000 (+0000) Subject: API: (bug 11719) Remove trailing blanks in YAML output. X-Git-Tag: 1.31.0-rc.0~48789 X-Git-Url: http://git.cyclocoop.org/%7B%7B%20url_for%28%27admin_vote_add%27%29%20%7D%7D?a=commitdiff_plain;h=fd840361b1e8ec453f51bac317efc2df5c050119;p=lhc%2Fweb%2Fwiklou.git API: (bug 11719) Remove trailing blanks in YAML output. --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index a665820f58..67553f0eb4 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -168,6 +168,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * Added help text message that specifies whether a module is POST-only * Added createonly parameter to action=edit * Replaced $wgAPIUCUserPrefixMinLength by the more generic $wgAPIMaxDBRows +* (bug 11719) Remove trailing blanks in YAML output. === Languages updated in 1.13 === diff --git a/includes/api/ApiFormatYaml_spyc.php b/includes/api/ApiFormatYaml_spyc.php index a6cd26dc9b..72c89e4a87 100644 --- a/includes/api/ApiFormatYaml_spyc.php +++ b/includes/api/ApiFormatYaml_spyc.php @@ -424,10 +424,16 @@ if (is_int($key)) { // It's a sequence - $string = $spaces.'- '.$value."\n"; + if ($value) + $string = $spaces.'- '.$value."\n"; + else + $string = $spaces . "-\n"; } else { - // It's mapped - $string = $spaces.$key.': '.$value."\n"; + // It's mapped + if ($value) + $string = $spaces.$key.': '.$value."\n"; + else + $string = $spaces . $key . ":\n"; } return $string; }