From 04f4fe0ef5e8a8ebdbf96eb8d108b9f6e550e913 Mon Sep 17 00:00:00 2001 From: bkraul Date: Sun, 9 Jun 2019 07:31:36 -0500 Subject: [PATCH] Corrected bug in mention links --- BBCodePlus/BBCodePlus.php | 6 +++--- README.md | 4 ++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/BBCodePlus/BBCodePlus.php b/BBCodePlus/BBCodePlus.php index bf2277e..353f0e0 100644 --- a/BBCodePlus/BBCodePlus.php +++ b/BBCodePlus/BBCodePlus.php @@ -21,7 +21,7 @@ function register() { $this->name = plugin_lang_get( 'title' ); $this->description = plugin_lang_get( 'description' ); $this->page = 'config'; - $this->version = '1.3.5'; + $this->version = '1.3.6'; $this->requires['MantisCore'] = '1.3.0'; # this plugin can coexist with MantisCoreFormatting. @@ -231,8 +231,8 @@ function add_tags() { $t_extra_link_tags = 'target="_blank"'; # BBCode parsers. $this->t_bbCode->addParser('link', '/\[url\](.*?)\[\/url\]/s', '$1', '$1'); - $this->t_bbCode->addParser('namedlink', '/\[url\=(.*?)\](.*?)\[\/url\]/s', '$2', '$2'); - $this->t_bbCode->addParser('mention', '/\[url\=(.*?)\ mention](.*?)\[\/url\]/s', '$2', '$2'); + $this->t_bbCode->addParser('namedlink', '/\[url\=(.*?)(\smention)?\](.*?)\[\/url\]/s', '$3', '$3'); + $this->t_bbCode->addParser('mention', '/\[url\=([^\s]*)\ mention\](.*?)\[\/url\]/s', '$2', '$2'); $this->t_bbCode->addParser('email', '/\[email\]([a-z0-9\-_\.\+]+@[a-z0-9\-]+\.[a-z0-9\-\.]+?)\[\/email\]/s', '$1', '$1'); $this->t_bbCode->addParser('named-email', '/\[email=([a-z0-9\-_\.\+]+@[a-z0-9\-]+\.[a-z0-9\-\.]+?)\](.+?)\[\/email\]/s', '$2', '$2'); $this->t_bbCode->addParser('color', '/\[color=([\#a-z0-9]+?)\](.*?)\[\/color\]/s', '$2', '$2'); diff --git a/README.md b/README.md index 68aecf9..3804b92 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,10 @@ If you would like to contribute to BBCode plus, please [read this guide first](h ## Change Log +### 1.3.6 + +- Corrected bug in handling of mention links. + ### 1.3.5 - Corrected use of `$this` inside code replace callback (causes issues with older versions of PHP).