From f254c7b339b174813d0b4060764777d0dadb060a Mon Sep 17 00:00:00 2001 From: Dominique Fournier Date: Wed, 27 Mar 2019 13:33:24 +0000 Subject: [PATCH] form : add method setter and do not test CSRF if it is disabled git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@5177 bf3deb0d-5f1a-0410-827f-c0cc1f45334c --- form.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/form.php b/form.php index 9607c97..0dae6fd 100644 --- a/form.php +++ b/form.php @@ -87,6 +87,15 @@ class form return $this; } + /** Set the method + * @param string $val The method to use + */ + public function method ($val) + { + $this->method = strtolower ($val); + return $this; + } + /** Set the csrf token name * @param integer $val The csrf token name */ @@ -224,7 +233,7 @@ class form "Unknown FORM method (GET or POST allowed)")); } - if (count ($values) !== 0) + if (count ($values) !== 0 && $this->csrf === true) { // CSRF protection try