r17481 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r17480‎ | r17481 | r17482 >
Date:06:03, 8 November 2006
Author:nickj
Status:old
Tags:
Comment:
Fix parserTests regression introduced in r17479.

Example of failing test:
----------------------
Running test Magic links: RFC (bug 479)... FAILED!
--- /tmp/mwParser-1109840392-expected 2006-11-08 05:39:04.000000000 +0000
+++ /tmp/mwParser-1109840392-actual 2006-11-08 05:39:04.000000000 +0000
@@ -1,2 +1,2 @@
-<p><a href="http://www.ietf.org/rfc/rfc822.txt&quot; class="external" title="http://www.ietf.org/rfc/rfc822.txt&quot;&gt;RFC 822</a>
+<p><a href="http://www.ietf.org/rfc/rfc822.txt&quot; class="external " title="http://www.ietf.org/rfc/rfc822.txt&quot; rel="nofollow">RFC 822</a>
</p>
----------------------

Also applied to the "BUG 1887: A RFC with a thumbnail" and "RFC code coverage" tests.
Modified paths:
  • /trunk/phase3/includes/Linker.php (modified) (history)
  • /trunk/phase3/includes/Parser.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Linker.php
@@ -29,7 +29,7 @@
3030 * @todo document
3131 * @static
3232 */
33 - protected static function getExternalLinkAttributes( $link, $text, $class='' ) {
 33+ public static function getExternalLinkAttributes( $link, $text, $class='' ) {
3434 $link = htmlspecialchars( $link );
3535
3636 $r = ($class != '') ? " class=\"$class\"" : " class=\"external\"";
Index: trunk/phase3/includes/Parser.php
@@ -1038,7 +1038,8 @@
10391039 }
10401040
10411041 $url = wfMsg( $urlmsg, $id );
1042 - $text = Linker::makeExternalLink( $url, "$keyword $id" );
 1042+ $la = Linker::getExternalLinkAttributes( $url, "$keyword $id" );
 1043+ $text = "<a href=\"{$url}\"{$la}>{$keyword} {$id}</a>";
10431044 }
10441045 return $text;
10451046 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r35828Revert r35819 -- broke thumbnailing....brion23:46, 3 June 2008

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r5327bug 479 : parsing [[RFC 1234]] as internal linkhashar15:54, 20 September 2004
r5335Fix bug 479 : parsing [[RFC 1234]] as internal link...hashar21:41, 20 September 2004
r5551Fix problem with RFC magic links, as noted at bug 479wmahan17:59, 26 September 2004
r9548* (bug 1887) Applying attachment 461avar13:48, 21 June 2005
r9617* Marking the two RFC testcases as being parsertests for bug 479avar12:56, 24 June 2005
r13307Collected updates:...gabrielwicke17:10, 24 March 2006
r17479* (bug 7405) Make Linker methods static. Patch by Dan Li.nickj05:21, 8 November 2006