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:
11
form.php
11
form.php
@@ -87,6 +87,15 @@ class form
|
|||||||
return $this;
|
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
|
/** Set the csrf token name
|
||||||
* @param integer $val The csrf token name
|
* @param integer $val The csrf token name
|
||||||
*/
|
*/
|
||||||
@@ -224,7 +233,7 @@ class form
|
|||||||
"Unknown FORM method (GET or POST allowed)"));
|
"Unknown FORM method (GET or POST allowed)"));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (count ($values) !== 0)
|
if (count ($values) !== 0 && $this->csrf === true)
|
||||||
{
|
{
|
||||||
// CSRF protection
|
// CSRF protection
|
||||||
try
|
try
|
||||||
|
|||||||
Reference in New Issue
Block a user