xmlrpc_get_type() returns true on invalid dates

 [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


 [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 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: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.