Skip to content

Commit

Permalink
Bug: 14381 Add check for malformed offset in the header too.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrubinsk committed May 31, 2016
1 parent 3ef5bf7 commit 6b3c2b7
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions framework/Mime/lib/Horde/Mime/Headers/Date.php
Expand Up @@ -51,4 +51,19 @@ public static function getHandles()
);
}

/**
* Perform sanity checking on a header value.
*
* @param string $data The header data.
*
* @return string The cleaned header data.
*/
protected function _sanityCheck($data)
{
$date = parent::_sanityCheck($data);
if (substr(rtrim($date), -5) === ' 0000') {
$date = substr(trim($date), 0, strlen(trim($date)) - 5) . ' +0000';
}
return $date;
}
}

0 comments on commit 6b3c2b7

Please sign in to comment.