mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
MINOR: Removed use of deprecated securityTokenEnable.
This commit is contained in:
parent
42b8d3da04
commit
b0b5fea3f5
@ -334,7 +334,9 @@ class FormField extends RequestHandler {
|
|||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function securityTokenEnabled() {
|
public function securityTokenEnabled() {
|
||||||
return $this->getForm() && $this->getForm()->securityTokenEnabled();
|
$form = $this->getForm();
|
||||||
|
if(!$form) return false;
|
||||||
|
return $form->getSecurityToken()->isEnabled();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1177,7 +1177,7 @@ JS
|
|||||||
$parentUrlParts = parse_url(parent::Link($action));
|
$parentUrlParts = parse_url(parent::Link($action));
|
||||||
$queryPart = (isset($parentUrlParts['query'])) ? '?' . $parentUrlParts['query'] : null;
|
$queryPart = (isset($parentUrlParts['query'])) ? '?' . $parentUrlParts['query'] : null;
|
||||||
// Ensure that URL actions not routed through Form->httpSubmission() are protected against CSRF attacks.
|
// Ensure that URL actions not routed through Form->httpSubmission() are protected against CSRF attacks.
|
||||||
if($form->securityTokenEnabled()) $queryPart = $token->addtoUrl($queryPart);
|
if($token->isEnabled()) $queryPart = $token->addtoUrl($queryPart);
|
||||||
return Controller::join_links($parentUrlParts['path'], $queryPart);
|
return Controller::join_links($parentUrlParts['path'], $queryPart);
|
||||||
} else {
|
} else {
|
||||||
// allow for instanciation of this FormField outside of a controller/form
|
// allow for instanciation of this FormField outside of a controller/form
|
||||||
@ -1416,7 +1416,7 @@ class TableListField_Item extends ViewableData {
|
|||||||
$parentUrlParts = parse_url($this->parent->Link());
|
$parentUrlParts = parse_url($this->parent->Link());
|
||||||
$queryPart = (isset($parentUrlParts['query'])) ? '?' . $parentUrlParts['query'] : null;
|
$queryPart = (isset($parentUrlParts['query'])) ? '?' . $parentUrlParts['query'] : null;
|
||||||
// Ensure that URL actions not routed through Form->httpSubmission() are protected against CSRF attacks.
|
// Ensure that URL actions not routed through Form->httpSubmission() are protected against CSRF attacks.
|
||||||
if($form->securityTokenEnabled()) $queryPart = $token->addtoUrl($queryPart);
|
if($token->isEnabled()) $queryPart = $token->addtoUrl($queryPart);
|
||||||
return Controller::join_links($parentUrlParts['path'], 'item', $this->item->ID, $action, $queryPart);
|
return Controller::join_links($parentUrlParts['path'], 'item', $this->item->ID, $action, $queryPart);
|
||||||
} else {
|
} else {
|
||||||
// allow for instanciation of this FormField outside of a controller/form
|
// allow for instanciation of this FormField outside of a controller/form
|
||||||
|
Loading…
x
Reference in New Issue
Block a user