Added : url string validation
This commit is contained in:
parent
282871a8c4
commit
5b57c5f497
@ -2379,9 +2379,9 @@ function clean_url($url,$http=1)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// On passe le nom de domaine en minuscule
|
// 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)
|
function valid_url($url,$http=0,$pass=0,$port=0,$path=0,$query=0,$anchor=0)
|
||||||
{
|
{
|
||||||
$ValidUrl = 0;
|
|
||||||
$urlregex = '';
|
$urlregex = '';
|
||||||
|
|
||||||
// SCHEME
|
// SCHEME
|
||||||
@ -2427,10 +2426,12 @@ function valid_url($url,$http=0,$pass=0,$port=0,$path=0,$query=0,$anchor=0)
|
|||||||
// check
|
// check
|
||||||
if (eregi($urlregex, $url))
|
if (eregi($urlregex, $url))
|
||||||
{
|
{
|
||||||
$ValidUrl = 1;
|
return 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $ValidUrl;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user