Fixed a rather major bug with the external link parser: two links in one line now handled gracefully.
authorDan Fuhry <dan@enanocms.org>
Tue, 12 Oct 2010 23:07:27 -0400
changeset 1306 e00489a30c72
parent 1305 ba8a648baebc
child 1307 5d9f6ecf748e
Fixed a rather major bug with the external link parser: two links in one line now handled gracefully.
includes/wikiengine/parse_mediawiki.php
includes/wikiformat.php
--- a/includes/wikiengine/parse_mediawiki.php	Fri Sep 24 21:50:25 2010 -0400
+++ b/includes/wikiengine/parse_mediawiki.php	Tue Oct 12 23:07:27 2010 -0400
@@ -17,8 +17,8 @@
 		'bold'   => "/'''(.+?)'''/",
 		'italic' => "/''(.+?)''/",
 		'underline' => '/__(.+?)__/',
-		'externalwithtext' => '#\[((?:https?|irc|ftp)://.+?) (.+?)\]#',
-		'externalnotext' => '#\[((?:https?|irc|ftp)://.+?)\]#',
+		'externalwithtext' => '#\[((?:https?|irc|ftp)://[^ ]+?) (.+?)\]#',
+		'externalnotext' => '#\[((?:https?|irc|ftp)://[^ ]+?)\]#',
 		'mailtonotext' => '#\[mailto:([^ \]]+?)\]#',
 		'mailtowithtext' => '#\[mailto:([^ \]]+?) (.+?)\]#',
 		'hr' => '/^[-]{4,} *$/m',
--- a/includes/wikiformat.php	Fri Sep 24 21:50:25 2010 -0400
+++ b/includes/wikiformat.php	Tue Oct 12 23:07:27 2010 -0400
@@ -70,8 +70,8 @@
 			'italic',
 			'underline',
 			'image',
+			'externalnotext',
 			'externalwithtext',
-			'externalnotext',
 			'mailtowithtext',
 			'mailtonotext',
 			'internallink',