Fix parserTests regression introduced in r17479.
authorNick Jenkins <nickj@users.mediawiki.org>
Wed, 8 Nov 2006 06:03:01 +0000 (06:03 +0000)
committerNick Jenkins <nickj@users.mediawiki.org>
Wed, 8 Nov 2006 06:03:01 +0000 (06:03 +0000)
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" class="external" title="http://www.ietf.org/rfc/rfc822.txt">RFC 822</a>
+<p><a href="http://www.ietf.org/rfc/rfc822.txt" class="external " title="http://www.ietf.org/rfc/rfc822.txt" rel="nofollow">RFC 822</a>
 </p>
----------------------

Also applied to the "BUG 1887: A RFC with a thumbnail" and "RFC code coverage" tests.

includes/Linker.php
includes/Parser.php

index bef2cd6..be48283 100644 (file)
@@ -29,7 +29,7 @@ class Linker {
         * @todo document
         * @static
         */
-       protected static function getExternalLinkAttributes( $link, $text, $class='' ) {
+       public static function getExternalLinkAttributes( $link, $text, $class='' ) {
                $link = htmlspecialchars( $link );
 
                $r = ($class != '') ? " class=\"$class\"" : " class=\"external\"";
index 0d881b5..e83cbcc 100644 (file)
@@ -1038,7 +1038,8 @@ class Parser
                        }
 
                        $url = wfMsg( $urlmsg, $id );
-                       $text = Linker::makeExternalLink( $url, "$keyword $id" );
+                       $la = Linker::getExternalLinkAttributes( $url, "$keyword $id" );
+                       $text = "<a href=\"{$url}\"{$la}>{$keyword} {$id}</a>";
                }
                return $text;
        }