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
This commit is contained in:
2019-03-27 13:33:24 +00:00
parent f7ae4dbdea
commit f254c7b339

View File

@@ -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