diff --git a/classen/FormValidator.php b/classen/FormValidator.php index 5a0955f..c5dd773 100644 --- a/classen/FormValidator.php +++ b/classen/FormValidator.php @@ -8,6 +8,10 @@ class FormValidator { } public function isValid(array $req) { + if(!isset($req['csrf']) || $req['csrf'] !== $_SESSION['csrf']) { + return false; + } + foreach($fieldValidation as $field => $params) { if($params['required'] && (!isset($req[$field]) || strlen($req[$field]) == 0)) { return false;