forked from friendica/friendica-addons
attempt to handle one error
This commit is contained in:
parent
8a5944e2b3
commit
0a0709674b
1 changed files with 3 additions and 0 deletions
|
@ -639,6 +639,9 @@ function retriever_extract($doc, $retriever) {
|
||||||
*/
|
*/
|
||||||
function retriever_globalise_urls($doc, $resource) {
|
function retriever_globalise_urls($doc, $resource) {
|
||||||
$components = parse_url($resource['redirect-url']);
|
$components = parse_url($resource['redirect-url']);
|
||||||
|
if (!array_key_exists('scheme', $components) || !array_key_exists('host', $components) || !array_key_exists('path', $components)) {
|
||||||
|
return $doc;
|
||||||
|
}
|
||||||
$rooturl = $components['scheme'] . "://" . $components['host'];
|
$rooturl = $components['scheme'] . "://" . $components['host'];
|
||||||
$dirurl = $rooturl . dirname($components['path']) . "/";
|
$dirurl = $rooturl . dirname($components['path']) . "/";
|
||||||
$params = array('$dirurl' => $dirurl, '$rooturl' => $rooturl);
|
$params = array('$dirurl' => $dirurl, '$rooturl' => $rooturl);
|
||||||
|
|
Loading…
Reference in a new issue