Преглед изворни кода

If date can not be parsed, do not display date header at all (better than wrong date header)

Thijs Kinkhorst пре 23 година
родитељ
комит
78b99f18b1
1 измењених фајлова са 10 додато и 0 уклоњено
  1. 10 0
      functions/date.php

+ 10 - 0
functions/date.php

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