Commit 979f8348 authored by catch's avatar catch

Issue #1999376 by chertzog, chrisjlee: Use Symfony Request for filter module.

parent 0de8bea7
......@@ -1514,7 +1514,8 @@ function _filter_html_image_secure_process($text) {
$src = $image->getAttribute('src');
// Remove absolute URLs pointing to the local domain to prevent mixed
// content errors.
$image->setAttribute('src', preg_replace('|^https?://' . $_SERVER['HTTP_HOST'] . '|', '', $src));
$request = Drupal::request();
$image->setAttribute('src', preg_replace('|^https?://' . $request->getHost() . '|', '', $src));
// Verify that $src starts with $base_path.
// This also ensures that external images cannot be referenced.
......
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