[Reporterre] Replace relative image paths with absolute URL
Images from their own servers are linked relatively via 'local/...' we must replace this for images to point to the correct destination. Also use strip_tags to get rid of iframes
This commit is contained in:
parent
0cb66e2194
commit
d6ff40c527
1 changed files with 6 additions and 0 deletions
|
@ -18,6 +18,12 @@ class ReporterreBridge extends BridgeAbstract{
|
||||||
}
|
}
|
||||||
$html2->clear();
|
$html2->clear();
|
||||||
unset ($html2);
|
unset ($html2);
|
||||||
|
|
||||||
|
// Replace all relative urls with absolute ones
|
||||||
|
$text = preg_replace('/(href|src)(\=[\"\'])(?!http)([^"\']+)/ims', "$1$2" . $this->getURI() . "$3", $text);
|
||||||
|
|
||||||
|
$text = strip_tags($text, '<p><br><a><img>');
|
||||||
|
|
||||||
return $text;
|
return $text;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue