API: (bug 11719) Remove trailing blanks in YAML output.
authorDaniel Cannon <amidaniel@users.mediawiki.org>
Wed, 26 Mar 2008 23:19:45 +0000 (23:19 +0000)
committerDaniel Cannon <amidaniel@users.mediawiki.org>
Wed, 26 Mar 2008 23:19:45 +0000 (23:19 +0000)
RELEASE-NOTES
includes/api/ApiFormatYaml_spyc.php

index a665820..67553f0 100644 (file)
@@ -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 ===
 
index a6cd26d..72c89e4 100644 (file)
 
       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;
     }