', $pos1);
if ($pos2 == false) {
break;
}
$pos2 += 4;
if (substr_count($contenu, $discriminant, $pos1, $pos2 - $pos1) > 0) {
$pos3 = strpos($contenu, '>', $pos1) + 1;
if ($pos3 == $pos2 - 1) {
$pos1 = $pos2;
continue;
}
$rep = strip_tags(substr($contenu, $pos3, $pos2 - $pos3 - 4));
$contenu = substr_replace($contenu, $rep, $pos1, $pos2 - $pos1);
$pos1 += strlen($rep);
} else {
$pos1 = $pos2;
}
}
return $contenu;
}
function bdf_loadpage($url)
{
FB::log($url, 'url');
$page = getUrl($url, '', '', '', false, '', '',15);
//Fichier non disponible
if($page['code']==408 || $page['code']==400){
$output = false;
//Ecriture du fichier sur le serveur en local
}else{
$body = $page['body'];
$output = $body;
}
$output = utf8_encode($output);
//file_put_contents(PATH_SITE.'/cache/bdf/test.html', $output);
$output = preg_replace('/(.*)\]*?>.*?'.$balise.'>@si',
'',
$content
);
else
$output = preg_replace(
array('@<'.$balise.'[^>]*?>@', '@'.$balise.'>@'),
'',
$content
);
}
else
{
$output = preg_replace(
'@<'.$balise.'[^>]*?>@',
'',
$content
);
}
return $output;
}
function changeLinkToLowerCase($content)
{
global $firephp;
//$pattern = "/\< *[img][^\>]*[href] *= *[\"\']{0,1}([^\"\'\ >]*)/i";
$pattern = '/(\].*?>)/ie';
$replace = "strtolower('\\1')";
$content = preg_replace($pattern,$replace,$content);
$pattern = '/(\