r14635 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r14634‎ | r14635 | r14636 >
Date:09:18, 7 June 2006
Author:brion
Status:old
Tags:
Comment:
* (bug 6230) Regression fix: <nowiki> in [URL link text]
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/Parser.php (modified) (history)
  • /trunk/phase3/maintenance/parserTests.txt (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/parserTests.txt
@@ -157,6 +157,7 @@
158158
159159 !! end
160160
 161+
161162 ###
162163 ### Comments
163164 ###
@@ -544,6 +545,26 @@
545546 !!end
546547
547548 !! test
 549+External links: nowiki in URL link text (bug 6230)
 550+!!input
 551+[http://example.com/ <nowiki>''example site''</nowiki>]
 552+!! result
 553+<p><a href="http://example.com/" class='external text' title="http://example.com/" rel="nofollow">''example site''</a>
 554+</p>
 555+!! end
 556+
 557+!! test
 558+External links: newline forbidden in text (bug 6230 regression check)
 559+!! input
 560+[http://example.com/ first
 561+second]
 562+!! result
 563+<p>[<a href="http://example.com/" class='external free' title="http://example.com/" rel="nofollow">http://example.com/</a> first
 564+second]
 565+</p>
 566+!!end
 567+
 568+!! test
548569 External image
549570 !! input
550571 External image: http://meta.wikimedia.org/upload/f/f1/Ncwikicol.png
Index: trunk/phase3/includes/Parser.php
@@ -47,11 +47,12 @@
4848 define( 'HTTP_PROTOCOLS', 'http:\/\/|https:\/\/' );
4949 # Everything except bracket, space, or control characters
5050 define( 'EXT_LINK_URL_CLASS', '[^][<>"\\x00-\\x20\\x7F]' );
51 -# Including space
52 -define( 'EXT_LINK_TEXT_CLASS', '[^\]\\x00-\\x1F\\x7F]' );
 51+# Including space, but excluding newlines
 52+define( 'EXT_LINK_TEXT_CLASS', '[^\]\\x0a\\x0d]' );
5353 define( 'EXT_IMAGE_FNAME_CLASS', '[A-Za-z0-9_.,~%\\-+&;#*?!=()@\\x80-\\xFF]' );
5454 define( 'EXT_IMAGE_EXTENSIONS', 'gif|png|jpg|jpeg' );
55 -define( 'EXT_LINK_BRACKETED', '/\[(\b(' . wfUrlProtocols() . ')'.EXT_LINK_URL_CLASS.'+) *('.EXT_LINK_TEXT_CLASS.'*?)\]/S' );
 55+define( 'EXT_LINK_BRACKETED', '/\[(\b(' . wfUrlProtocols() . ')'.
 56+ EXT_LINK_URL_CLASS.'+) *('.EXT_LINK_TEXT_CLASS.'*?)\]/S' );
5657 define( 'EXT_IMAGE_REGEX',
5758 '/^('.HTTP_PROTOCOLS.')'. # Protocol
5859 '('.EXT_LINK_URL_CLASS.'+)\\/'. # Hostname and path
Index: trunk/phase3/RELEASE-NOTES
@@ -456,6 +456,7 @@
457457 doesn't forbid access.
458458 * Regression fix: suppress warning about session failure when clicking to
459459 edit with 'preview on first edit' enabled.
 460+* (bug 6230) Regression fix: <nowiki> in [URL link text]
460461
461462
462463 == Compatibility ==

Follow-up revisions

RevisionCommit summaryAuthorDate
r65967Recovered parser test whose content got broken in r12975, functionality broke...platonides21:58, 5 May 2010

Status & tagging log