fix of issue #677: When downloading images, wallabag doesnt respect html "base" tag, tnx to @fivefilters

This commit is contained in:
Maryana Rozhankivska
2014-06-25 20:00:00 +03:00
parent aa126ba458
commit 6924253423
2 changed files with 15 additions and 1 deletions

View File

@ -377,3 +377,13 @@ function debug($msg) {
flush();
}
}
function get_base_url($dom) {
$xpath = new DOMXPath($dom);
$base_url = @$xpath->evaluate('string(//head/base/@href)', $dom);
if ($base_url !== '') {
return $base_url;
} else {
return false;
}
}