From 35f2eda47a1032ce533a3d5775d080b183923780 Mon Sep 17 00:00:00 2001 From: Gregory Oschwald Date: Tue, 23 Dec 2014 09:42:15 -0800 Subject: [PATCH] Fix error if there is no matching time zone. Resolves #30. --- ChangeLog.md | 3 +++ src/timezone.php | 8 ++++++++ timezone/make_time_zone_php_code.pl | 21 ++++++++++++++++----- 3 files changed, 27 insertions(+), 5 deletions(-) diff --git a/ChangeLog.md b/ChangeLog.md index 12aa8ba..29a953e 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -3,6 +3,9 @@ ## 1.15 (2014-??-??) * Removed broken distributed queries code. +* Previously if a time zone was not found, an undefined variable error would + be outputted. `get_time_zone` now returns `null` if there is no matching + time zone. (Fixed by justgoodman. GitHub #30.) ## 1.14 (2013-11-05) diff --git a/src/timezone.php b/src/timezone.php index e436ba1..00ea77c 100644 --- a/src/timezone.php +++ b/src/timezone.php @@ -1,6 +1,14 @@ new->get( 'http://dev.maxmind.com/static/csv/codes/time_zone.csv'); die "Failed to download CSV!\n" unless $response->{success}; -print "new ({ binary => 1});