Issue #2297535 by marcingy: Remove drupal_get_private_key.
parent
753f2255fb
commit
a66922a49e
|
|
@ -2524,21 +2524,6 @@ function drupal_json_decode($var) {
|
||||||
return Json::decode($var);
|
return Json::decode($var);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Ensures the private key variable used to generate tokens is set.
|
|
||||||
*
|
|
||||||
* @return string
|
|
||||||
* The private key.
|
|
||||||
*
|
|
||||||
* @see \Drupal\Core\Access\CsrfTokenGenerator
|
|
||||||
*
|
|
||||||
* @deprecated in Drupal 8.x-dev, will be removed before Drupal 8.0.
|
|
||||||
* Use \Drupal::service('private_key')->get().
|
|
||||||
*/
|
|
||||||
function drupal_get_private_key() {
|
|
||||||
return \Drupal::service('private_key')->get();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generates a token based on $value, the user session, and the private key.
|
* Generates a token based on $value, the user session, and the private key.
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -759,7 +759,7 @@ abstract class WebTestBase extends TestBase {
|
||||||
* Generate a token for the currently logged in user.
|
* Generate a token for the currently logged in user.
|
||||||
*/
|
*/
|
||||||
protected function drupalGetToken($value = '') {
|
protected function drupalGetToken($value = '') {
|
||||||
$private_key = drupal_get_private_key();
|
$private_key = \Drupal::service('private_key')->get();
|
||||||
return Crypt::hmacBase64($value, $this->session_id . $private_key);
|
return Crypt::hmacBase64($value, $this->session_id . $private_key);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue