r32485 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r32484‎ | r32485 | r32486 >
Date:23:19, 26 March 2008
Author:amidaniel
Status:old
Tags:
Comment:
API: (bug 11719) Remove trailing blanks in YAML output.
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/api/ApiFormatYaml_spyc.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/api/ApiFormatYaml_spyc.php
@@ -424,10 +424,16 @@
425425
426426 if (is_int($key)) {
427427 // It's a sequence
428 - $string = $spaces.'- '.$value."\n";
 428+ if ($value)
 429+ $string = $spaces.'- '.$value."\n";
 430+ else
 431+ $string = $spaces . "-\n";
429432 } else {
430 - // It's mapped
431 - $string = $spaces.$key.': '.$value."\n";
 433+ // It's mapped
 434+ if ($value)
 435+ $string = $spaces.$key.': '.$value."\n";
 436+ else
 437+ $string = $spaces . $key . ":\n";
432438 }
433439 return $string;
434440 }
Index: trunk/phase3/RELEASE-NOTES
@@ -168,6 +168,7 @@
169169 * Added help text message that specifies whether a module is POST-only
170170 * Added createonly parameter to action=edit
171171 * Replaced $wgAPIUCUserPrefixMinLength by the more generic $wgAPIMaxDBRows
 172+* (bug 11719) Remove trailing blanks in YAML output.
172173
173174 === Languages updated in 1.13 ===
174175

Follow-up revisions

RevisionCommit summaryAuthorDate
r37506Backporting fixes to API that caused it to output plain wrong data:...btongminh14:37, 10 July 2008
r40384(bug 15448) YAML output returns empty strings instead of 0. Surprisingly, thi...catrope14:47, 3 September 2008

Status & tagging log