1
0
Fork 0
forked from blallo/rss-bridge

[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:
logmanoriginal 2016-08-04 12:34:19 +02:00
parent 0cb66e2194
commit d6ff40c527

View file

@ -18,6 +18,12 @@ class ReporterreBridge extends BridgeAbstract{
}
$html2->clear();
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;
}