Issue #2196805 by divesh.kumar: Convert all calls to check_plain() in core to Drupal\Component\Utility\String::checkPlain() in ban module.

8.0.x
Nathaniel Catchpole 2014-02-20 12:08:12 +00:00
parent e871186f8e
commit abe90a00dc
1 changed files with 2 additions and 1 deletions

View File

@ -13,6 +13,7 @@ use Symfony\Component\HttpKernel\Event\GetResponseEvent;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Drupal\ban\BanIpManager;
use Drupal\Component\Utility\String;
/**
* Ban subscriber for controller requests.
@ -45,7 +46,7 @@ class BanSubscriber implements EventSubscriberInterface {
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);
}
}