From 1cb91a9e4bdb4a024452ae3c773dcf0d8c88e074 Mon Sep 17 00:00:00 2001 From: shish Date: Mon, 19 May 2008 01:52:12 +0000 Subject: [PATCH] titled wiki links git-svn-id: file:///home/shish/svn/shimmie2/trunk@858 7f39781d-f577-437e-ae19-be835c7a54ca --- ext/bbcode/main.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ext/bbcode/main.php b/ext/bbcode/main.php index 05c365b5..b188412f 100644 --- a/ext/bbcode/main.php +++ b/ext/bbcode/main.php @@ -18,7 +18,8 @@ class BBCode extends Extension { $text = preg_replace("/>>([^\d].+)/", "
\\1
", $text); $text = preg_replace("/\[url=((?:https?|ftp|irc):\/\/.*?)\](.*?)\[\/url\]/s", "\\2", $text); $text = preg_replace("/\[url\]((?:https?|ftp|irc):\/\/.*?)\[\/url\]/s", "\\1", $text); - $text = preg_replace("/\[\[(.*?)\]\]/s", "\\1", $text); + $text = preg_replace("/\[\[([^\|\]]+)\|([^\]]+)\]\]/s", "\\2", $text); + $text = preg_replace("/\[\[([^\]]+)\]\]/s", "\\1", $text); $text = str_replace("\n", "\n
", $text); $text = preg_replace("/\[quote\](.*?)\[\/quote\]/s", "
\\1
", $text); $text = preg_replace("/\[quote=(.*?)\](.*?)\[\/quote\]/s", "Quoting \\1
\\2
", $text); @@ -44,7 +45,8 @@ class BBCode extends Extension { $text = preg_replace("/\[code\](.*?)\[\/code\]/s", "\\1", $text); $text = preg_replace("/\[url=(.*?)\](.*?)\[\/url\]/s", "\\2", $text); $text = preg_replace("/\[url\](.*?)\[\/url\]/s", "\\1", $text); - $text = preg_replace("/\[\[(.*?)\]\]/s", "\\1", $text); + $text = preg_replace("/\[\[([^\|\]]+)\|([^\]]+)\]\]/s", "\\2", $text); + $text = preg_replace("/\[\[([^\]]+)\]\]/s", "\\1", $text); $text = preg_replace("/\[quote\](.*?)\[\/quote\]/s", "", $text); $text = preg_replace("/\[quote=(.*?)\](.*?)\[\/quote\]/s", "", $text); $text = preg_replace("/\[h1\](.*?)\[\/h1\]/s", "\\1", $text);