]> granicus.if.org Git - php/commitdiff
Don't try to work with negative timestamps
authorStanislav Malyshev <stas@php.net>
Mon, 30 Oct 2000 16:13:03 +0000 (16:13 +0000)
committerStanislav Malyshev <stas@php.net>
Mon, 30 Oct 2000 16:13:03 +0000 (16:13 +0000)
# It returns the same day as for 0, which is wrong

ext/calendar/cal_unix.c

index b23215c86201f4831a4ce71a36f6f0771cc378f0..c57a82b4590efa9000b40be9b9cc2b41fdd4e759 100644 (file)
@@ -45,6 +45,10 @@ PHP_FUNCTION(unixtojd)
     t = time(NULL);
   }
 
+  if(t < 0) {
+       RETURN_FALSE;
+  }
+
   ta = php_localtime_r(&t, &tmbuf);
   jdate = GregorianToSdn(ta->tm_year+1900, ta->tm_mon+1,ta->tm_mday);