Loading core/lib/Drupal/Component/Utility/Html.php +3 −1 Changes for core/lib/Drupal/Component/Utility/Html.php: 3 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -472,10 +472,13 @@ public static function transformRootRelativeUrlsToAbsolute($html, $scheme_and_ho $xpath = new \DOMXpath($html_dom); // Update all root-relative URLs to absolute URLs in the given HTML. // Perform on attributes that may contain a single URI. foreach (static::$uriAttributes as $attr) { foreach ($xpath->query("//*[starts-with(@$attr, '/') and not(starts-with(@$attr, '//'))]") as $node) { $node->setAttribute($attr, $scheme_and_host . $node->getAttribute($attr)); } } // Perform on each URI within "srcset" attributes. foreach ($xpath->query("//*[@srcset]") as $node) { // @see https://html.spec.whatwg.org/multipage/embedded-content.html#attr-img-srcset // @see https://html.spec.whatwg.org/multipage/embedded-content.html#image-candidate-string Loading @@ -489,7 +492,6 @@ public static function transformRootRelativeUrlsToAbsolute($html, $scheme_and_ho } $node->setAttribute('srcset', implode(', ', $image_candidate_strings)); } } return Html::serialize($html_dom); } Loading Loading
core/lib/Drupal/Component/Utility/Html.php +3 −1 Changes for core/lib/Drupal/Component/Utility/Html.php: 3 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -472,10 +472,13 @@ public static function transformRootRelativeUrlsToAbsolute($html, $scheme_and_ho $xpath = new \DOMXpath($html_dom); // Update all root-relative URLs to absolute URLs in the given HTML. // Perform on attributes that may contain a single URI. foreach (static::$uriAttributes as $attr) { foreach ($xpath->query("//*[starts-with(@$attr, '/') and not(starts-with(@$attr, '//'))]") as $node) { $node->setAttribute($attr, $scheme_and_host . $node->getAttribute($attr)); } } // Perform on each URI within "srcset" attributes. foreach ($xpath->query("//*[@srcset]") as $node) { // @see https://html.spec.whatwg.org/multipage/embedded-content.html#attr-img-srcset // @see https://html.spec.whatwg.org/multipage/embedded-content.html#image-candidate-string Loading @@ -489,7 +492,6 @@ public static function transformRootRelativeUrlsToAbsolute($html, $scheme_and_ho } $node->setAttribute('srcset', implode(', ', $image_candidate_strings)); } } return Html::serialize($html_dom); } Loading