From: Marcel Werk Date: Sat, 26 Apr 2014 11:22:40 +0000 (+0200) Subject: Fixed time zone issue X-Git-Tag: 2.0.6~12 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=faa864b88d0e82bb2e911a0391f9fdcf12fa5224;p=GitHub%2FWoltLab%2FWCF.git Fixed time zone issue --- diff --git a/com.woltlab.wcf/templates/__messageFormPoll.tpl b/com.woltlab.wcf/templates/__messageFormPoll.tpl index 943ea4d425..d3aca6a9f0 100644 --- a/com.woltlab.wcf/templates/__messageFormPoll.tpl +++ b/com.woltlab.wcf/templates/__messageFormPoll.tpl @@ -40,7 +40,7 @@
- + {if $errorField == 'pollEndTime'} {lang}wcf.poll.endTime.error.{@$errorType}{/lang} diff --git a/wcfsetup/install/files/lib/system/poll/PollManager.class.php b/wcfsetup/install/files/lib/system/poll/PollManager.class.php index d86a6db3d9..a52be2dfa4 100644 --- a/wcfsetup/install/files/lib/system/poll/PollManager.class.php +++ b/wcfsetup/install/files/lib/system/poll/PollManager.class.php @@ -161,10 +161,8 @@ class PollManager extends SingletonFactory { // poll data if (isset($_POST['pollEndTime'])) { - $endTime = StringUtil::trim($_POST['pollEndTime']); - $endTime = (!empty($endTime)) ? @strtotime($endTime . ':00') : ''; - - $this->pollData['endTime'] = ($endTime) ?: 0; + $d = \DateTime::createFromFormat('Y-m-d H:i', $_POST['pollEndTime'], WCF::getUser()->getTimeZone()); + $this->pollData['endTime'] = ($d !== false) ? $d->getTimestamp() : 0; } if (isset($_POST['pollMaxVotes'])) $this->pollData['maxVotes'] = max(intval($_POST['pollMaxVotes']), 1); // force a minimum of 1