mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Be defensive with token availability
This commit is contained in:
parent
899eb0b235
commit
8015919932
@ -657,8 +657,10 @@ class Form extends RequestHandler {
|
|||||||
$extraFields = new FieldList();
|
$extraFields = new FieldList();
|
||||||
|
|
||||||
$token = $this->getSecurityToken();
|
$token = $this->getSecurityToken();
|
||||||
$tokenField = $token->updateFieldSet($this->fields);
|
if ($token) {
|
||||||
if($tokenField) $tokenField->setForm($this);
|
$tokenField = $token->updateFieldSet($this->fields);
|
||||||
|
if($tokenField) $tokenField->setForm($this);
|
||||||
|
}
|
||||||
$this->securityTokenAdded = true;
|
$this->securityTokenAdded = true;
|
||||||
|
|
||||||
// add the "real" HTTP method if necessary (for PUT, DELETE and HEAD)
|
// add the "real" HTTP method if necessary (for PUT, DELETE and HEAD)
|
||||||
|
Loading…
Reference in New Issue
Block a user