Skip to content

Commit

Permalink
Be more permissive on not perfectly valid date strings.
Browse files Browse the repository at this point in the history
Bug: #14682
  • Loading branch information
yunosh committed Aug 24, 2017
1 parent 3c61047 commit 9441ab3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion framework/ActiveSync/lib/Horde/ActiveSync/Message/Base.php
Expand Up @@ -724,7 +724,7 @@ protected function _formatDate(Horde_Date $dt, $type)
*/
protected function _parseDate($ts)
{
if (preg_match('/(\d{4})\D*(\d{2})\D*(\d{2})(T(\d{2})\D*(\d{2})\D*(\d{2})(.\d+)?Z)?$/', $ts)) {
if (preg_match('/(\d{4})\D*(\d{1,2})\D*(\d{1,2})(T(\d{1,2})\D*(\d{1,2})\D*(\d{1,2})(.\d+)?Z)?$/', $ts)) {
try {
return new Horde_Date($ts);
} catch (Horde_Date_Exception $e) {
Expand Down

1 comment on commit 9441ab3

@mrubinsk
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fine, but for informational purposes, the EAS protocol explicitly states the format must contain 2 digits.

Please sign in to comment.