dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
API: (bug 11719) Remove trailing blanks in YAML output.
[lhc/web/wiklou.git]
/
includes
/
api
/
ApiFormatYaml_spyc.php
diff --git
a/includes/api/ApiFormatYaml_spyc.php
b/includes/api/ApiFormatYaml_spyc.php
index
a6cd26d
..
72c89e4
100644
(file)
--- a/
includes/api/ApiFormatYaml_spyc.php
+++ b/
includes/api/ApiFormatYaml_spyc.php
@@
-424,10
+424,16
@@
if (is_int($key)) {
// It's a sequence
if (is_int($key)) {
// It's a sequence
- $string = $spaces.'- '.$value."\n";
+ if ($value)
+ $string = $spaces.'- '.$value."\n";
+ else
+ $string = $spaces . "-\n";
} else {
} 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;
}
}
return $string;
}