X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=index.php;fp=index.php;h=01122ebf233077f065301293c0c0666f2bb4f621;hb=12ff86c961b49727fcae97938e864766aa77a2a9;hp=d3369a2dcd58335772dc4dbe4c21f6735451c0c6;hpb=9ad2950debf1d9e4528700854cf7c02daac9636d;p=github%2Fshaarli%2FShaarli.git diff --git a/index.php b/index.php index d3369a2d..01122ebf 100644 --- a/index.php +++ b/index.php @@ -1276,11 +1276,15 @@ function renderPage() { if (!empty($_POST['title']) ) { - if (!tokenOk($_POST['token'])) die('Wrong token.'); // Go away! + if (!tokenOk($_POST['token'])) { + die('Wrong token.'); // Go away! + } $tz = 'UTC'; - if (!empty($_POST['continent']) && !empty($_POST['city'])) - if (isTimeZoneValid($_POST['continent'],$_POST['city'])) - $tz = $_POST['continent'].'/'.$_POST['city']; + if (!empty($_POST['continent']) && !empty($_POST['city']) + && isTimeZoneValid($_POST['continent'], $_POST['city']) + ) { + $tz = $_POST['continent'] . '/' . $_POST['city']; + } $GLOBALS['timezone'] = $tz; $GLOBALS['title']=$_POST['title']; $GLOBALS['titleLink']=$_POST['titleLink']; @@ -2113,10 +2117,10 @@ function install() if (!empty($_POST['setlogin']) && !empty($_POST['setpassword'])) { $tz = 'UTC'; - if (!empty($_POST['continent']) && !empty($_POST['city'])) { - if (isTimeZoneValid($_POST['continent'], $_POST['city'])) { - $tz = $_POST['continent'].'/'.$_POST['city']; - } + if (!empty($_POST['continent']) && !empty($_POST['city']) + && isTimeZoneValid($_POST['continent'], $_POST['city']) + ) { + $tz = $_POST['continent'].'/'.$_POST['city']; } $GLOBALS['timezone'] = $tz; // Everything is ok, let's create config file.