|
|
|
@ -3667,8 +3667,20 @@ class rcube_imap_generic
|
|
|
|
|
*/
|
|
|
|
|
static function strToTime($date)
|
|
|
|
|
{
|
|
|
|
|
// support non-standard "GMTXXXX" literal
|
|
|
|
|
$date = preg_replace('/GMT\s*([+-][0-9]+)/', '\\1', $date);
|
|
|
|
|
// Clean malformed data
|
|
|
|
|
$date = preg_replace(
|
|
|
|
|
array(
|
|
|
|
|
'/GMT\s*([+-][0-9]+)/', // support non-standard "GMTXXXX" literal
|
|
|
|
|
'/[^a-z0-9\x20\x09:+-]/i', // remove any invalid characters
|
|
|
|
|
'/\s*(Mon|Tue|Wed|Thu|Fri|Sat|Sun)\s*/i', // remove weekday names
|
|
|
|
|
),
|
|
|
|
|
array(
|
|
|
|
|
'\\1',
|
|
|
|
|
'',
|
|
|
|
|
'',
|
|
|
|
|
), $date);
|
|
|
|
|
|
|
|
|
|
$date = trim($date);
|
|
|
|
|
|
|
|
|
|
// if date parsing fails, we have a date in non-rfc format
|
|
|
|
|
// remove token from the end and try again
|
|
|
|
|