diff -u b/core/lib/Drupal/Core/Template/TwigExtension.php b/core/lib/Drupal/Core/Template/TwigExtension.php --- b/core/lib/Drupal/Core/Template/TwigExtension.php +++ b/core/lib/Drupal/Core/Template/TwigExtension.php @@ -135,7 +135,7 @@ // be used in "trans" tags. // @see TwigNodeTrans::compileString() new \Twig_SimpleFilter('passthrough', 'twig_raw_filter', array('is_safe' => array('html'))), - new \Twig_SimpleFilter('url_filter', array($this, 'urlFilter'), array('is_safe' => array('html'), 'needs_environment' => TRUE)), + new \Twig_SimpleFilter('url_filter', array($this, 'urlFilter'), array('is_safe' => array('html'))), new \Twig_SimpleFilter('placeholder', [$this, 'escapePlaceholder'], array('is_safe' => array('html'), 'needs_environment' => TRUE)), // Replace twig's escape filter with our own. @@ -350,16 +350,14 @@ /** * Escapes URLs to HTML and strips them of dangerous protocols. * - * @param \Twig_Environment $env - * A Twig_Environment instance. * @param mixed $string * The URL. * * @return null|string * The sanitized, rendered output, or NULL if there is no valid output. */ - public function urlFilter($env, $string) { - return Html::escape($env, UrlHelper::stripDangerousProtocols($string)); + public function urlFilter($string) { + return Html::escape(UrlHelper::stripDangerousProtocols($string)); } /**