phpxmlrpc
phpxmlrpc copied to clipboard
XML Parser validation of ISO8601 DateTime is stricter than the spec
The validation requires that the DATATIME.ISO8601 data be in the YYYYMMDDTHH:MM:SS format. This is a valid ISO8601 format, but the spec allows for other formats as well. This check should be expanded to included the entire spec. See: http://www.pelagodesign.com/blog/2009/05/20/iso-8601-date-validation-that-doesnt-suck/ for a possible regex that would work.
Hello.
It seems that I can not find the relevant source any more, but I am pretty sure that when the discussion came up (probably on the xmlrpc mailing list) about what exactly were the date formats supported by the spec, there was clear consensus that the only valid format was the one as per the example given at http://xmlrpc.scripting.com/spec.html, and that the name 'DATATIME.ISO8601' was a bit of a misnomer.
In other words: conforming implementations are not required to support the full gamut of iso date formats.
If you are talking to a non-phpxmlrpc endpoint for the other end of your communication, and it is is sending dates in different formats, I suggest that you take it up with them...
ps: found at least a link backing up the above: https://groups.yahoo.com/neo/groups/xml-rpc/conversations/topics/6752
pps: I made a change, which will be in the next version (normally it should be 4.10.0), which, while not satisfying completely your request, will at least allow users, with a bit of effort, to let through dateTime values using non-conformant values: the same regular expression used to validate incoming datetimes is now used everywhere. It can be reset by the developer via changing the value of PhpXmlRpc\PhpXmlRpc::$xmlrpc_datetime_format
Feel free to reopen if this does not work / is not sufficient