From cb380db18d91ffd200020ce25f657408611c69e1 Mon Sep 17 00:00:00 2001 From: Regis Houssin <regis@dolibarr.fr> Date: Sat, 24 Oct 2009 05:22:40 +0000 Subject: [PATCH] Fix: bad regular expression --- htdocs/lib/functions2.lib.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/lib/functions2.lib.php b/htdocs/lib/functions2.lib.php index c22c423a5b2..7e75665302a 100644 --- a/htdocs/lib/functions2.lib.php +++ b/htdocs/lib/functions2.lib.php @@ -256,12 +256,12 @@ function isValidUrl($url,$http=0,$pass=0,$port=0,$path=0,$query=0,$anchor=0) // PATH if ($path) $urlregex .= "(\/([a-z0-9+\$_-]\.?)+)*\/"; // GET Query - if ($query) $urlregex .= "(\?[a-z+&\$_.-][a-z0-9;:@/&%=+\$_.-]*)"; + if ($query) $urlregex .= "(\?[a-z+&\$_.-][a-z0-9;:@\/&%=+\$_.-]*)"; // ANCHOR - if ($anchor) $urlregex .= "(#[a-z_.-][a-z0-9+\$_.-]*)$/i"; + if ($anchor) $urlregex .= "(#[a-z_.-][a-z0-9+\$_.-]*)$"; // check - if (preg_match('!'.$urlregex.'!', $url)) + if (preg_match('/'.$urlregex.'/i', $url)) { $ValidUrl = 1; } -- GitLab