Added a hook for the priority plugin.
[squirrelmail.git] / functions / date.php
index 1b2811532289370eef75cbbac0fb97c5a10bab0f..a22fea7eee3df1d540794b888061607e55d5398b 100644 (file)
     **  $Id$
     **/
 
-   $date_php = true;
-
+   if (defined ('date_php'))
+      return; 
+   define ('date_php', true);
+   
    // corrects a time stamp to be the local time
    function getGMTSeconds($stamp, $gmt) {
       global $invert_time;
@@ -37,6 +39,8 @@
          $gmt = '+0200';
       else if ($gmt == 'JST')
          $gmt = '+0900';
+      else if ($gmt == 'KST')
+         $gmt = "+0900";
       else if ($gmt == 'MET')
          $gmt = '+0100';
       else if ($gmt == 'MET DST' || $gmt == 'METDST')
       //    the 3 times it was getting called by calling the functions
       //    getHour, getMinute, and getSecond.
       //
+      if (! isset($dateParts[1])) $dateParts[1] = '';
+      if (! isset($dateParts[2])) $dateParts[2] = '';
+      if (! isset($dateParts[3])) $dateParts[3] = '';
+      if (! isset($dateParts[4])) $dateParts[4] = '';
+      if (! isset($dateParts[5])) $dateParts[5] = '';
       if (intval(trim($dateParts[0])) > 0) {
          $string = $dateParts[0] . ' ' . $dateParts[1] . ' ' . 
                    $dateParts[2] . ' ' . $dateParts[3];