Development

Changeset 13391

You must first sign up to be able to contribute.

Changeset 13391

Show
Ignore:
Timestamp:
11/27/08 09:56:22 (7 months ago)
Author:
fabien
Message:

[1.1, 1.2] YAML dumper should remove carriage returns (\r) (closes #4740)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/1.1/lib/yaml/sfYamlInline.class.php

    r10881 r13391  
    7474        return is_infinite($value) ? str_ireplace('INF', '.Inf', strval($value)) : (is_string($value) ? "'$value'" : $value); 
    7575      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)); 
    7777      case preg_match('/[ \s \' " \: \{ \} \[ \] , & \*]/x', $value): 
    7878        return sprintf("'%s'", str_replace('\'', '\'\'', $value)); 
  • branches/1.2/lib/yaml/sfYamlInline.class.php

    r10880 r13391  
    7474        return is_infinite($value) ? str_ireplace('INF', '.Inf', strval($value)) : (is_string($value) ? "'$value'" : $value); 
    7575      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)); 
    7777      case preg_match('/[ \s \' " \: \{ \} \[ \] , & \*]/x', $value): 
    7878        return sprintf("'%s'", str_replace('\'', '\'\'', $value)); 

The Sensio Labs Network

Since 1998, Sensio Labs has been promoting the Open-Source software movement by providing quality web application development, training, consulting, and supporting several large Open-Source projects.