Skip to content

Commit

Permalink
Don't split admin_poll_id as poll_id
Browse files Browse the repository at this point in the history
  • Loading branch information
olivierperez committed Oct 28, 2015
1 parent 15640a6 commit 8f2c9f0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions adminstuds.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,13 @@ function sendUpdateNotification($poll, $mailService, $type) {
if (!empty($_GET['poll'])) {
$admin_poll_id = filter_input(INPUT_GET, 'poll', FILTER_VALIDATE_REGEXP, ['options' => ['regexp' => POLL_REGEX]]);
if (strlen($admin_poll_id) === 24) {
$poll_id = substr($admin_poll_id, 0, 16);
$poll = $pollService->findByAdminId($admin_poll_id);
}
}

if (!$poll) {
if ($poll) {
$poll_id = $poll->id;
} else {
$smarty->assign('error', __('Error', 'This poll doesn\'t exist !'));
$smarty->display('error.tpl');
exit;
Expand Down

0 comments on commit 8f2c9f0

Please sign in to comment.