We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a383589 commit e6fe9c0Copy full SHA for e6fe9c0
Embed/Providers/Html.php
@@ -122,13 +122,14 @@ public function __construct (Url $Url) {
122
$Content = $Html;
123
}
124
125
- $host = $Url->getHost();
+ $domain = $Url->getDomain();
126
127
foreach ($Content->getElementsByTagName('img') as $Tag) {
128
if ($Tag->hasAttribute('src')) {
129
$image = $Tag->getAttribute('src');
130
131
- if (strpos($image, '://') && (strpos(parse_url($image, PHP_URL_HOST), $host) === false)) {
+ //Check whether the image is in the same domain
132
+ if ((strpos($image, '//') === false) || (($ImgUrl = new Url($image)) && ($ImgUrl->getDomain() !== $domain))) {
133
continue;
134
135
0 commit comments