summaryrefslogtreecommitdiffstats
path: root/system
diff options
context:
space:
mode:
authorAndrey Andreev <narf@devilix.net>2017-11-10 14:02:42 +0100
committerAndrey Andreev <narf@devilix.net>2017-11-10 14:02:42 +0100
commit8c9e51044d991868228dba8b9d5141998347dbfe (patch)
tree997b16c37e885d576734b96c7cf49c3aa4878c19 /system
parente176de516a86baef1f48f3bf9e63818985f6a034 (diff)
Fix #5331
Diffstat (limited to 'system')
-rw-r--r--system/helpers/url_helper.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/system/helpers/url_helper.php b/system/helpers/url_helper.php
index f6fb7d9eb..489f2d44e 100644
--- a/system/helpers/url_helper.php
+++ b/system/helpers/url_helper.php
@@ -393,7 +393,7 @@ if ( ! function_exists('auto_link'))
function auto_link($str, $type = 'both', $popup = FALSE)
{
// Find and replace any URLs.
- if ($type !== 'email' && preg_match_all('#(\w*://|www\.)[^\s()<>;]+\w/?#i', $str, $matches, PREG_OFFSET_CAPTURE | PREG_SET_ORDER))
+ if ($type !== 'email' && preg_match_all('#(\w*://|www\.)[a-z0-9]+(-+[a-z0-9]+)*(\.[a-z0-9]+(-+[a-z0-9]+)*)+(/([^\s()<>;]+\w)?/?)?#i', $str, $matches, PREG_OFFSET_CAPTURE | PREG_SET_ORDER))
{
// Set our target HTML if using popup links.
$target = ($popup) ? ' target="_blank"' : '';