{
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'];
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.
{
$this->assertTrue(isTimeZoneValid('America', 'Argentina/Ushuaia'));
$this->assertTrue(isTimeZoneValid('Europe', 'Oslo'));
- $this->assertTrue(isTimeZoneValid('UTC', 'UTC'));
}
/**
$this->assertFalse(isTimeZoneValid('CEST', 'CEST'));
$this->assertFalse(isTimeZoneValid('Europe', 'Atlantis'));
$this->assertFalse(isTimeZoneValid('Middle_Earth', 'Moria'));
+ $this->assertFalse(isTimeZoneValid('UTC', 'UTC'));
}
}