php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #61923 detect_scalar_type() is not aware of base 60 representation.
Submitted: 2012-05-03 14:04 UTC Modified: 2013-11-18 02:23 UTC
Votes:3
Avg. Score:3.0 ± 0.8
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:1 (100.0%)
From: mapc777 at hotmail dot com Assigned: bd808 (profile)
Status: Closed Package: yaml (PECL)
PHP Version: 5.3.11 OS: CentOS
Private report: No CVE-ID: None
 [2012-05-03 14:04 UTC] mapc777 at hotmail dot com
Description:
------------
When emitting a string that matches the format \d(:\d)+, (e.g. 1:0) it should be 
quoted, as an unquoted scalar of this type is actually representing an integer in 
base 60 according to the documentation at http://yaml.org/type/int.html.



Test script:
---------------
$yaml_string = <<<YAML
---
node: '1:0'
YAML;

echo yaml_emit(yaml_parse($yaml_string));

Expected result:
----------------
---
node: '1:0'

Actual result:
--------------
---
node: 1:0

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-05-04 00:52 UTC] mapc777 at hotmail dot com
Expected result should have been
---
node: "1:0" 

as emit.c only refers to DOUBLE_QUOTED.
 [2013-11-18 02:23 UTC] bd808@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: bd808
 [2013-11-18 02:23 UTC] bd808@php.net
The fix for this bug has been committed.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.

 For Windows:

http://windows.php.net/snapshots/
 
Thank you for the report, and for helping us make PHP better.


 [2013-11-19 05:47 UTC] bd808@php.net
Patch included in 1.1.1 release.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Dec 03 12:01:30 2024 UTC