Skip to content

Commit 938feb1

Browse files
authored
Merge pull request #74 from bkraul/develop-1.3.x
Develop 1.3.x
2 parents cb16e5f + 5ae1957 commit 938feb1

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

BBCodePlus/BBCodePlus.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ function register() {
2121
$this->name = plugin_lang_get( 'title' );
2222
$this->description = plugin_lang_get( 'description' );
2323
$this->page = 'config';
24-
$this->version = '1.3.6';
24+
$this->version = '1.3.7';
2525

2626
$this->requires['MantisCore'] = '1.3.0';
2727
# this plugin can coexist with MantisCoreFormatting.
@@ -231,8 +231,9 @@ function add_tags() {
231231
$t_extra_link_tags = 'target="_blank"';
232232
# BBCode parsers.
233233
$this->t_bbCode->addParser('link', '/\[url\](.*?)\[\/url\]/s', '<a ' . $t_extra_link_tags . ' href="$1">$1</a>', '$1');
234-
$this->t_bbCode->addParser('namedlink', '/\[url\=(.*?)(\smention)?\](.*?)\[\/url\]/s', '<a ' . $t_extra_link_tags . ' href="$1">$3</a>', '$3');
235-
$this->t_bbCode->addParser('mention', '/\[url\=([^\s]*)\ mention\](.*?)\[\/url\]/s', '<span class="mention"><a ' . $t_extra_link_tags . ' href="$1">$2</a></span>', '$2');
234+
$this->t_bbCode->addParser('namedlink', '/\[url\=([^\s]*?)\](.*?)\[\/url\]/s', '<a ' . $t_extra_link_tags . ' href="$1">$2</a>', '$2');
235+
$this->t_bbCode->addParser('mentionlink', '/\[url\=([^\s]*)\ mention\](.*?)\[\/url\]/s', '<span class="mention"><a ' . $t_extra_link_tags . ' href="$1">$2</a></span>', '$2');
236+
$this->t_bbCode->addParser('resolvedlink', '/\[url\=([^\s]*)\ resolved\](.*?)\[\/url\]/s', '<a ' . $t_extra_link_tags . ' href="$1" class="resolved">$2</a>', '$2');
236237
$this->t_bbCode->addParser('email', '/\[email\]([a-z0-9\-_\.\+]+@[a-z0-9\-]+\.[a-z0-9\-\.]+?)\[\/email\]/s', '<a ' . $t_extra_link_tags . ' href="mailto:$1">$1</a>', '$1');
237238
$this->t_bbCode->addParser('named-email', '/\[email=([a-z0-9\-_\.\+]+@[a-z0-9\-]+\.[a-z0-9\-\.]+?)\](.+?)\[\/email\]/s', '<a ' . $t_extra_link_tags . ' href="mailto:$1">$2</a>', '$2');
238239
$this->t_bbCode->addParser('color', '/\[color=([\#a-z0-9]+?)\](.*?)\[\/color\]/s', '<span class="bbcolor-$1">$2</span>', '$2');
@@ -269,6 +270,8 @@ function string_process_bbcode( $p_string, $p_multiline = TRUE ) {
269270
// convert mentions and titled links to BBCode mentions (if available).
270271
$p_string = preg_replace( '/<span class="mention"><a .*?href="(.*?)">(.*?)<\/a><\/span>/is', '[url=$1 mention]$2[/url]', $p_string);
271272
$p_string = preg_replace( '/<a href="([^"]*)" title="([^"]*)">([^"]*)<\/a>/is', '[url=$1]$3[/url]', $p_string);
273+
$p_string = preg_replace( '/<a href="([^"]*)" title="([^"]*)" class="resolved">([^"]*)<\/a>/is', '[url=$1 resolved]$3[/url]', $p_string);
274+
echo $p_string;
272275
# strip all the auto generated URLs by MantisCoreFormatting plugin to avoid mangling.
273276
if ( ON == $this->t_MantisCoreFormatting_process_urls ) {
274277
$p_string = string_strip_hrefs( $p_string );

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ If you would like to contribute to BBCode plus, please [read this guide first](h
2525

2626
## Change Log
2727

28+
### 1.3.7
29+
30+
- Corrected outstanding bug with resolved bug links.
31+
2832
### 1.3.6
2933

3034
- Corrected bug in handling of mention links.

0 commit comments

Comments
 (0)