aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/functions_content.php
diff options
context:
space:
mode:
authorDhruv Goel <dhruv.goel92@gmail.com>2014-06-17 14:56:55 +0530
committerDhruv Goel <dhruv.goel92@gmail.com>2014-06-17 14:56:55 +0530
commit7ee3e3f73f2d602fd9eb0b67435aecb553c4b24d (patch)
treeef8e88ccfa6ffd731850186288f6e99e362d89b9 /phpBB/includes/functions_content.php
parent89af1150718a184249d8040637969b03a3003596 (diff)
parentf1adf82aeac76601bcf0a32e8be0298624520b35 (diff)
downloadforums-7ee3e3f73f2d602fd9eb0b67435aecb553c4b24d.tar
forums-7ee3e3f73f2d602fd9eb0b67435aecb553c4b24d.tar.gz
forums-7ee3e3f73f2d602fd9eb0b67435aecb553c4b24d.tar.bz2
forums-7ee3e3f73f2d602fd9eb0b67435aecb553c4b24d.tar.xz
forums-7ee3e3f73f2d602fd9eb0b67435aecb553c4b24d.zip
Merge pull request #2588 from nickvergessen/ticket/12705
Ticket/12705 Fix make_clickable when called with different server_urls
Diffstat (limited to 'phpBB/includes/functions_content.php')
-rw-r--r--phpBB/includes/functions_content.php17
1 files changed, 10 insertions, 7 deletions
diff --git a/phpBB/includes/functions_content.php b/phpBB/includes/functions_content.php
index 72fca905e0..74b3e0c70f 100644
--- a/phpBB/includes/functions_content.php
+++ b/phpBB/includes/functions_content.php
@@ -773,44 +773,47 @@ function make_clickable($text, $server_url = false, $class = 'postlink')
static $static_class;
static $magic_url_match_args;
- if (!is_array($magic_url_match_args) || $static_class != $class)
+ if (!isset($magic_url_match_args[$server_url]) || $static_class != $class)
{
$static_class = $class;
$class = ($static_class) ? ' class="' . $static_class . '"' : '';
$local_class = ($static_class) ? ' class="' . $static_class . '-local"' : '';
- $magic_url_match_args = array();
+ if (!is_array($magic_url_match_args))
+ {
+ $magic_url_match_args = array();
+ }
// relative urls for this board
- $magic_url_match_args[] = array(
+ $magic_url_match_args[$server_url][] = array(
'#(^|[\n\t (>.])(' . preg_quote($server_url, '#') . ')/(' . get_preg_expression('relative_url_inline') . ')#i',
MAGIC_URL_LOCAL,
$local_class,
);
// matches a xxxx://aaaaa.bbb.cccc. ...
- $magic_url_match_args[] = array(
+ $magic_url_match_args[$server_url][] = array(
'#(^|[\n\t (>.])(' . get_preg_expression('url_inline') . ')#i',
MAGIC_URL_FULL,
$class,
);
// matches a "www.xxxx.yyyy[/zzzz]" kinda lazy URL thing
- $magic_url_match_args[] = array(
+ $magic_url_match_args[$server_url][] = array(
'#(^|[\n\t (>])(' . get_preg_expression('www_url_inline') . ')#i',
MAGIC_URL_WWW,
$class,
);
// matches an email@domain type address at the start of a line, or after a space or after what might be a BBCode.
- $magic_url_match_args[] = array(
+ $magic_url_match_args[$server_url][] = array(
'/(^|[\n\t (>])(' . get_preg_expression('email') . ')/i',
MAGIC_URL_EMAIL,
'',
);
}
- foreach ($magic_url_match_args as $magic_args)
+ foreach ($magic_url_match_args[$server_url] as $magic_args)
{
if (preg_match($magic_args[0], $text, $matches))
{