Issue #3151093 by dww, cburschka, Manisha111, alexpott, longwave: Replace use...
Issue #3151093 by dww, cburschka, Manisha111, alexpott, longwave: Replace use of whitelist/blacklist in \Drupal\Core\Security\RequestSanitizer and its test
Changes for core/lib/Drupal/Core/Site/Settings.php: 4 added lines, 0 removed lines.
Original line number
Diff line number
Diff line
@@ -38,6 +38,10 @@ final class Settings {
* @see self::handleDeprecations()
*/
privatestatic$deprecatedSettings=[
'sanitize_input_whitelist'=>[
'replacement'=>'sanitize_input_safe_keys',
'message'=>'The "sanitize_input_whitelist" setting is deprecated in drupal:9.1.0 and will be removed in drupal:10.0.0. Use Drupal\Core\Security\RequestSanitizer::SANITIZE_INPUT_SAFE_KEYS instead. See https://www.drupal.org/node/3163148.',
],
'twig_sandbox_whitelisted_classes'=>[
'replacement'=>'twig_sandbox_allowed_classes',
'message'=>'The "twig_sandbox_whitelisted_classes" setting is deprecated in drupal:9.1.0 and is removed from drupal:10.0.0. Use "twig_sandbox_allowed_classes" instead. See https://www.drupal.org/node/3162897.',
@@ -272,28 +276,54 @@ public function providerTestFakeDeprecatedSettings(): array {
}
/**
* Tests legacy twig_sandbox_* settings.
* Tests deprecation messages for real deprecated settings.
*
* @group legacy
* @param string $legacy_setting
* The legacy name of the setting to test.
* @param string $expected_deprecation
* The expected deprecation message.
*
* @expectedDeprecation The "twig_sandbox_whitelisted_classes" setting is deprecated in drupal:9.1.0 and is removed from drupal:10.0.0. Use "twig_sandbox_allowed_classes" instead. See https://www.drupal.org/node/3162897.
* @expectedDeprecation The "twig_sandbox_whitelisted_methods" setting is deprecated in drupal:9.1.0 and is removed from drupal:10.0.0. Use "twig_sandbox_allowed_methods" instead. See https://www.drupal.org/node/3162897.
* @expectedDeprecation The "twig_sandbox_whitelisted_prefixes" setting is deprecated in drupal:9.1.0 and is removed from drupal:10.0.0. Use "twig_sandbox_allowed_prefixes" instead. See https://www.drupal.org/node/3162897.
'The "sanitize_input_whitelist" setting is deprecated in drupal:9.1.0 and will be removed in drupal:10.0.0. Use Drupal\Core\Security\RequestSanitizer::SANITIZE_INPUT_SAFE_KEYS instead. See https://www.drupal.org/node/3163148.',
],
[
'twig_sandbox_whitelisted_classes',
'The "twig_sandbox_whitelisted_classes" setting is deprecated in drupal:9.1.0 and is removed from drupal:10.0.0. Use "twig_sandbox_allowed_classes" instead. See https://www.drupal.org/node/3162897.',
],
[
'twig_sandbox_whitelisted_methods',
'The "twig_sandbox_whitelisted_methods" setting is deprecated in drupal:9.1.0 and is removed from drupal:10.0.0. Use "twig_sandbox_allowed_methods" instead. See https://www.drupal.org/node/3162897.',
],
[
'twig_sandbox_whitelisted_prefixes',
'The "twig_sandbox_whitelisted_prefixes" setting is deprecated in drupal:9.1.0 and is removed from drupal:10.0.0. Use "twig_sandbox_allowed_prefixes" instead. See https://www.drupal.org/node/3162897.',