2
0
forked from Wavyzz/dolibarr

Fix: useing "preg_quote" is more simpler

This commit is contained in:
Regis Houssin
2009-10-23 15:26:45 +00:00
parent b980adc4ee
commit 81464c0cf5
10 changed files with 19 additions and 30 deletions

View File

@@ -300,12 +300,9 @@ function clean_url($url,$http=1)
$newproto = '';
}
}
// Add backslashes for regular expression
$proto = str_replace('/','\/',$proto);
// On passe le nom de domaine en minuscule
$CleanUrl = preg_replace('/^'.$proto.$domain.'/i', $newproto.strtolower($domain), $url);
$CleanUrl = preg_replace('/^'.preg_quote($proto.$domain,'/').'/i', $newproto.strtolower($domain), $url);
return $CleanUrl;
}