6.0.0-alpha10
▾
Tasks
New Task
Search
Photos
Wiki
▾
Tickets
New Ticket
Search
dev.horde.org
Toggle Alerts Log
Help
5/15/25
H
istory
A
ttachments
C
omment
W
atch
Download
Comment on [#6861] yaml dumper should quote values with comments
*
Your Email Address
*
Spam protection
Enter the letters below:
__..__ .___.__.. . (__ | \[__ | ||_/ .__)|__/[___|__|| \
Comment
> I have run into a problem with dumping PHP arrays that contain "#" > characters, which is a comment signifier in YAML. I have a proposed > patch: > > > > --- /Users/alanpinstein/Dumper.php.orig 2008-06-09 01:08:54.000000000 -0400 > > +++ /opt/local/lib/php/Horde/Yaml/Dumper.php 2008-06-09 > 01:08:57.000000000 -0400 > > @@ -153,6 +153,11 @@ > > > > $spaces = str_repeat(' ', $indent); > > > > + // quote strings if necessary > > + if (strchr($value, '#')) { > > + $value = "'{$value}'"; > > + } > > + > > if (is_int($key)) { > > // It's a sequence. > > $string = $spaces . '- ' . $value . "\n"; > > > > There might be more cases, and I don't know if this breaks in the > case of folded code, but it's a start for you hopefully. This is a > pretty important bug I think because it really breaks YAML dumping if > you have this character in a string, which is a common occurrence.
Attachment
Watch this ticket
N
ew Ticket
M
y Tickets
S
earch
Q
uery Builder
R
eports
Saved Queries
Open Bugs
Bugs waiting for Feedback
Open Bugs in Releases
Open Enhancements
Enhancements waiting for Feedback
Bugs with Patches
Enhancements with Patches
Release Showstoppers
Stalled Tickets
New Tickets
Horde 5 Showstoppers