Bläddra i källkod

[Yaml] added ? in the list of characters that trigger quoting (for compatibility with libyaml - patch from indeyets)

Fabien Potencier 15 år sedan
förälder
incheckning
46c4f23496
1 ändrade filer med 1 tillägg och 1 borttagningar
  1. 1 1
      src/Symfony/Components/Yaml/Inline.php

+ 1 - 1
src/Symfony/Components/Yaml/Inline.php

@@ -80,7 +80,7 @@ class Inline
         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 "''";