Commit e50271a3 authored by alexpott's avatar alexpott

Issue #2541560 by yched, dawehner, Fabianx: Followup for [#2529514] - remove dead code

parent d88f278d
......@@ -465,16 +465,8 @@ public function preHandle(Request $request) {
// Put the request on the stack.
$this->container->get('request_stack')->push($request);
// Set the allowed protocols once we have the config available.
$allowed_protocols = $this->container->getParameter('filter_protocols');
if (!$allowed_protocols) {
// \Drupal\Component\Utility\UrlHelper::filterBadProtocol() is called by
// the installer and update.php, in which case the configuration may not
// exist (yet). Provide a minimal default set of allowed protocols for
// these cases.
$allowed_protocols = array('http', 'https');
}
UrlHelper::setAllowedProtocols($allowed_protocols);
// Set the allowed protocols.
UrlHelper::setAllowedProtocols($this->container->getParameter('filter_protocols'));
// Override of Symfony's mime type guesser singleton.
MimeTypeGuesser::registerWithSymfonyGuesser($this->container);
......
......@@ -501,7 +501,7 @@ function _filter_url($text, $filter) {
// we cannot cleanly differ between protocols here without hard-coding MAILTO,
// so '//' is optional for all protocols.
// @see \Drupal\Component\Utility\UrlHelper::filterBadProtocol()
$protocols = \Drupal::getContainer()->getParameter('filter_protocols') ?: ['http', 'https'];
$protocols = \Drupal::getContainer()->getParameter('filter_protocols');
$protocols = implode(':(?://)?|', $protocols) . ':(?://)?';
$valid_url_path_characters = "[\p{L}\p{M}\p{N}!\*\';:=\+,\.\$\/%#\[\]\-_~@&]";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment