php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #69465 yaml.decode_timestamp decodes quoted strings
Submitted: 2015-04-15 19:37 UTC Modified: 2015-05-18 04:15 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: neclimdul at gmail dot com Assigned: bd808 (profile)
Status: Closed Package: yaml (PECL)
PHP Version: 5.6.7 OS: Ubuntu
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: neclimdul at gmail dot com
New email:
PHP Version: OS:

 

 [2015-04-15 19:37 UTC] neclimdul at gmail dot com
Description:
------------
yaml.decode_timestamp is said to 'Controls the decoding of both implicit and explict "tag:yaml.org,2002:timestamp" scalars.' This seems to be covered by the resolution rules(http://yaml.org/spec/1.1/current.html#id866224)

However this settings decodes all scalars which is not recommended. (http://yaml.org/spec/1.1/current.html#id866262). Nodes have “!” non-specific tag shouldn't be resolved. Quoted tags are documented as being treated the same way



Test script:
---------------
<?php
ini_set('yaml.decode_timestamp', 1);
var_dump(yaml_parse('
date1: 2015-05-15
date2: "2015-05-15"
date3: ! 2015-05-15
'));


Expected result:
----------------
array(3) {
  ["date"]=>
  int(1431666000)
  ["date2"]=>
  string(10) "2015-05-15"
  ["date3"]=>
  string(10) "2015-05-15"
}


Actual result:
--------------
array(3) {
  ["date"]=>
  int(1431666000)
  ["date2"]=>
  int(1431666000)
  ["date3"]=>
  int(1431666000)
}


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-04-15 19:38 UTC] neclimdul at gmail dot com
-Summary: FILTER_VALIDATE_URL does not see urls with underscores as valid URLs. +Summary: yaml.decode_timestamp decodes quoted strings
 [2015-04-15 19:38 UTC] neclimdul at gmail dot com
php.net keeps putting this in the summary... sorry I don't don't what is going on.
 [2015-04-15 21:20 UTC] cmb@php.net
-Package: Filter related +Package: yaml
 [2015-05-18 02:24 UTC] bd808@php.net
-Assigned To: +Assigned To: bd808
 [2015-05-18 04:15 UTC] bd808@php.net
-Status: Assigned +Status: Closed
 [2015-05-18 04:15 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.
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sun Nov 28 03:03:14 2021 UTC