diff --git a/core/includes/common.inc b/core/includes/common.inc index 7f774cff22df3a25d5b2b55537157ce4aef251c9..f8f669772cd398101902ad0ffc61a361c3afa03e 100644 --- a/core/includes/common.inc +++ b/core/includes/common.inc @@ -2524,21 +2524,6 @@ function drupal_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. * diff --git a/core/modules/simpletest/src/WebTestBase.php b/core/modules/simpletest/src/WebTestBase.php index f0c52571b1aa2dc1aeff09edfb1e32295a579597..351c84be3259f5df17b3b536e0d1c7469c81c7c6 100644 --- a/core/modules/simpletest/src/WebTestBase.php +++ b/core/modules/simpletest/src/WebTestBase.php @@ -759,7 +759,7 @@ protected function drupalUserIsLoggedIn($account) { * Generate a token for the currently logged in user. */ 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); }