From 58678ff21c9fefd8eed11ad7cd0bbdb1254e49e7 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Sun, 13 Mar 2016 12:20:09 +0100 Subject: [PATCH 1/3] [ticket/14527] Retrieve link URL from href and not link text PHPBB3-14527 --- phpBB/includes/functions.php | 2 +- phpBB/includes/functions_content.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index be51a7342d..d984f41b08 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -2745,7 +2745,7 @@ function get_preg_expression($mode) return array( '#.*?#', '#.*?#', - '#(.*?)#', + '#.*?#', '#www.phpbb.com', - 'www.phpbb.com' + 'http://www.phpbb.com' ), array( 'http://www.phpbb.com', 'http://www.phpbb.com' ), + array( + 'this is just text', + 'http://www.phpbb.com' + ), + array( + 'http://www.phpbb.com/some/ ... /shortened', + 'http://www.phpbb.com/some/more/link/that/is/shortened' + ), /** * Fails as per PHPBB3-8420 * @link http://tracker.phpbb.com/browse/PHPBB3-8420 From 17b8e93a5350e297f9be0925120f0b6cf34f5ffe Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Sun, 13 Mar 2016 14:48:21 +0100 Subject: [PATCH 3/3] [ticket/14527] Decode automatically generated postlink without prefix The http prefix gets automatically added and should be removed prior to outputting the post to the user. PHPBB3-14527 --- phpBB/includes/functions.php | 1 + phpBB/includes/functions_content.php | 2 +- tests/text_processing/decode_message_test.php | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index d984f41b08..8d727fb414 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -2745,6 +2745,7 @@ function get_preg_expression($mode) return array( '#.*?#', '#.*?#', + '#\2#', '#.*?#', '#www.phpbb.com', - 'http://www.phpbb.com' + 'www.phpbb.com' ), array( 'http://www.phpbb.com',