Update to Drupal 8.1.0. For more information, see https://www.drupal.org/drupal-8.1.0-release-notes
This commit is contained in:
parent
b11a755ba8
commit
c0a0d5a94c
6920 changed files with 64395 additions and 57312 deletions
|
|
@ -10,9 +10,11 @@ use Drupal\Component\Utility\SafeMarkup;
|
|||
use Drupal\Component\Utility\Unicode;
|
||||
use Drupal\Core\Logger\RfcLogLevel;
|
||||
use Drupal\Core\Render\Markup;
|
||||
use Drupal\Component\Render\MarkupInterface;
|
||||
use Drupal\Core\Session\AccountInterface;
|
||||
use Drupal\Core\Site\Settings;
|
||||
use Drupal\Core\Utility\Error;
|
||||
use Drupal\Core\StringTranslation\TranslatableMarkup;
|
||||
|
||||
/**
|
||||
* Minimum supported version of PHP.
|
||||
|
|
@ -293,7 +295,7 @@ function drupal_get_path($type, $name) {
|
|||
* @ingroup sanitization
|
||||
*/
|
||||
function t($string, array $args = array(), array $options = array()) {
|
||||
return \Drupal::translation()->translate($string, $args, $options);
|
||||
return new TranslatableMarkup($string, $args, $options);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -442,7 +444,7 @@ function drupal_set_message($message = NULL, $type = 'status', $repeat = FALSE)
|
|||
}
|
||||
|
||||
// Convert strings which are safe to the simplest Markup objects.
|
||||
if (!($message instanceof Markup) && SafeMarkup::isSafe($message)) {
|
||||
if (!($message instanceof Markup) && $message instanceof MarkupInterface) {
|
||||
$message = Markup::create((string) $message);
|
||||
}
|
||||
|
||||
|
|
@ -619,9 +621,9 @@ function drupal_valid_test_ua($new_prefix = NULL) {
|
|||
// string.
|
||||
$http_user_agent = isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : NULL;
|
||||
$user_agent = isset($_COOKIE['SIMPLETEST_USER_AGENT']) ? $_COOKIE['SIMPLETEST_USER_AGENT'] : $http_user_agent;
|
||||
if (isset($user_agent) && preg_match("/^(simpletest\d+);(.+);(.+);(.+)$/", $user_agent, $matches)) {
|
||||
if (isset($user_agent) && preg_match("/^(simpletest\d+):(.+):(.+):(.+)$/", $user_agent, $matches)) {
|
||||
list(, $prefix, $time, $salt, $hmac) = $matches;
|
||||
$check_string = $prefix . ';' . $time . ';' . $salt;
|
||||
$check_string = $prefix . ':' . $time . ':' . $salt;
|
||||
// Read the hash salt prepared by drupal_generate_test_ua().
|
||||
// This function is called before settings.php is read and Drupal's error
|
||||
// handlers are set up. While Drupal's error handling may be properly
|
||||
|
|
@ -678,8 +680,8 @@ function drupal_generate_test_ua($prefix) {
|
|||
}
|
||||
// Generate a moderately secure HMAC based on the database credentials.
|
||||
$salt = uniqid('', TRUE);
|
||||
$check_string = $prefix . ';' . time() . ';' . $salt;
|
||||
return $check_string . ';' . Crypt::hmacBase64($check_string, $key);
|
||||
$check_string = $prefix . ':' . time() . ':' . $salt;
|
||||
return $check_string . ':' . Crypt::hmacBase64($check_string, $key);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Reference in a new issue