Development

Changeset 8286

You must first sign up to be able to contribute.

Changeset 8286

Show
Ignore:
Timestamp:
04/04/08 15:07:24 (8 months ago)
Author:
fabien
Message:

fixed YAML parsing bug (IP addresses for example)

Files:

Legend:

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

    r8155 r8286  
    383383      case 0 == strcasecmp($scalar, '-.inf'): 
    384384        return log(0); 
    385       case preg_match('/^(-|\+)?[0-9\,\.]+$/', $scalar): 
     385      case preg_match('/^(-|\+)?[0-9,]+(\.[0-9]+)?$/', $scalar): 
    386386        return floatval(str_replace(',', '', $scalar)); 
    387387      case preg_match(self::getTimestampRegex(), $scalar): 
  • branches/1.1/test/unit/yaml/fixtures/sfTests.yml

    r7909 r8286  
    7575php: | 
    7676  array('foo' => array('bar' => "foo\n\n\n  \nbar\n")) 
     77--- 
     78test: IP addresses 
     79brief: >  
     80  IP addresses 
     81yaml: | 
     82  foo: 10.0.0.2 
     83php: | 
     84  array('foo' => '10.0.0.2') 
  • branches/1.1/test/unit/yaml/sfYamlDumperTest.php

    r8155 r8286  
    1313require_once(dirname(__FILE__).'/../../../lib/yaml/sfYamlDumper.class.php'); 
    1414 
    15 $t = new lime_test(138, new lime_output_color()); 
     15$t = new lime_test(139, new lime_output_color()); 
    1616 
    1717$parser = new sfYamlParser(); 
  • branches/1.1/test/unit/yaml/sfYamlParserTest.php

    r8155 r8286  
    1212require_once(dirname(__FILE__).'/../../../lib/yaml/sfYamlParser.class.php'); 
    1313 
    14 $t = new lime_test(138, new lime_output_color()); 
     14$t = new lime_test(139, new lime_output_color()); 
    1515 
    1616$parser = new sfYamlParser();