fix: ArgumentCountError: DOMDocument::getElementsByTagName() expects exactly 1 argument, 2 given, #3406 (#3407)

This commit is contained in:
Dag 2023-05-21 19:59:39 +02:00 committed by GitHub
parent b5dbec4cc1
commit f803ffa79a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 6 deletions

View File

@ -187,13 +187,13 @@ function defaultLinkTo($dom, $url)
// Use long method names for compatibility with simple_html_dom and DOMDocument
foreach ($dom->getElementsByTagName('img', null) as $image) {
$image->setAttribute('src', urljoin($url, $image->getAttribute('src')));
}
// foreach ($dom->getElementsByTagName('img', null) as $image) {
// $image->setAttribute('src', urljoin($url, $image->getAttribute('src')));
// }
foreach ($dom->getElementsByTagName('a', null) as $anchor) {
$anchor->setAttribute('href', urljoin($url, $anchor->getAttribute('href')));
}
// foreach ($dom->getElementsByTagName('a', null) as $anchor) {
// $anchor->setAttribute('href', urljoin($url, $anchor->getAttribute('href')));
// }
// Will never be true for DOMDocument
if ($string_convert) {