mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-07-24 20:55:11 +02:00
parent
096c3bca73
commit
cfe81ab2ac
1 changed files with 10 additions and 4 deletions
14
lib/html.php
14
lib/html.php
|
@ -187,12 +187,18 @@ function defaultLinkTo($dom, $url)
|
||||||
|
|
||||||
// Use long method names for compatibility with simple_html_dom and DOMDocument
|
// Use long method names for compatibility with simple_html_dom and DOMDocument
|
||||||
|
|
||||||
foreach ($dom->getElementsByTagName('img') as $image) {
|
$images = $dom->getElementsByTagName('img');
|
||||||
$image->setAttribute('src', urljoin($url, $image->getAttribute('src')));
|
if (is_array($images)) {
|
||||||
|
foreach ($images as $image) {
|
||||||
|
$image->setAttribute('src', urljoin($url, $image->getAttribute('src')));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($dom->getElementsByTagName('a') as $anchor) {
|
$anchors = $dom->getElementsByTagName('a');
|
||||||
$anchor->setAttribute('href', urljoin($url, $anchor->getAttribute('href')));
|
if (is_array($anchors)) {
|
||||||
|
foreach ($anchors as $anchor) {
|
||||||
|
$anchor->setAttribute('href', urljoin($url, $anchor->getAttribute('href')));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Will never be true for DOMDocument
|
// Will never be true for DOMDocument
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue