diff --git a/adminstuds.php b/adminstuds.php index 07ee4423b28e8e2f0869f37b8260921668455535..92262c8a7054205fa73a2da707070c04e0155f3e 100644 --- a/adminstuds.php +++ b/adminstuds.php @@ -46,12 +46,8 @@ $inputService = new InputService(); /* PAGE */ /* ---- */ -if (!empty($_POST['poll']) || !empty($_GET['poll'])) { - if (!empty($_POST['poll'])) - $inputType = INPUT_POST; - else - $inputType = INPUT_GET; - $admin_poll_id = filter_input($inputType, 'poll', FILTER_VALIDATE_REGEXP, ['options' => ['regexp' => POLL_REGEX]]); +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->findById($poll_id); diff --git a/studs.php b/studs.php index ad5e323574eecf384a0de5f6b2d1d8ead21dfcbb..bd7ec294fac2b4608bb05fb5c6745ed4cc6d0867 100644 --- a/studs.php +++ b/studs.php @@ -92,13 +92,11 @@ function sendUpdateNotification($poll, $mailService, $name, $type) { /* PAGE */ /* ---- */ -if (!empty($_POST['poll']) || !empty($_GET['poll'])) { - if (!empty($_POST['poll'])) - $inputType = INPUT_POST; - else - $inputType = INPUT_GET; - $poll_id = filter_input($inputType, 'poll', FILTER_VALIDATE_REGEXP, ['options' => ['regexp' => POLL_REGEX]]); - $poll = $pollService->findById($poll_id); +if (!empty($_GET['poll'])) { + $poll_id = filter_input(INPUT_GET, 'poll', FILTER_VALIDATE_REGEXP, ['options' => ['regexp' => POLL_REGEX]]); + if (strlen($poll_id) === 16) { + $poll = $pollService->findById($poll_id); + } } if (!$poll) {