From e8caecca76314d9d5b0698a20567ae69aa131e06 Mon Sep 17 00:00:00 2001 From: Jeroen Desloovere Date: Tue, 12 Jun 2018 14:12:02 +0200 Subject: [PATCH 1/2] Fix $submittedToken --- spoon/form/form.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/spoon/form/form.php b/spoon/form/form.php index b1cd2bb..e8bd5dd 100644 --- a/spoon/form/form.php +++ b/spoon/form/form.php @@ -1150,9 +1150,8 @@ public function validate() // token was found else { - // get the submitted token - $data = $this->getField('form_token')->getMethod(true); - $submittedToken = isset( $data['form_token'] ) ? $data['form_token'] : null; + // get the submitted token + $submittedToken = $this->getField('form_token')->getValue(); // compare tokens if($submittedToken != $this->getTokenFromSession()) $errors .= $this->tokenError; From 0fca9a29e668496eb8c1cc1ebbbe0f7a7d408de1 Mon Sep 17 00:00:00 2001 From: Jeroen Desloovere Date: Tue, 12 Jun 2018 14:14:06 +0200 Subject: [PATCH 2/2] Fix indentation --- spoon/form/form.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spoon/form/form.php b/spoon/form/form.php index e8bd5dd..582a711 100644 --- a/spoon/form/form.php +++ b/spoon/form/form.php @@ -1150,8 +1150,8 @@ public function validate() // token was found else { - // get the submitted token - $submittedToken = $this->getField('form_token')->getValue(); + // get the submitted token + $submittedToken = $this->getField('form_token')->getValue(); // compare tokens if($submittedToken != $this->getTokenFromSession()) $errors .= $this->tokenError;