summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ext/date/php_date.c8
1 files 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;
+ }
}
/* }}} */