From 1fb5dac1bca30cc8fb228e832f4dfe0ee4c41ff4 Mon Sep 17 00:00:00 2001 From: Gerhard Schlager Date: Sun, 5 Feb 2017 17:13:31 +0100 Subject: [PATCH] phpBB3 importer: Fix the link regex Thanks to Leo Davidson for the improved regex. https://meta.discourse.org/t/importing-from-phpbb3/30810/153 --- script/import_scripts/phpbb3/support/text_processor.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/import_scripts/phpbb3/support/text_processor.rb b/script/import_scripts/phpbb3/support/text_processor.rb index bcdb770fb2..3eceff3f75 100644 --- a/script/import_scripts/phpbb3/support/text_processor.rb +++ b/script/import_scripts/phpbb3/support/text_processor.rb @@ -137,7 +137,7 @@ module ImportScripts::PhpBB3 def create_internal_link_regexps(original_site_prefix) host = original_site_prefix.gsub('.', '\.') - link_regex = "http(?:s)?://#{host}/viewtopic\\.php\\?(?:\\S*)(?:t=(\\d+)|p=(\\d+)(?:#p\\d+)?)(?:\\S*)" + link_regex = "http(?:s)?://#{host}/viewtopic\\.php\\?(?:\\S*)(?:t=(\\d+)|p=(\\d+)(?:#p\\d+)?)(?:[^\\s\\)\\]]*)" @long_internal_link_regexp = Regexp.new(%Q||, Regexp::IGNORECASE) @short_internal_link_regexp = Regexp.new(link_regex, Regexp::IGNORECASE)