Skip to content
Snippets Groups Projects
Commit abe90a00 authored by catch's avatar catch
Browse files

Issue #2196805 by divesh.kumar: Convert all calls to check_plain() in core to...

Issue #2196805 by divesh.kumar: Convert all calls to check_plain() in core to Drupal\Component\Utility\String::checkPlain() in ban module.
parent e871186f
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -13,6 +13,7 @@
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Drupal\ban\BanIpManager;
use Drupal\Component\Utility\String;
/**
* Ban subscriber for controller requests.
......@@ -45,7 +46,7 @@ public function __construct(BanIpManager $manager) {
public function onKernelRequestBannedIpCheck(GetResponseEvent $event) {
$ip = $event->getRequest()->getClientIp();
if ($this->manager->isDenied($ip)) {
$response = new Response('Sorry, ' . check_plain($ip) . ' has been banned.', 403);
$response = new Response('Sorry, ' . String::checkPlain($ip) . ' has been banned.', 403);
$event->setResponse($response);
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment