diff options
author | Joas Schilling <nickvergessen@gmx.de> | 2014-06-14 11:35:27 +0200 |
---|---|---|
committer | Joas Schilling <nickvergessen@gmx.de> | 2014-06-14 11:35:27 +0200 |
commit | f1adf82aeac76601bcf0a32e8be0298624520b35 (patch) | |
tree | 87cec451b7351754e6741ef148fc2dd414fbabee /phpBB/includes | |
parent | 828e995f032d631ba9f8176524c4d3ff2e5c8ee7 (diff) | |
download | forums-f1adf82aeac76601bcf0a32e8be0298624520b35.tar forums-f1adf82aeac76601bcf0a32e8be0298624520b35.tar.gz forums-f1adf82aeac76601bcf0a32e8be0298624520b35.tar.bz2 forums-f1adf82aeac76601bcf0a32e8be0298624520b35.tar.xz forums-f1adf82aeac76601bcf0a32e8be0298624520b35.zip |
[ticket/12705] Store the regular expression matches based on server_url
PHPBB3-12705
Diffstat (limited to 'phpBB/includes')
-rw-r--r-- | phpBB/includes/functions_content.php | 17 |
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)) { |