]> git.immae.eu Git - github/shaarli/Shaarli.git/blobdiff - index.php
Installation: default to the server's timezone
[github/shaarli/Shaarli.git] / index.php
index 6d3fbd39616926a7c9a48659399ff3ce908d67f9..e3b612c89ff92d6037d6f70d0385d253af2a4a23 100644 (file)
--- a/index.php
+++ b/index.php
@@ -1,14 +1,16 @@
 <?php
-// Shaarli 0.0.45beta - Shaare your links...
+// Shaarli 0.5.0 - Shaare your links...
 // The personal, minimalist, super-fast, no-database Delicious clone. By sebsauvage.net
 // http://sebsauvage.net/wiki/doku.php?id=php:shaarli
 // Licence: http://www.opensource.org/licenses/zlib-license.php
 // Requires: PHP 5.3.x
 // -----------------------------------------------------------------------------------------------
-// NEVER TRUST IN PHP.INI
-// Some hosts do not define a default timezone in php.ini,
-// so we have to do this for avoid the strict standard error.
-date_default_timezone_set('UTC');
+
+// Set 'UTC' as the default timezone if it is not defined in php.ini
+// See http://php.net/manual/en/datetime.configuration.php#ini.date.timezone
+if (date_default_timezone_get() == '') {
+    date_default_timezone_set('UTC');
+}
 
 // -----------------------------------------------------------------------------------------------
 // Hardcoded parameter (These parameters can be overwritten by editing the file /data/config.php)
@@ -37,7 +39,7 @@ $GLOBALS['config']['ARCHIVE_ORG'] = false; // For each link, add a link to an ar
 $GLOBALS['config']['ENABLE_RSS_PERMALINKS'] = true;  // Enable RSS permalinks by default. This corresponds to the default behavior of shaarli before this was added as an option.
 $GLOBALS['config']['HIDE_PUBLIC_LINKS'] = false;
 // -----------------------------------------------------------------------------------------------
-define('shaarli_version','0.0.45beta');
+define('shaarli_version','0.5.0');
 // http://server.com/x/shaarli --> /shaarli/
 define('WEB_PATH', substr($_SERVER["REQUEST_URI"], 0, 1+strrpos($_SERVER["REQUEST_URI"], '/', 0)));