From 0d8e43d9686f73ce1b7ace93f39aabf251b873a9 Mon Sep 17 00:00:00 2001 From: Antonio Gallo Date: Fri, 9 Sep 2011 16:32:53 +0000 Subject: improved the function to detect URLs --- h-source/Application/Include/myFunctions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'h-source') diff --git a/h-source/Application/Include/myFunctions.php b/h-source/Application/Include/myFunctions.php index 5a59d0b..855af01 100644 --- a/h-source/Application/Include/myFunctions.php +++ b/h-source/Application/Include/myFunctions.php @@ -319,7 +319,7 @@ function checkUrl($url) { // $match = '/^http\:\/\/(www\.)?[a-zA-Z0-9\-\_]+(\.[a-zA-Z0-9\-\_]+)?\.(com|net|it|info|org|eu|uk)((\/[a-zA-Z0-9\_\-\+]+)+[\/]?)?(\?([a-zA-Z0-9\_\-\+\s]+\=[a-zA-Z0-9\_\-\s\+\&]+)+)?(#[a-zA-Z0-9\_\-\+\s]+)?([\s]*)?$/'; - $match = '/^http(s)?\:\/\/(www\.)?[a-zA-Z0-9\-\_]+(\.[a-zA-Z0-9\-\_]+)?\.(com|net|it|info|org|eu|uk|ca|us|cl)((\/[a-zA-Z0-9\_\-\+]+)*(\/([a-zA-Z0-9\_\-\.\+]+\.(php|html|htm|asp|aspx|jsp|cgi))?)?)?(\?([a-zA-Z0-9\_\-\+\s]+\=[a-zA-Z0-9\_\-\s\+\&]+)+)?(#[a-zA-Z0-9\_\-\+\s]+)?([\s]*)?$/'; + $match = '/^http(s)?\:\/\/(www\.)?[a-zA-Z0-9\-\_]+(\.[a-zA-Z0-9\-\_]+)*\.(com|net|it|info|org|eu|uk|ca|us|cl)((\/[a-zA-Z0-9\_\-\:\+]+)*(\/([a-zA-Z0-9\_\:\-\.\+]+\.(php|html|htm|asp|aspx|jsp|cgi))?)?)?(\?([a-zA-Z0-9\_\-\+\s]+\=[a-zA-Z0-9\_\-\s\+\&]+)+)?(#[a-zA-Z0-9\_\-\+\s]+)?([\s]*)?$/'; if (preg_match($match,$url)) { -- cgit v1.2.3