|
@@ 90-98 (lines=9) @@
|
| 87 |
|
$htmlMin->setLocalDomain(); |
| 88 |
|
} |
| 89 |
|
$localDomain = $htmlMin->getLocalDomain(); |
| 90 |
|
if ( |
| 91 |
|
(($attrName === 'href') || $attrName === 'src' || $attrName === 'srcset' || $attrName === 'action') |
| 92 |
|
&& |
| 93 |
|
!(isset($attributes['rel']) && $attributes['rel'] === 'external') |
| 94 |
|
&& |
| 95 |
|
!(isset($attributes['target']) && $attributes['target'] === '_blank') |
| 96 |
|
) { |
| 97 |
|
$attrValue = \preg_replace("/^((https?:)?\/\/)?{$localDomain}(?!\w)(\/?)/", '/', $attrValue); |
| 98 |
|
} |
| 99 |
|
} |
| 100 |
|
|
| 101 |
|
if ($this->removeAttributeHelper($element->tag, $attrName, $attrValue, $attributes, $htmlMin)) { |
|
@@ 233-241 (lines=9) @@
|
| 230 |
|
HtmlMinInterface $htmlMin |
| 231 |
|
): string { |
| 232 |
|
/** @noinspection InArrayCanBeUsedInspection */ |
| 233 |
|
if ( |
| 234 |
|
(($attrName === 'href' && !$htmlMin->isKeepPrefixOnExternalAttributes()) || $attrName === 'src' || $attrName === 'srcset' || $attrName === 'action') |
| 235 |
|
&& |
| 236 |
|
!(isset($attributes['rel']) && $attributes['rel'] === 'external') |
| 237 |
|
&& |
| 238 |
|
!(isset($attributes['target']) && $attributes['target'] === '_blank') |
| 239 |
|
) { |
| 240 |
|
$attrValue = \str_replace($scheme . '://', '//', $attrValue); |
| 241 |
|
} |
| 242 |
|
|
| 243 |
|
return $attrValue; |
| 244 |
|
} |