If date can not be parsed, do not display date header at all (better than wrong date...
authorkink <kink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Wed, 31 Jul 2002 12:05:31 +0000 (12:05 +0000)
committerkink <kink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Wed, 31 Jul 2002 12:05:31 +0000 (12:05 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@3197 7612ce4b-ef26-0410-bec9-ea0150e637f0

functions/date.php

index a65308d6546fd0cbf5851e45c42da8168e513c43..c3790433fd84befdb5370053fe6e8cd14bc878a3 100644 (file)
@@ -19,6 +19,12 @@ require_once( '../functions/constants.php' );
 // corrects a time stamp to be the local time
 function getGMTSeconds($stamp, $gmt) {
     global $invert_time;
+
+    // date couldn't be parsed
+    if ($stamp == -1) {
+        return -1;
+    }
+
     if (($gmt == 'Pacific') || ($gmt == 'PST')) {
         $gmt = '-0800'; 
     } else if (($gmt == 'EDT')) {
@@ -179,6 +185,10 @@ function getLongDateString( $stamp ) {
 
     global $hour_format;
     
+    if ($stamp == -1) {
+        return '';
+    }
+
     if ( $hour_format == SMPREF_TIME_12HR ) {
         $date_format = _("D, F j, Y g:i a");
     } else {