]> granicus.if.org Git - php/commitdiff
- Only load external database when it is newer.
authorDerick Rethans <derick@php.net>
Mon, 3 Oct 2005 11:34:27 +0000 (11:34 +0000)
committerDerick Rethans <derick@php.net>
Mon, 3 Oct 2005 11:34:27 +0000 (11:34 +0000)
ext/date/php_date.c

index 856b2025ccfa93393dfadb8901a5fb2313d948e5..44fccb67506a0062bb01f65a99c42ac34dceb485 100644 (file)
@@ -665,8 +665,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;
+       }
 }
 /* }}} */