Author: fabien
Date: 2010-02-23 11:14:50 +0100 (Tue, 23 Feb 2010)
New Revision: 28201
Modified:
components/yaml/branches/1.0/lib/sfYamlInline.php
components/yaml/trunk/lib/sfYamlInline.php
Log:
[YAML] added backtick to the list of characters that trigger quotes as it is
reserved for future use (patch from indeyets)
Modified: components/yaml/branches/1.0/lib/sfYamlInline.php
===================================================================
--- components/yaml/branches/1.0/lib/sfYamlInline.php 2010-02-23 02:00:08 UTC
(rev 28200)
+++ components/yaml/branches/1.0/lib/sfYamlInline.php 2010-02-23 10:14:50 UTC
(rev 28201)
@@ -89,7 +89,7 @@
return is_infinite($value) ? str_ireplace('INF', '.Inf',
strval($value)) : (is_string($value) ? "'$value'" : $value);
case false !== strpos($value, "\n") || false !== strpos($value, "\r"):
return sprintf('"%s"', str_replace(array('"', "\n", "\r"),
array('\\"', '\n', '\r'), $value));
- case preg_match('/[ \s \' " \: \{ \} \[ \] , & \* \#] | \A[ - ? | < > =
! % @ ]/x', $value):
+ case preg_match('/[ \s \' " \: \{ \} \[ \] , & \* \#] | \A[ - ? | < > =
! % @ ` ]/x', $value):
return sprintf("'%s'", str_replace('\'', '\'\'', $value));
case '' == $value:
return "''";
Modified: components/yaml/trunk/lib/sfYamlInline.php
===================================================================
--- components/yaml/trunk/lib/sfYamlInline.php 2010-02-23 02:00:08 UTC (rev
28200)
+++ components/yaml/trunk/lib/sfYamlInline.php 2010-02-23 10:14:50 UTC (rev
28201)
@@ -89,7 +89,7 @@
return is_infinite($value) ? str_ireplace('INF', '.Inf',
strval($value)) : (is_string($value) ? "'$value'" : $value);
case false !== strpos($value, "\n") || false !== strpos($value, "\r"):
return sprintf('"%s"', str_replace(array('"', "\n", "\r"),
array('\\"', '\n', '\r'), $value));
- case preg_match('/[ \s \' " \: \{ \} \[ \] , & \* \#] | \A[ - ? | < > =
! % @ ]/x', $value):
+ case preg_match('/[ \s \' " \: \{ \} \[ \] , & \* \#] | \A[ - ? | < > =
! % @ ` ]/x', $value):
return sprintf("'%s'", str_replace('\'', '\'\'', $value));
case '' == $value:
return "''";
--
You received this message because you are subscribed to the Google Groups
"symfony SVN" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/symfony-svn?hl=en.