mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
FIX: Have ParameterConfirmationToken work regardless of include path
This commit is contained in:
parent
7656a22329
commit
036c36a7dd
@ -23,7 +23,7 @@ class ParameterConfirmationToken {
|
|||||||
$basepath = rtrim(dirname(dirname(dirname(dirname(__FILE__)))), DIRECTORY_SEPARATOR);
|
$basepath = rtrim(dirname(dirname(dirname(dirname(__FILE__)))), DIRECTORY_SEPARATOR);
|
||||||
}
|
}
|
||||||
|
|
||||||
require_once('core/TempPath.php');
|
require_once(dirname(dirname(__FILE__)).'/TempPath.php');
|
||||||
$tempfolder = getTempFolder($basepath ? $basepath : DIRECTORY_SEPARATOR);
|
$tempfolder = getTempFolder($basepath ? $basepath : DIRECTORY_SEPARATOR);
|
||||||
|
|
||||||
return $tempfolder.'/token_'.preg_replace('/[^a-z0-9]+/', '', $token);
|
return $tempfolder.'/token_'.preg_replace('/[^a-z0-9]+/', '', $token);
|
||||||
@ -31,7 +31,7 @@ class ParameterConfirmationToken {
|
|||||||
|
|
||||||
protected function genToken() {
|
protected function genToken() {
|
||||||
// Generate a new random token (as random as possible)
|
// Generate a new random token (as random as possible)
|
||||||
require_once('security/RandomGenerator.php');
|
require_once(dirname(dirname(dirname(__FILE__))).'/security/RandomGenerator.php');
|
||||||
$rg = new RandomGenerator();
|
$rg = new RandomGenerator();
|
||||||
$token = $rg->randomToken('md5');
|
$token = $rg->randomToken('md5');
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user