From 64abcca227af002498a64b1818bfb6463ea8dd5b Mon Sep 17 00:00:00 2001 From: Puguh Wijayanto Date: Mon, 13 Feb 2017 00:08:03 +0700 Subject: [PATCH] #70 Token fix --- inc/lib/Comments.class.php | 2 +- inc/lib/Control/Backend/tags.control.php | 1 - inc/mod/contact-form/inc/Contact.lib.php | 2 +- inc/mod/newsletter/options.php | 2 +- 4 files changed, 3 insertions(+), 4 deletions(-) diff --git a/inc/lib/Comments.class.php b/inc/lib/Comments.class.php index fab6f080..d6db76b5 100644 --- a/inc/lib/Comments.class.php +++ b/inc/lib/Comments.class.php @@ -96,7 +96,7 @@ public static function addComment($vars) unset($vars['addComment']); $token = Typo::cleanX($vars['token']); - if (!isset($vars['token']) || !Token::isExist($token)) { + if (!isset($vars['token']) || !Token::validate($token)) { $alertDanger[] = TOKEN_NOT_EXIST; } if (!isset($vars['comments-msg']) || null == $vars['comments-msg'] || $vars['comments-msg'] == '


') { diff --git a/inc/lib/Control/Backend/tags.control.php b/inc/lib/Control/Backend/tags.control.php index a92a9f24..a4b2d28a 100644 --- a/inc/lib/Control/Backend/tags.control.php +++ b/inc/lib/Control/Backend/tags.control.php @@ -96,7 +96,6 @@ if (isset($alertDanger)) { $data['alertDanger'] = $alertDanger; } else { - echo "Detel"; Categories::delete(Typo::int($_GET['id'])); $data['alertSuccess'][] = MSG_TAG_REMOVED; } diff --git a/inc/mod/contact-form/inc/Contact.lib.php b/inc/mod/contact-form/inc/Contact.lib.php index 1668526c..8fb72615 100644 --- a/inc/mod/contact-form/inc/Contact.lib.php +++ b/inc/mod/contact-form/inc/Contact.lib.php @@ -24,7 +24,7 @@ public static function contactPage($data) switch ($_POST['sendMessage']){ case true: $token = Typo::cleanX($_POST['token']); - if (!isset($_POST['token']) || !Token::isExist($token)){ + if (!isset($_POST['token']) || !Token::validate($token)){ $alertDanger[] = TOKEN_NOT_EXIST; } if (Xaptcha::isEnable()) { diff --git a/inc/mod/newsletter/options.php b/inc/mod/newsletter/options.php index 08e40d64..7c6ed0b7 100644 --- a/inc/mod/newsletter/options.php +++ b/inc/mod/newsletter/options.php @@ -3,7 +3,7 @@ if (isset($_POST['sendmail'])) { // check token first $token = Typo::cleanX($_POST['token']); - if (!isset($_POST['token']) || !Token::isExist($token)) { + if (!isset($_POST['token']) || !Token::validate($token)) { $alertDanger[] = TOKEN_NOT_EXIST; } if (isset($alertDanger)) {