summaryrefslogtreecommitdiff
path: root/index.php
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2012-05-07 11:38:51 -0700
committerBharat Mediratta <bharat@menalto.com>2012-05-07 11:38:51 -0700
commite722e5d5d4fbd8a70cc67c4d545390120ed00608 (patch)
tree590a511863b7d44eead112a344e77c2f901ff9e7 /index.php
parent62623a84d0228e3851e7cca99cc84e34d572dce0 (diff)
Fix missing date.timezone which results in a crash on startup in I18n
code. Fill in missing field and log it 25% of the time. Fixes #1853.
Diffstat (limited to 'index.php')
-rw-r--r--index.php6
1 files changed, 6 insertions, 0 deletions
diff --git a/index.php b/index.php
index 6e3ee4d4..689c0770 100644
--- a/index.php
+++ b/index.php
@@ -24,6 +24,12 @@ define("IN_PRODUCTION", true);
version_compare(PHP_VERSION, "5.2.3", "<") and
exit("Gallery requires PHP 5.2.3 or newer (you're using " . PHP_VERSION . ")");
+// PHP 5.4 requires a timezone - if one isn't set date functions aren't going to work properly.
+// We'll log this once the logging system is initialized (in the gallery_event::gallery_ready).
+if (!ini_get("date.timezone")) {
+ ini_set("date.timezone", "UTC");
+}
+
// Gallery requires short_tags to be on
!ini_get("short_open_tag") and exit("Gallery requires short_open_tag to be on.");