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
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
42 - 27 = ?
Subscribe to this entry?

 
 [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

Add a Patch

Pull Requests

Add a Pull Request

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: Sat Apr 20 10:01:28 2024 UTC