2
0
forked from Wavyzz/dolibarr

Added : url string validation

This commit is contained in:
Regis Houssin
2009-04-03 12:56:22 +00:00
parent 282871a8c4
commit 5b57c5f497

View File

@@ -2379,9 +2379,9 @@ function clean_url($url,$http=1)
}
// On passe le nom de domaine en minuscule
$CleanUrl = eregi_replace('^'.$proto.$domain, $newproto.strtolower($domain), $url);
$url = eregi_replace('^'.$proto.$domain, $newproto.strtolower($domain), $url);
return $CleanUrl;
return $url;
}
}
@@ -2400,7 +2400,6 @@ function clean_url($url,$http=1)
*/
function valid_url($url,$http=0,$pass=0,$port=0,$path=0,$query=0,$anchor=0)
{
$ValidUrl = 0;
$urlregex = '';
// SCHEME
@@ -2427,10 +2426,12 @@ function valid_url($url,$http=0,$pass=0,$port=0,$path=0,$query=0,$anchor=0)
// check
if (eregi($urlregex, $url))
{
$ValidUrl = 1;
return 1;
}
else
{
return 0;
}
return $ValidUrl;
}