summaryrefslogtreecommitdiff
path: root/program/include/rcube_imap_generic.php
diff options
context:
space:
mode:
authorthomascube <thomas@roundcube.net>2011-01-21 16:50:07 +0000
committerthomascube <thomas@roundcube.net>2011-01-21 16:50:07 +0000
commit31278471d3f2b882e28e01184814f3edc69973bf (patch)
tree4f2a93e2bae0b979fbe278d27058d9624e4a4d16 /program/include/rcube_imap_generic.php
parent58b5dde4cca3a39a147e0dae57fcbf12ce105c17 (diff)
Use improved strtotime() function + reduce duplicated code
Diffstat (limited to 'program/include/rcube_imap_generic.php')
-rw-r--r--program/include/rcube_imap_generic.php16
1 files changed, 1 insertions, 15 deletions
diff --git a/program/include/rcube_imap_generic.php b/program/include/rcube_imap_generic.php
index 6bebd8c7b..b4f01a9e2 100644
--- a/program/include/rcube_imap_generic.php
+++ b/program/include/rcube_imap_generic.php
@@ -3223,21 +3223,7 @@ class rcube_imap_generic
*/
private function strToTime($date)
{
- // support non-standard "GMTXXXX" literal
- $date = preg_replace('/GMT\s*([+-][0-9]+)/', '\\1', $date);
- // if date parsing fails, we have a date in non-rfc format.
- // remove token from the end and try again
- while ((($ts = @strtotime($date))===false) || ($ts < 0)) {
- $d = explode(' ', $date);
- array_pop($d);
- if (!$d) {
- break;
- }
- $date = implode(' ', $d);
- }
-
- $ts = (int) $ts;
-
+ $ts = (int) rcube_strtotime($date);
return $ts < 0 ? 0 : $ts;
}