mi sto accorgendo che in realtà non è fattibilissima come cosa... ora ho creato questo:
Codice PHP:
function relative_to_absolute($article,$home){
preg_match_all('/src="(.+?)"/', $article->text, $src);
preg_match_all('/href="(.+?)"/', $article->text, $href);
$urls=array_merge($src[1], $href[1]);
foreach($urls as $url){
if(!strstr($url,"http://") && !strstr($url,"https://")){
$article->text=str_replace($url,$home."/".$url,$article->text);
}
}
return $article->text;
}
echo relative_to_absolute($article,JURI::base());
ma funziona bene solo quando tutte le pagine sono richiamate dalla index