1. per-feed option STRIP_IMAGES should now also affect other media tags
2. video/audio elements were not replaced with text links properly in low bandwidth mode
This commit is contained in:
parent
62d0060aa1
commit
d2e1e60ecc
|
@ -1682,22 +1682,32 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (($owner && get_pref("STRIP_IMAGES", $owner)) ||
|
if ($entry->hasAttribute('src') &&
|
||||||
$force_remove_images || $_SESSION["bw_limit"]) {
|
($owner && get_pref("STRIP_IMAGES", $owner)) || $force_remove_images || $_SESSION["bw_limit"]) {
|
||||||
|
|
||||||
$p = $doc->createElement('p');
|
$p = $doc->createElement('p');
|
||||||
|
|
||||||
$a = $doc->createElement('a');
|
$a = $doc->createElement('a');
|
||||||
$a->setAttribute('href', $entry->getAttribute('src'));
|
$a->setAttribute('href', $entry->getAttribute('src'));
|
||||||
|
|
||||||
$a->appendChild(new DOMText($entry->getAttribute('src')));
|
$a->appendChild(new DOMText($entry->getAttribute('src')));
|
||||||
$a->setAttribute('target', '_blank');
|
$a->setAttribute('target', '_blank');
|
||||||
$a->setAttribute('rel', 'noopener noreferrer');
|
$a->setAttribute('rel', 'noopener noreferrer');
|
||||||
|
|
||||||
$p->appendChild($a);
|
$p->appendChild($a);
|
||||||
|
|
||||||
|
if ($entry->nodeName == 'source') {
|
||||||
|
|
||||||
|
if ($entry->parentNode && $entry->parentNode->parentNode)
|
||||||
|
$entry->parentNode->parentNode->replaceChild($p, $entry->parentNode);
|
||||||
|
|
||||||
|
} else if ($entry->nodeName == 'img') {
|
||||||
|
|
||||||
|
if ($entry->parentNode)
|
||||||
|
$entry->parentNode->replaceChild($p, $entry);
|
||||||
|
|
||||||
$entry->parentNode->replaceChild($p, $entry);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue