php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #51725 xmlrpc_get_type() returns true on invalid dates
Submitted: 2010-05-03 05:40 UTC Modified: 2010-05-12 11:39 UTC
From: geissert@php.net Assigned: mike (profile)
Status: Closed Package: XMLRPC-EPI related
PHP Version: 5.3.2 OS: linux/kfreebsd ia64/x86_64
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:
20 + 14 = ?
Subscribe to this entry?

 
 [2010-05-03 05:40 UTC] geissert@php.net
Description:
------------
ext/xmlrpc/tests/bug42189.phpt fails consistently on 64 bits architectures such as ia64 and x86_64.

I modified the test a bit to show what's going on. From a quick look at the code it appears to be a bug in the XMLRPC-EPI lib and not in the module itself.


Test script:
---------------
<?php
$a = '~~~~~~~~~~~~~~~~~~';
$ok = xmlrpc_set_type($a, 'datetime');
var_dump($ok);

if ($ok)
    echo xmlrpc_encode($a);

echo "Done\n";
?>

Expected result:
----------------
bool(false)
Done


Actual result:
--------------
bool(true)
<?xml version="1.0" encoding="utf-8"?>
<params>
<param>
 <value>
  <dateTime.iso8601>~~~~~~~~~~~~~~~~~~</dateTime.iso8601>
 </value>
</param>
</params>
Done


Patches

php_parse_date-return-on-parse-error (last revision 2010-05-12 09:36 UTC by mike@php.net)

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-05-03 14:20 UTC] felipe@php.net
I cannot reproduce it on Linux using:
libexpat1-dev  --- 2.0.1-4+lenny3
libxml2-dev    --- 2.7.3.dfsg-2.1
 [2010-05-03 14:23 UTC] felipe@php.net
(I tested on 32bit though)
 [2010-05-03 15:32 UTC] iliaa@php.net
-Status: Open +Status: Verified
 [2010-05-03 15:32 UTC] iliaa@php.net
IT happens on 64bit systems only. The reason has to do with date extension, which 
is used to validate the date string (on 64 bit machines this results in a very 
small negative #), not -1 and thus passed validation.
 [2010-05-12 11:11 UTC] mike@php.net
The following patch has been added/updated:

Patch Name: php_parse_date-return-on-parse-error
Revision:   1273655513
URL:        http://bugs.php.net/patch-display.php?bug=51725&patch=php_parse_date-return-on-parse-error&revision=1273655513
 [2010-05-12 11:36 UTC] mike@php.net
The following patch has been added/updated:

Patch Name: php_parse_date-return-on-parse-error
Revision:   1273656982
URL:        http://bugs.php.net/patch-display.php?bug=51725&patch=php_parse_date-return-on-parse-error&revision=1273656982
 [2010-05-12 11:37 UTC] mike@php.net
Automatic comment from SVN on behalf of mike
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=299277
Log: Fixed bug #51725 (xmlrpc_get_type() returns true on invalid dates). (Mike)
 [2010-05-12 11:39 UTC] mike@php.net
-Status: Verified +Status: Closed -Assigned To: +Assigned To: mike
 [2010-05-12 11:39 UTC] mike@php.net
This bug has been fixed in SVN.

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/.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 21:01:30 2024 UTC