Development

Changeset 24716

You must first sign up to be able to contribute.

Changeset 24716

Show
Ignore:
Timestamp:
12/01/09 21:08:52 (4 years ago)
Author:
fabien
Message:

[yaml] fixed YAML dump when a string contains a \r without a \n

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • components/yaml/branches/1.0/lib/sfYamlInline.php

    r24656 r24716  
    8888      case is_numeric($value): 
    8989        return is_infinite($value) ? str_ireplace('INF', '.Inf', strval($value)) : (is_string($value) ? "'$value'" : $value); 
    90       case false !== strpos($value, "\n")
     90      case false !== strpos($value, "\n") || false !== strpos($value, "\r")
    9191        return sprintf('"%s"', str_replace(array('"', "\n", "\r"), array('\\"', '\n', '\r'), $value)); 
    9292      case preg_match('/[ \s \' " \: \{ \} \[ \] , & \* \#] | \A[ - ? | < > = ! % @ ]/x', $value): 
  • components/yaml/trunk/lib/sfYamlInline.php

    r24656 r24716  
    8888      case is_numeric($value): 
    8989        return is_infinite($value) ? str_ireplace('INF', '.Inf', strval($value)) : (is_string($value) ? "'$value'" : $value); 
    90       case false !== strpos($value, "\n")
     90      case false !== strpos($value, "\n") || false !== strpos($value, "\r")
    9191        return sprintf('"%s"', str_replace(array('"', "\n", "\r"), array('\\"', '\n', '\r'), $value)); 
    9292      case preg_match('/[ \s \' " \: \{ \} \[ \] , & \* \#] | \A[ - ? | < > = ! % @ ]/x', $value):