From: Rasmus Lerdorf Date: Tue, 15 Sep 2009 20:28:42 +0000 (+0000) Subject: Fix bug #49558 X-Git-Tag: php-5.3.2RC1~511 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d032060ea8db0a45d4d5001904081478d69d1c38;p=php Fix bug #49558 And as Colin mentioned in the bug report, this means date_sunrise() and date_sunset() have been off by 26 seconds in most cases until now. --- diff --git a/ext/date/php_date.c b/ext/date/php_date.c index fafe4f97d5..c4598fae08 100644 --- a/ext/date/php_date.c +++ b/ext/date/php_date.c @@ -3927,7 +3927,7 @@ static void php_do_date_sunrise_sunset(INTERNAL_FUNCTION_PARAMETERS, int calc_su } timelib_unixtime2local(t, time); - rs = timelib_astro_rise_set_altitude(t, longitude, latitude, altitude, altitude > -1 ? 1 : 0, &h_rise, &h_set, &rise, &set, &transit); + rs = timelib_astro_rise_set_altitude(t, longitude, latitude, altitude, calc_sunset?0:1, &h_rise, &h_set, &rise, &set, &transit); timelib_time_dtor(t); if (rs != 0) {