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

index e694fc6dbdcde30ef63d969e64fdf0cf8b2c5ee4..b3d621a756a00ee3567c65d3eee07080252c41c1 100644 (file)
@@ -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;
+       }
 }
 /* }}} */