diff --git a/BBCodePlus/BBCodePlus.php b/BBCodePlus/BBCodePlus.php
index 20ca60b..51417af 100644
--- a/BBCodePlus/BBCodePlus.php
+++ b/BBCodePlus/BBCodePlus.php
@@ -22,7 +22,7 @@ function register() {
$this->name = plugin_lang_get( 'title' );
$this->description = plugin_lang_get( 'description' );
$this->page = 'config';
- $this->version = '2.1.4';
+ $this->version = '2.1.6';
$this->requires['MantisCore'] = '2.0.0';
# this plugin can coexist with MantisCoreFormatting.
@@ -254,8 +254,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 9fe8849..5da1f79 100644
--- a/README.md
+++ b/README.md
@@ -26,6 +26,10 @@ If you would like to contribute to BBCode plus, please [read this guide first](h
## Change Log
+### 2.1.6
+
+- Corrected bug in handling of mention links.
+
### 2.1.5
- Corrected use of `$this` inside code replace callback (causes issues with older versions of PHP).