Commit 03fa59b0 authored by Cerdic's avatar Cerdic

filtrage des urls avec un protocole dont on ne veux pas et retour sous forme de tableau

parent b02b02f3
......@@ -59,7 +59,12 @@ function offline_url_relative($url) {
*/
function offline_url_normalise($url, $url_base = '') {
$url = trim($url);
if (strncmp($url,'data:', 5) === 0) {
if (strpos($url, ':') !== false
and preg_match(',^\w+:,', $url, $m)
and !in_array($m[0],array('http:', 'https:'))){
return '';
}
if (strpos($url, "spip.php?action=cron") !== false) {
return '';
}
if(strpos($url,'&') !== false) {
......@@ -530,8 +535,7 @@ function offline_build_urls_objet($objet, $id_objet, $force_refresh=false, $time
}
@unlink($file_urls_load_progress);
$urls_to_load = implode("\n", $urls_to_load);
ecrire_fichier($file_urls_load, $urls_to_load);
ecrire_fichier($file_urls_load, implode("\n", $urls_to_load));
return $urls_to_load;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment