Move token generation to Security namespace
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
namespace Kanboard\Helper;
|
||||
|
||||
use Kanboard\Core\Security;
|
||||
use Kanboard\Core\Base;
|
||||
|
||||
/**
|
||||
* Form helpers
|
||||
@@ -10,7 +10,7 @@ use Kanboard\Core\Security;
|
||||
* @package helper
|
||||
* @author Frederic Guillot
|
||||
*/
|
||||
class Form extends \Kanboard\Core\Base
|
||||
class Form extends Base
|
||||
{
|
||||
/**
|
||||
* Hidden CSRF token field
|
||||
@@ -20,7 +20,7 @@ class Form extends \Kanboard\Core\Base
|
||||
*/
|
||||
public function csrf()
|
||||
{
|
||||
return '<input type="hidden" name="csrf_token" value="'.Security::getCSRFToken().'"/>';
|
||||
return '<input type="hidden" name="csrf_token" value="'.$this->token->getCSRFToken().'"/>';
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
namespace Kanboard\Helper;
|
||||
|
||||
use Kanboard\Core\Request;
|
||||
use Kanboard\Core\Security;
|
||||
use Kanboard\Core\Base;
|
||||
|
||||
/**
|
||||
* Url helpers
|
||||
@@ -11,7 +11,7 @@ use Kanboard\Core\Security;
|
||||
* @package helper
|
||||
* @author Frederic Guillot
|
||||
*/
|
||||
class Url extends \Kanboard\Core\Base
|
||||
class Url extends Base
|
||||
{
|
||||
private $base = '';
|
||||
private $directory = '';
|
||||
@@ -158,7 +158,7 @@ class Url extends \Kanboard\Core\Base
|
||||
}
|
||||
|
||||
if ($csrf) {
|
||||
$qs['csrf_token'] = Security::getCSRFToken();
|
||||
$qs['csrf_token'] = $this->token->getCSRFToken();
|
||||
}
|
||||
|
||||
if (! empty($qs)) {
|
||||
|
||||
Reference in New Issue
Block a user