diff --git a/core/ViewableData.php b/core/ViewableData.php index 669118df8..0b28085aa 100644 --- a/core/ViewableData.php +++ b/core/ViewableData.php @@ -708,6 +708,16 @@ class ViewableData extends Object implements IteratorAggregate { return Member::currentUser(); } + /** + * Return a CSRF-preventing ID to insert into a form. + * + * @return string + */ + public function getSecurityID() { + $token = SecurityToken::inst(); + return $token->getValue(); + } + /** * Returns the Security ID. * This is used to prevent CRSF attacks in forms.