From e117d540d1f876aaef127ff9351e82c15abcaff1 Mon Sep 17 00:00:00 2001 From: Derick Rethans Date: Mon, 3 Oct 2005 11:34:51 +0000 Subject: [PATCH] - MFH: Only use external database when it is newer than the builtin one. --- ext/date/php_date.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ext/date/php_date.c b/ext/date/php_date.c index e694fc6dbd..b3d621a756 100644 --- a/ext/date/php_date.c +++ b/ext/date/php_date.c @@ -551,8 +551,12 @@ PHP_FUNCTION(gmdate) /* {{{ php_date_set_tzdb - NOT THREADSAFE */ PHPAPI void php_date_set_tzdb(timelib_tzdb *tzdb) { - php_date_global_timezone_db = tzdb; - php_date_global_timezone_db_enabled = 1; + timelib_tzdb *builtin = timelib_builtin_db(); + + if (php_version_compare(tzdb->version, builtin->version) > 0) { + php_date_global_timezone_db = tzdb; + php_date_global_timezone_db_enabled = 1; + } } /* }}} */ -- 2.50.1