Skip to content

Commit

Permalink
Merge pull request #38 from joker806/invalid_date_format
Browse files Browse the repository at this point in the history
Fix regex parsing the date header (allowing multiple brackets)
  • Loading branch information
ddeboer committed Aug 10, 2014
2 parents 69d4a8b + 6265229 commit 7dae686
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Ddeboer/Imap/Message/Headers.php
Expand Up @@ -29,7 +29,7 @@ public function __construct(\stdClass $headers)
}

if (isset($this->array['date'])) {
$this->array['date'] = preg_replace('/(.*)\(.*\)/', '$1', $this->array['date']);
$this->array['date'] = preg_replace('/([^\(]*)\(.*\)/', '$1', $this->array['date']);
$this->array['date'] = new \DateTime($this->array['date']);
}

Expand Down

0 comments on commit 7dae686

Please sign in to comment.