Changeset 13391
- Timestamp:
- 11/27/08 09:56:22 (7 months ago)
- Files:
-
- branches/1.1/lib/yaml/sfYamlInline.class.php (modified) (1 diff)
- branches/1.2/lib/yaml/sfYamlInline.class.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/1.1/lib/yaml/sfYamlInline.class.php
r10881 r13391 74 74 return is_infinite($value) ? str_ireplace('INF', '.Inf', strval($value)) : (is_string($value) ? "'$value'" : $value); 75 75 case false !== strpos($value, "\n"): 76 return sprintf('"%s"', str_replace(array('"', "\n" ), array('\\"', '\n'), $value));76 return sprintf('"%s"', str_replace(array('"', "\n", "\r"), array('\\"', '\n', '\r'), $value)); 77 77 case preg_match('/[ \s \' " \: \{ \} \[ \] , & \*]/x', $value): 78 78 return sprintf("'%s'", str_replace('\'', '\'\'', $value)); branches/1.2/lib/yaml/sfYamlInline.class.php
r10880 r13391 74 74 return is_infinite($value) ? str_ireplace('INF', '.Inf', strval($value)) : (is_string($value) ? "'$value'" : $value); 75 75 case false !== strpos($value, "\n"): 76 return sprintf('"%s"', str_replace(array('"', "\n" ), array('\\"', '\n'), $value));76 return sprintf('"%s"', str_replace(array('"', "\n", "\r"), array('\\"', '\n', '\r'), $value)); 77 77 case preg_match('/[ \s \' " \: \{ \} \[ \] , & \*]/x', $value): 78 78 return sprintf("'%s'", str_replace('\'', '\'\'', $value));

