diff options
author | Arthur <arthur@hoa.ro> | 2016-05-05 13:21:36 +0200 |
---|---|---|
committer | Arthur <arthur@hoa.ro> | 2016-05-05 13:21:36 +0200 |
commit | 86deafe0ff5a22a37255546cf82325e89bf272b1 (patch) | |
tree | e10c9ffb84f6acacc5df2b2e42cb23f9d0b6ab7f /index.php | |
parent | 47be06098396b5eef35234b88227d64ab81bd988 (diff) | |
parent | 12ff86c961b49727fcae97938e864766aa77a2a9 (diff) | |
download | Shaarli-86deafe0ff5a22a37255546cf82325e89bf272b1.tar.gz Shaarli-86deafe0ff5a22a37255546cf82325e89bf272b1.tar.zst Shaarli-86deafe0ff5a22a37255546cf82325e89bf272b1.zip |
Merge pull request #551 from ArthurHoaro/hotfix/timezone
Use correct 'UTC' timezone
Diffstat (limited to 'index.php')
-rw-r--r-- | index.php | 20 |
1 files changed, 12 insertions, 8 deletions
@@ -1277,11 +1277,15 @@ function renderPage() | |||
1277 | { | 1277 | { |
1278 | if (!empty($_POST['title']) ) | 1278 | if (!empty($_POST['title']) ) |
1279 | { | 1279 | { |
1280 | if (!tokenOk($_POST['token'])) die('Wrong token.'); // Go away! | 1280 | if (!tokenOk($_POST['token'])) { |
1281 | die('Wrong token.'); // Go away! | ||
1282 | } | ||
1281 | $tz = 'UTC'; | 1283 | $tz = 'UTC'; |
1282 | if (!empty($_POST['continent']) && !empty($_POST['city'])) | 1284 | if (!empty($_POST['continent']) && !empty($_POST['city']) |
1283 | if (isTimeZoneValid($_POST['continent'],$_POST['city'])) | 1285 | && isTimeZoneValid($_POST['continent'], $_POST['city']) |
1284 | $tz = $_POST['continent'].'/'.$_POST['city']; | 1286 | ) { |
1287 | $tz = $_POST['continent'] . '/' . $_POST['city']; | ||
1288 | } | ||
1285 | $GLOBALS['timezone'] = $tz; | 1289 | $GLOBALS['timezone'] = $tz; |
1286 | $GLOBALS['title']=$_POST['title']; | 1290 | $GLOBALS['title']=$_POST['title']; |
1287 | $GLOBALS['titleLink']=$_POST['titleLink']; | 1291 | $GLOBALS['titleLink']=$_POST['titleLink']; |
@@ -2108,10 +2112,10 @@ function install() | |||
2108 | if (!empty($_POST['setlogin']) && !empty($_POST['setpassword'])) | 2112 | if (!empty($_POST['setlogin']) && !empty($_POST['setpassword'])) |
2109 | { | 2113 | { |
2110 | $tz = 'UTC'; | 2114 | $tz = 'UTC'; |
2111 | if (!empty($_POST['continent']) && !empty($_POST['city'])) { | 2115 | if (!empty($_POST['continent']) && !empty($_POST['city']) |
2112 | if (isTimeZoneValid($_POST['continent'], $_POST['city'])) { | 2116 | && isTimeZoneValid($_POST['continent'], $_POST['city']) |
2113 | $tz = $_POST['continent'].'/'.$_POST['city']; | 2117 | ) { |
2114 | } | 2118 | $tz = $_POST['continent'].'/'.$_POST['city']; |
2115 | } | 2119 | } |
2116 | $GLOBALS['timezone'] = $tz; | 2120 | $GLOBALS['timezone'] = $tz; |
2117 | // Everything is ok, let's create config file. | 2121 | // Everything is ok, let's create config file. |