Skip to content
This repository has been archived by the owner on Nov 9, 2019. It is now read-only.

Commit

Permalink
fix registration bug
Browse files Browse the repository at this point in the history
Fixes #1816.
  • Loading branch information
laufhannes committed May 7, 2016
1 parent 7d321bb commit 1362282
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions inc/system/class.AccountHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -225,9 +225,10 @@ private static function createNewUserFromPost() {
$activationHash = (System::isAtLocalhost()) ? '' : self::getRandomHash();
$newSalt = self::getNewSalt();

$timezone = EnumTimezone::getEnumByOriginalName(date_default_timezone_get());
if (Timezone::isValidTimezone($_POST['timezone'])) {
$timezone = EnumTimezone::getEnumByOriginalName($_POST['timezone']);
try {
$timezone = EnumTimezone::getEnumByOriginalName($_POST['timezone']);
} catch (\InvalidArgumentException $e) {
$timezone = EnumTimezone::getEnumByOriginalName(date_default_timezone_get());
}

$newAccountId = DB::getInstance()->insert('account',
Expand Down

0 comments on commit 1362282

Please sign in to comment.