* (bug 6230) Regression fix: <nowiki> in [URL link text]
authorBrion Vibber <brion@users.mediawiki.org>
Wed, 7 Jun 2006 09:18:34 +0000 (09:18 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Wed, 7 Jun 2006 09:18:34 +0000 (09:18 +0000)
RELEASE-NOTES
includes/Parser.php
maintenance/parserTests.txt

index 9ad6b40..6d52960 100644 (file)
@@ -456,6 +456,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
   doesn't forbid access.
 * Regression fix: suppress warning about session failure when clicking to
   edit with 'preview on first edit' enabled.
+* (bug 6230) Regression fix: <nowiki> in [URL link text]
 
 
 == Compatibility ==
index d1f48cf..fdaeebd 100644 (file)
@@ -47,11 +47,12 @@ define( 'STRIP_COMMENTS', 'HTMLCommentStrip' );
 define( 'HTTP_PROTOCOLS', 'http:\/\/|https:\/\/' );
 # Everything except bracket, space, or control characters
 define( 'EXT_LINK_URL_CLASS', '[^][<>"\\x00-\\x20\\x7F]' );
-# Including space
-define( 'EXT_LINK_TEXT_CLASS', '[^\]\\x00-\\x1F\\x7F]' );
+# Including space, but excluding newlines
+define( 'EXT_LINK_TEXT_CLASS', '[^\]\\x0a\\x0d]' );
 define( 'EXT_IMAGE_FNAME_CLASS', '[A-Za-z0-9_.,~%\\-+&;#*?!=()@\\x80-\\xFF]' );
 define( 'EXT_IMAGE_EXTENSIONS', 'gif|png|jpg|jpeg' );
-define( 'EXT_LINK_BRACKETED',  '/\[(\b(' . wfUrlProtocols() . ')'.EXT_LINK_URL_CLASS.'+) *('.EXT_LINK_TEXT_CLASS.'*?)\]/S' );
+define( 'EXT_LINK_BRACKETED',  '/\[(\b(' . wfUrlProtocols() . ')'.
+       EXT_LINK_URL_CLASS.'+) *('.EXT_LINK_TEXT_CLASS.'*?)\]/S' );
 define( 'EXT_IMAGE_REGEX',
        '/^('.HTTP_PROTOCOLS.')'.  # Protocol
        '('.EXT_LINK_URL_CLASS.'+)\\/'.  # Hostname and path
index ceaf0f5..9041561 100644 (file)
@@ -157,6 +157,7 @@ nowiki 3
 
 !! end
 
+
 ###
 ### Comments
 ###
@@ -543,6 +544,26 @@ External links: open square bracket forbidden in URL (named) (bug 4377)
 </p>
 !!end
 
+!! test
+External links: nowiki in URL link text (bug 6230)
+!!input
+[http://example.com/ <nowiki>''example site''</nowiki>]
+!! result
+<p><a href="http://example.com/" class='external text' title="http://example.com/" rel="nofollow">''example site''</a>
+</p>
+!! end
+
+!! test
+External links: newline forbidden in text (bug 6230 regression check)
+!! input
+[http://example.com/ first
+second]
+!! result
+<p>[<a href="http://example.com/" class='external free' title="http://example.com/" rel="nofollow">http://example.com/</a> first
+second]
+</p>
+!!end
+
 !! test
 External image
 !! input