Skip to content

Commit e6da64e

Browse files
authored
Merge pull request #78 from FSD-Christian-ISS/bugfix-clickable-links
added clickable links when url-string is entered
2 parents 1c581ae + f9f33c9 commit e6da64e

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

BBCodePlus/BBCodePlus.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,12 @@ function string_process_bbcode( $p_string, $p_multiline = TRUE ) {
298298
if ( ON == $this->t_MantisCoreFormatting_process_urls ) {
299299
$p_string = string_strip_hrefs( $p_string );
300300
}
301+
302+
# convert url-strings into links
303+
$p_string = preg_replace( "/^((http|https|ftp|file):\/\/[a-z0-9;\/\?:@=\&\$\-_\.\+!*'\(\),~%#\|]+)/i", "[url]$1[/url]", $p_string );
304+
$p_string = preg_replace( "/([^='\"(\[url\]|\[img\])])((http|https|ftp|file):\/\/[a-z0-9;\/\?:@=\&\$\-_\.\+!*'\(\),~%#\|]+)/i", "$1[url]$2[/url]", $p_string );
305+
306+
301307
# if mantis core formatting plugin process text feature is off, we need to sanitize the html,
302308
# for safety. this is the only functionality we will support when the MantisCoreFormatting plugin is
303309
# not enabled or when the text processing is disabled.

0 commit comments

Comments
 (0)