From 1ac426c97e6b117e9507ad5effbf7ec62590930e Mon Sep 17 00:00:00 2001 From: Antonio Gallo Date: Thu, 27 Sep 2012 20:47:44 +0000 Subject: improved the regular expression to find the URLs - lammi87 issue --- h-source/Application/Controllers/UsersController.php | 2 +- h-source/Application/Include/wikiFormatting.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'h-source') diff --git a/h-source/Application/Controllers/UsersController.php b/h-source/Application/Controllers/UsersController.php index b641899..ea94ffb 100644 --- a/h-source/Application/Controllers/UsersController.php +++ b/h-source/Application/Controllers/UsersController.php @@ -97,7 +97,7 @@ class UsersController extends BaseController if ($res === 'not-logged') { - $data['notice'] = "
You can't logout because you are not logged..
\n"; + $data['notice'] = "
You can't logout because you are not logged...
\n"; } else if ($res === 'was-logged') { diff --git a/h-source/Application/Include/wikiFormatting.php b/h-source/Application/Include/wikiFormatting.php index 0c599f5..2a8ba21 100644 --- a/h-source/Application/Include/wikiFormatting.php +++ b/h-source/Application/Include/wikiFormatting.php @@ -133,7 +133,7 @@ class Tabs function checkUrl($url) { - $match = '/^http(s)?\:\/\/(www\.)?[a-zA-Z0-9\-\_]+(\.[a-zA-Z0-9\-\_]+)*\.([a-z]{2,4})((\/[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\-\_]+)*\.([a-z]{2,4})((\/[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