mirror of
https://github.com/php/php-src.git
synced 2026-03-27 01:32:22 +01:00
Don't try to work with negative timestamps
# It returns the same day as for 0, which is wrong
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user