From efe06af91327e0eb30b98b6c848d72c66774c0e9 Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Sat, 22 Nov 2008 23:25:57 +0000 Subject: - merge r9084 and r9085 - added tests for make_clickable git-svn-id: file:///svn/phpbb/trunk@9086 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions_content.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'phpBB') diff --git a/phpBB/includes/functions_content.php b/phpBB/includes/functions_content.php index 3a8c53f365..abf566be91 100644 --- a/phpBB/includes/functions_content.php +++ b/phpBB/includes/functions_content.php @@ -496,7 +496,8 @@ function generate_text_for_edit($text, $uid, $flags) */ function make_clickable_callback($type, $whitespace, $url, $relative_url, $class) { - $orig_url = $url . $relative_url; + $orig_url = $url; + $orig_relative = $relative_url; $append = ''; $url = htmlspecialchars_decode($url); $relative_url = htmlspecialchars_decode($relative_url); @@ -561,6 +562,12 @@ function make_clickable_callback($type, $whitespace, $url, $relative_url, $class $url = substr($url, 0, -1); } break; + + // set last_char to empty here, so the variable can be used later to + // check whether a character was removed + default: + $last_char = ''; + break; } $short_url = (strlen($url) > 55) ? substr($url, 0, 39) . ' ... ' . substr($url, -10) : $url; @@ -578,7 +585,7 @@ function make_clickable_callback($type, $whitespace, $url, $relative_url, $class // don't touch it and let MAGIC_URL_FULL take care of it. if (!$relative_url) { - return $whitespace . $orig_url . '/'; // slash is taken away by relative url pattern + return $whitespace . $orig_url . '/' . $orig_relative; // slash is taken away by relative url pattern } break; -- cgit v1.2.1