From 5b57c5f4976acd82ffa29534d4a0cd77609d996e Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 3 Apr 2009 12:56:22 +0000 Subject: [PATCH] Added : url string validation --- htdocs/lib/functions.lib.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/htdocs/lib/functions.lib.php b/htdocs/lib/functions.lib.php index 7996ae07f31..8bed2d576a0 100644 --- a/htdocs/lib/functions.lib.php +++ b/htdocs/lib/functions.lib.php @@ -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; }