r81577 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r81576‎ | r81577 | r81578 >
Date:23:06, 5 February 2011
Author:dantman
Status:ok (Comments)
Tags:
Comment:
Kill off Linker::getExternalLinkAttributes.
Modified paths:
  • /trunk/phase3/includes/Linker.php (modified) (history)
  • /trunk/phase3/includes/SkinLegacy.php (modified) (history)
  • /trunk/phase3/includes/api/ApiParse.php (modified) (history)
  • /trunk/phase3/includes/parser/Parser.php (modified) (history)
  • /trunk/phase3/tests/parser/extraParserTests.txt (modified) (history)
  • /trunk/phase3/tests/parser/parserTests.txt (modified) (history)

Diff [purge]

Index: trunk/phase3/tests/parser/extraParserTests.txt
@@ -12,7 +12,7 @@
1313 !! input
1414 [http://www.example.com test]
1515 !! result
16 -<p>[<a href="http://www.example.com" class="external free" rel="nofollow">http://www.example.com</a> test]
 16+<p>[<a rel="nofollow" class="external free" href="http://www.example.com">http://www.example.com</a> test]
1717 </p>
1818 !! end
1919
@@ -24,7 +24,7 @@
2525 !! input
2626 [http://www.example.com test]
2727 !! result
28 -<p>[<a href="http://www.example.com" class="external free" rel="nofollow">http://www.example.com</a> test]
 28+<p>[<a rel="nofollow" class="external free" href="http://www.example.com">http://www.example.com</a> test]
2929 </p>
3030 !! end
3131
@@ -37,7 +37,7 @@
3838 !! input
3939 http://www.example.com
4040 !! result
41 -<p><a href="http://www.example.com" class="external free" rel="nofollow">http://www.example.com</a>
 41+<p><a rel="nofollow" class="external free" href="http://www.example.com">http://www.example.com</a>
4242 </p>
4343 !! end
4444
@@ -46,6 +46,6 @@
4747 !! input
4848 [http://www.example.com Alice in Wonderland]
4949 !! result
50 -<p><a href="http://www.example.com" class="external text" rel="nofollow">Alice in Wonderland</a>
 50+<p><a rel="nofollow" class="external text" href="http://www.example.com">Alice in Wonderland</a>
5151 </p>
5252 !! end
Index: trunk/phase3/tests/parser/parserTests.txt
@@ -518,7 +518,7 @@
519519 !! input
520520 ; http://example.com/ : definition
521521 !! result
522 -<dl><dt> <a href="http://example.com/" class="external free" rel="nofollow">http://example.com/</a>&#160;</dt><dd> definition
 522+<dl><dt> <a rel="nofollow" class="external free" href="http://example.com/">http://example.com/</a>&#160;</dt><dd> definition
523523 </dd></dl>
524524
525525 !! end
@@ -528,7 +528,7 @@
529529 !! input
530530 ;[http://www.example.com/ Example]:Something about it
531531 !! result
532 -<dl><dt><a href="http://www.example.com/" class="external text" rel="nofollow">Example</a></dt><dd>Something about it
 532+<dl><dt><a rel="nofollow" class="external text" href="http://www.example.com/">Example</a></dt><dd>Something about it
533533 </dd></dl>
534534
535535 !! end
@@ -549,7 +549,7 @@
550550 !! input
551551 ; news:alt.wikipedia.rox: This isn't even a real newsgroup!
552552 !! result
553 -<dl><dt> <a href="news:alt.wikipedia.rox" class="external free" rel="nofollow">news:alt.wikipedia.rox</a></dt><dd> This isn't even a real newsgroup!
 553+<dl><dt> <a rel="nofollow" class="external free" href="news:alt.wikipedia.rox">news:alt.wikipedia.rox</a></dt><dd> This isn't even a real newsgroup!
554554 </dd></dl>
555555
556556 !! end
@@ -559,7 +559,7 @@
560560 !! input
561561 ; news:alt.wikipedia.rox -- don't crash or enter an infinite loop
562562 !! result
563 -<dl><dt> <a href="news:alt.wikipedia.rox" class="external free" rel="nofollow">news:alt.wikipedia.rox</a> -- don't crash or enter an infinite loop
 563+<dl><dt> <a rel="nofollow" class="external free" href="news:alt.wikipedia.rox">news:alt.wikipedia.rox</a> -- don't crash or enter an infinite loop
564564 </dt></dl>
565565
566566 !! end
@@ -569,7 +569,7 @@
570570 !! input
571571 ; [http://www.wikipedia2.org/ Wikipedia : The Next Generation]: OK, I made that up
572572 !! result
573 -<dl><dt> <a href="http://www.wikipedia2.org/" class="external text" rel="nofollow">Wikipedia&#160;: The Next Generation</a></dt><dd> OK, I made that up
 573+<dl><dt> <a rel="nofollow" class="external text" href="http://www.wikipedia2.org/">Wikipedia&#160;: The Next Generation</a></dt><dd> OK, I made that up
574574 </dd></dl>
575575
576576 !! end
@@ -623,7 +623,7 @@
624624 !! input
625625 Non-bracketed: http://example.com
626626 !! result
627 -<p>Non-bracketed: <a href="http://example.com" class="external free" rel="nofollow">http://example.com</a>
 627+<p>Non-bracketed: <a rel="nofollow" class="external free" href="http://example.com">http://example.com</a>
628628 </p>
629629 !! end
630630
@@ -634,9 +634,9 @@
635635 Numbered: [http://example.net]
636636 Numbered: [http://example.com]
637637 !! result
638 -<p>Numbered: <a href="http://example.com" class="external autonumber" rel="nofollow">[1]</a>
639 -Numbered: <a href="http://example.net" class="external autonumber" rel="nofollow">[2]</a>
640 -Numbered: <a href="http://example.com" class="external autonumber" rel="nofollow">[3]</a>
 638+<p>Numbered: <a rel="nofollow" class="external autonumber" href="http://example.com">[1]</a>
 639+Numbered: <a rel="nofollow" class="external autonumber" href="http://example.net">[2]</a>
 640+Numbered: <a rel="nofollow" class="external autonumber" href="http://example.com">[3]</a>
641641 </p>
642642 !!end
643643
@@ -645,7 +645,7 @@
646646 !! input
647647 Specified text: [http://example.com link]
648648 !! result
649 -<p>Specified text: <a href="http://example.com" class="external text" rel="nofollow">link</a>
 649+<p>Specified text: <a rel="nofollow" class="external text" href="http://example.com">link</a>
650650 </p>
651651 !!end
652652
@@ -654,7 +654,7 @@
655655 !! input
656656 Linktrails should not work for external links: [http://example.com link]s
657657 !! result
658 -<p>Linktrails should not work for external links: <a href="http://example.com" class="external text" rel="nofollow">link</a>s
 658+<p>Linktrails should not work for external links: <a rel="nofollow" class="external text" href="http://example.com">link</a>s
659659 </p>
660660 !! end
661661
@@ -663,7 +663,7 @@
664664 !! input
665665 http://example.com/1$2345
666666 !! result
667 -<p><a href="http://example.com/1$2345" class="external free" rel="nofollow">http://example.com/1$2345</a>
 667+<p><a rel="nofollow" class="external free" href="http://example.com/1$2345">http://example.com/1$2345</a>
668668 </p>
669669 !! end
670670
@@ -672,7 +672,7 @@
673673 !! input
674674 [http://example.com/1$2345]
675675 !! result
676 -<p><a href="http://example.com/1$2345" class="external autonumber" rel="nofollow">[1]</a>
 676+<p><a rel="nofollow" class="external autonumber" href="http://example.com/1$2345">[1]</a>
677677 </p>
678678 !!end
679679
@@ -681,7 +681,7 @@
682682 !! input
683683 http://example.com/1[2345
684684 !! result
685 -<p><a href="http://example.com/1" class="external free" rel="nofollow">http://example.com/1</a>[2345
 685+<p><a rel="nofollow" class="external free" href="http://example.com/1">http://example.com/1</a>[2345
686686 </p>
687687 !! end
688688
@@ -690,7 +690,7 @@
691691 !! input
692692 [http://example.com/1[2345]
693693 !! result
694 -<p><a href="http://example.com/1" class="external text" rel="nofollow">[2345</a>
 694+<p><a rel="nofollow" class="external text" href="http://example.com/1">[2345</a>
695695 </p>
696696 !!end
697697
@@ -699,7 +699,7 @@
700700 !!input
701701 [http://example.com/ <nowiki>''example site''</nowiki>]
702702 !! result
703 -<p><a href="http://example.com/" class="external text" rel="nofollow">''example site''</a>
 703+<p><a rel="nofollow" class="external text" href="http://example.com/">''example site''</a>
704704 </p>
705705 !! end
706706
@@ -709,7 +709,7 @@
710710 [http://example.com/ first
711711 second]
712712 !! result
713 -<p>[<a href="http://example.com/" class="external free" rel="nofollow">http://example.com/</a> first
 713+<p>[<a rel="nofollow" class="external free" href="http://example.com/">http://example.com/</a> first
714714 second]
715715 </p>
716716 !!end
@@ -737,7 +737,7 @@
738738 !! input
739739 Link to non-http image, no img tag: ftp://example.com/test.jpg
740740 !! result
741 -<p>Link to non-http image, no img tag: <a href="ftp://example.com/test.jpg" class="external free" rel="nofollow">ftp://example.com/test.jpg</a>
 741+<p>Link to non-http image, no img tag: <a rel="nofollow" class="external free" href="ftp://example.com/test.jpg">ftp://example.com/test.jpg</a>
742742 </p>
743743 !! end
744744
@@ -746,7 +746,7 @@
747747 !! input
748748 Terminating separator: http://example.com/thing,
749749 !! result
750 -<p>Terminating separator: <a href="http://example.com/thing" class="external free" rel="nofollow">http://example.com/thing</a>,
 750+<p>Terminating separator: <a rel="nofollow" class="external free" href="http://example.com/thing">http://example.com/thing</a>,
751751 </p>
752752 !! end
753753
@@ -755,7 +755,7 @@
756756 !! input
757757 Intervening separator: http://example.com/1,2,3
758758 !! result
759 -<p>Intervening separator: <a href="http://example.com/1,2,3" class="external free" rel="nofollow">http://example.com/1,2,3</a>
 759+<p>Intervening separator: <a rel="nofollow" class="external free" href="http://example.com/1,2,3">http://example.com/1,2,3</a>
760760 </p>
761761 !! end
762762
@@ -764,7 +764,7 @@
765765 !! input
766766 Old bug with URL in query: [http://example.com/thing?url=http://example.com link]
767767 !! result
768 -<p>Old bug with URL in query: <a href="http://example.com/thing?url=http://example.com" class="external text" rel="nofollow">link</a>
 768+<p>Old bug with URL in query: <a rel="nofollow" class="external text" href="http://example.com/thing?url=http://example.com">link</a>
769769 </p>
770770 !! end
771771
@@ -773,7 +773,7 @@
774774 !! input
775775 And again with mixed protocols: [ftp://example.com?url=http://example.com link]
776776 !! result
777 -<p>And again with mixed protocols: <a href="ftp://example.com?url=http://example.com" class="external text" rel="nofollow">link</a>
 777+<p>And again with mixed protocols: <a rel="nofollow" class="external text" href="ftp://example.com?url=http://example.com">link</a>
778778 </p>
779779 !!end
780780
@@ -782,7 +782,7 @@
783783 !! input
784784 URL in text: [http://example.com http://example.com]
785785 !! result
786 -<p>URL in text: <a href="http://example.com" class="external free" rel="nofollow">http://example.com</a>
 786+<p>URL in text: <a rel="nofollow" class="external free" href="http://example.com">http://example.com</a>
787787 </p>
788788 !! end
789789
@@ -791,7 +791,7 @@
792792 !! input
793793 ja-style clickable images: [http://example.com http://meta.wikimedia.org/upload/f/f1/Ncwikicol.png]
794794 !! result
795 -<p>ja-style clickable images: <a href="http://example.com" class="external text" rel="nofollow"><img src="http://meta.wikimedia.org/upload/f/f1/Ncwikicol.png" alt="Ncwikicol.png" /></a>
 795+<p>ja-style clickable images: <a rel="nofollow" class="external text" href="http://example.com"><img src="http://meta.wikimedia.org/upload/f/f1/Ncwikicol.png" alt="Ncwikicol.png" /></a>
796796 </p>
797797 !!end
798798
@@ -800,7 +800,7 @@
801801 !! input
802802 Old &amp; use: http://x&y
803803 !! result
804 -<p>Old &amp; use: <a href="http://x&amp;y" class="external free" rel="nofollow">http://x&amp;y</a>
 804+<p>Old &amp; use: <a rel="nofollow" class="external free" href="http://x&amp;y">http://x&amp;y</a>
805805 </p>
806806 !! end
807807
@@ -809,7 +809,7 @@
810810 !! input
811811 Old &amp; use: http://x&amp;y
812812 !! result
813 -<p>Old &amp; use: <a href="http://x&amp;y" class="external free" rel="nofollow">http://x&amp;y</a>
 813+<p>Old &amp; use: <a rel="nofollow" class="external free" href="http://x&amp;y">http://x&amp;y</a>
814814 </p>
815815 !! end
816816
@@ -818,7 +818,7 @@
819819 !! input
820820 http://example.com/?foo&#61;bar
821821 !! result
822 -<p><a href="http://example.com/?foo=bar" class="external free" rel="nofollow">http://example.com/?foo=bar</a>
 822+<p><a rel="nofollow" class="external free" href="http://example.com/?foo=bar">http://example.com/?foo=bar</a>
823823 </p>
824824 !! end
825825
@@ -827,7 +827,7 @@
828828 !! input
829829 Old &amp; use: [http://x&y]
830830 !! result
831 -<p>Old &amp; use: <a href="http://x&amp;y" class="external autonumber" rel="nofollow">[1]</a>
 831+<p>Old &amp; use: <a rel="nofollow" class="external autonumber" href="http://x&amp;y">[1]</a>
832832 </p>
833833 !! end
834834
@@ -836,7 +836,7 @@
837837 !! input
838838 Old &amp; use: [http://x&amp;y]
839839 !! result
840 -<p>Old &amp; use: <a href="http://x&amp;y" class="external autonumber" rel="nofollow">[1]</a>
 840+<p>Old &amp; use: <a rel="nofollow" class="external autonumber" href="http://x&amp;y">[1]</a>
841841 </p>
842842 !! end
843843
@@ -845,7 +845,7 @@
846846 !! input
847847 [http://example.com/?foo&#61;bar]
848848 !! result
849 -<p><a href="http://example.com/?foo=bar" class="external autonumber" rel="nofollow">[1]</a>
 849+<p><a rel="nofollow" class="external autonumber" href="http://example.com/?foo=bar">[1]</a>
850850 </p>
851851 !! end
852852
@@ -854,7 +854,7 @@
855855 !! input
856856 [http://e&zwnj;xample.com/]
857857 !! result
858 -<p><a href="http://example.com/" class="external autonumber" rel="nofollow">[1]</a>
 858+<p><a rel="nofollow" class="external autonumber" href="http://example.com/">[1]</a>
859859 </p>
860860 !! end
861861
@@ -863,7 +863,7 @@
864864 !! input
865865 http://e&zwnj;xample.com/
866866 !! result
867 -<p><a href="http://example.com/" class="external free" rel="nofollow">http://example.com/</a>
 867+<p><a rel="nofollow" class="external free" href="http://example.com/">http://example.com/</a>
868868 </p>
869869 !! end
870870
@@ -872,7 +872,7 @@
873873 !! input
874874 http://www.jpeg.org
875875 !!result
876 -<p><a href="http://www.jpeg.org" class="external free" rel="nofollow">http://www.jpeg.org</a>
 876+<p><a rel="nofollow" class="external free" href="http://www.jpeg.org">http://www.jpeg.org</a>
877877 </p>
878878 !! end
879879
@@ -881,7 +881,7 @@
882882 !! input
883883 [http://www.unausa.org/newindex.asp?place=http://www.unausa.org/programs/mun.asp]
884884 !! result
885 -<p><a href="http://www.unausa.org/newindex.asp?place=http://www.unausa.org/programs/mun.asp" class="external autonumber" rel="nofollow">[1]</a>
 885+<p><a rel="nofollow" class="external autonumber" href="http://www.unausa.org/newindex.asp?place=http://www.unausa.org/programs/mun.asp">[1]</a>
886886 </p>
887887 !! end
888888
@@ -890,7 +890,7 @@
891891 !! input
892892 [http://www.example.com/foo http://www.example.com/bar]
893893 !! result
894 -<p><a href="http://www.example.com/foo" class="external text" rel="nofollow">http://www.example.com/bar</a>
 894+<p><a rel="nofollow" class="external text" href="http://www.example.com/foo">http://www.example.com/bar</a>
895895 </p>
896896 !! end
897897
@@ -899,7 +899,7 @@
900900 !! input
901901 http://www.example.com/foo?=http://www.example.com/bar
902902 !! result
903 -<p><a href="http://www.example.com/foo?=http://www.example.com/bar" class="external free" rel="nofollow">http://www.example.com/foo?=http://www.example.com/bar</a>
 903+<p><a rel="nofollow" class="external free" href="http://www.example.com/foo?=http://www.example.com/bar">http://www.example.com/foo?=http://www.example.com/bar</a>
904904 </p>
905905 !! end
906906
@@ -908,7 +908,7 @@
909909 !! input
910910 http://www.example.com/<hello>
911911 !! result
912 -<p><a href="http://www.example.com/" class="external free" rel="nofollow">http://www.example.com/</a>&lt;hello&gt;
 912+<p><a rel="nofollow" class="external free" href="http://www.example.com/">http://www.example.com/</a>&lt;hello&gt;
913913 </p>
914914 !!end
915915
@@ -917,7 +917,7 @@
918918 !! input
919919 http://www.example.com/<b>html</b>
920920 !! result
921 -<p><a href="http://www.example.com/" class="external free" rel="nofollow">http://www.example.com/</a><b>html</b>
 921+<p><a rel="nofollow" class="external free" href="http://www.example.com/">http://www.example.com/</a><b>html</b>
922922 </p>
923923 !!end
924924
@@ -926,7 +926,7 @@
927927 !! input
928928 [http://www.example.com/<hello> stuff]
929929 !! result
930 -<p><a href="http://www.example.com/" class="external text" rel="nofollow">&lt;hello&gt; stuff</a>
 930+<p><a rel="nofollow" class="external text" href="http://www.example.com/">&lt;hello&gt; stuff</a>
931931 </p>
932932 !!end
933933
@@ -935,7 +935,7 @@
936936 !! input
937937 [http://www.example.com/<b>html</b> stuff]
938938 !! result
939 -<p><a href="http://www.example.com/" class="external text" rel="nofollow"><b>html</b> stuff</a>
 939+<p><a rel="nofollow" class="external text" href="http://www.example.com/"><b>html</b> stuff</a>
940940 </p>
941941 !!end
942942
@@ -944,7 +944,7 @@
945945 !! input
946946 http://www.example.com/"hello"
947947 !! result
948 -<p><a href="http://www.example.com/" class="external free" rel="nofollow">http://www.example.com/</a>"hello"
 948+<p><a rel="nofollow" class="external free" href="http://www.example.com/">http://www.example.com/</a>"hello"
949949 </p>
950950 !!end
951951
@@ -953,7 +953,7 @@
954954 !! input
955955 [http://www.example.com/"hello" stuff]
956956 !! result
957 -<p><a href="http://www.example.com/" class="external text" rel="nofollow">"hello" stuff</a>
 957+<p><a rel="nofollow" class="external text" href="http://www.example.com/">"hello" stuff</a>
958958 </p>
959959 !!end
960960
@@ -962,7 +962,7 @@
963963 !! input
964964 [http://www.example.com test]
965965 !! result
966 -<p><a href="http://www.example.com" class="external text" rel="nofollow">test</a>
 966+<p><a rel="nofollow" class="external text" href="http://www.example.com">test</a>
967967 </p>
968968 !! end
969969
@@ -971,7 +971,7 @@
972972 !! input
973973 [http://example.com [[wikilink]] embedded in ext link]
974974 !! result
975 -<p><a href="http://example.com" class="external text" rel="nofollow"></a><a href="https://www.mediawiki.org/index.php?title=Wikilink&amp;action=edit&amp;redlink=1" class="new" title="Wikilink (page does not exist)">wikilink</a><a href="http://example.com" class="external text" rel="nofollow"> embedded in ext link</a>
 975+<p><a rel="nofollow" class="external text" href="http://example.com"></a><a href="https://www.mediawiki.org/index.php?title=Wikilink&amp;action=edit&amp;redlink=1" class="new" title="Wikilink (page does not exist)">wikilink</a><a rel="nofollow" class="external text" href="http://example.com"> embedded in ext link</a>
976976 </p>
977977 !! end
978978
@@ -996,11 +996,11 @@
997997 ''Something [http://example.com mixed''''', even bold]'''
998998 '''''Now [http://example.com both''''']
999999 !! result
1000 -<p><a href="http://example.com" class="external text" rel="nofollow"><i>text</i></a>
1001 -<a href="http://example.com" class="external text" rel="nofollow"><b>text</b></a>
1002 -<i>Something </i><a href="http://example.com" class="external text" rel="nofollow"><i>in italic</i></a>
1003 -<i>Something </i><a href="http://example.com" class="external text" rel="nofollow"><i>mixed</i><b>, even bold</b></a>
1004 -<i><b>Now </b></i><a href="http://example.com" class="external text" rel="nofollow"><i><b>both</b></i></a>
 1000+<p><a rel="nofollow" class="external text" href="http://example.com"><i>text</i></a>
 1001+<a rel="nofollow" class="external text" href="http://example.com"><b>text</b></a>
 1002+<i>Something </i><a rel="nofollow" class="external text" href="http://example.com"><i>in italic</i></a>
 1003+<i>Something </i><a rel="nofollow" class="external text" href="http://example.com"><i>mixed</i><b>, even bold</b></a>
 1004+<i><b>Now </b></i><a rel="nofollow" class="external text" href="http://example.com"><i><b>both</b></i></a>
10051005 </p>
10061006 !! end
10071007
@@ -1010,7 +1010,7 @@
10111011 !! input
10121012 http://www.example.com/?title=AT%26T
10131013 !! result
1014 -<p><a href="http://www.example.com/?title=AT%26T" class="external free" rel="nofollow">http://www.example.com/?title=AT%26T</a>
 1014+<p><a rel="nofollow" class="external free" href="http://www.example.com/?title=AT%26T">http://www.example.com/?title=AT%26T</a>
10151015 </p>
10161016 !! end
10171017
@@ -1019,7 +1019,7 @@
10201020 !! input
10211021 http://www.example.com/?title=100%25_Bran
10221022 !! result
1023 -<p><a href="http://www.example.com/?title=100%25_Bran" class="external free" rel="nofollow">http://www.example.com/?title=100%25_Bran</a>
 1023+<p><a rel="nofollow" class="external free" href="http://www.example.com/?title=100%25_Bran">http://www.example.com/?title=100%25_Bran</a>
10241024 </p>
10251025 !! end
10261026
@@ -1028,7 +1028,7 @@
10291029 !! input
10301030 http://www.example.com/?title=Ben-Hur_%281959_film%29
10311031 !! result
1032 -<p><a href="http://www.example.com/?title=Ben-Hur_%281959_film%29" class="external free" rel="nofollow">http://www.example.com/?title=Ben-Hur_%281959_film%29</a>
 1032+<p><a rel="nofollow" class="external free" href="http://www.example.com/?title=Ben-Hur_%281959_film%29">http://www.example.com/?title=Ben-Hur_%281959_film%29</a>
10331033 </p>
10341034 !! end
10351035
@@ -1038,7 +1038,7 @@
10391039 !! input
10401040 [http://www.example.com/?title=AT%26T]
10411041 !! result
1042 -<p><a href="http://www.example.com/?title=AT%26T" class="external autonumber" rel="nofollow">[1]</a>
 1042+<p><a rel="nofollow" class="external autonumber" href="http://www.example.com/?title=AT%26T">[1]</a>
10431043 </p>
10441044 !! end
10451045
@@ -1047,7 +1047,7 @@
10481048 !! input
10491049 [http://www.example.com/?title=100%25_Bran]
10501050 !! result
1051 -<p><a href="http://www.example.com/?title=100%25_Bran" class="external autonumber" rel="nofollow">[1]</a>
 1051+<p><a rel="nofollow" class="external autonumber" href="http://www.example.com/?title=100%25_Bran">[1]</a>
10521052 </p>
10531053 !! end
10541054
@@ -1056,7 +1056,7 @@
10571057 !! input
10581058 [http://www.example.com/?title=Ben-Hur_%281959_film%29]
10591059 !! result
1060 -<p><a href="http://www.example.com/?title=Ben-Hur_%281959_film%29" class="external autonumber" rel="nofollow">[1]</a>
 1060+<p><a rel="nofollow" class="external autonumber" href="http://www.example.com/?title=Ben-Hur_%281959_film%29">[1]</a>
10611061 </p>
10621062 !! end
10631063
@@ -1066,7 +1066,7 @@
10671067 !! input
10681068 [http://www.example.com/?title=AT%26T link]
10691069 !! result
1070 -<p><a href="http://www.example.com/?title=AT%26T" class="external text" rel="nofollow">link</a>
 1070+<p><a rel="nofollow" class="external text" href="http://www.example.com/?title=AT%26T">link</a>
10711071 </p>
10721072 !! end
10731073
@@ -1075,7 +1075,7 @@
10761076 !! input
10771077 [http://www.example.com/?title=100%25_Bran link]
10781078 !! result
1079 -<p><a href="http://www.example.com/?title=100%25_Bran" class="external text" rel="nofollow">link</a>
 1079+<p><a rel="nofollow" class="external text" href="http://www.example.com/?title=100%25_Bran">link</a>
10801080 </p>
10811081 !! end
10821082
@@ -1084,7 +1084,7 @@
10851085 !! input
10861086 [http://www.example.com/?title=Ben-Hur_%281959_film%29 link]
10871087 !! result
1088 -<p><a href="http://www.example.com/?title=Ben-Hur_%281959_film%29" class="external text" rel="nofollow">link</a>
 1088+<p><a rel="nofollow" class="external text" href="http://www.example.com/?title=Ben-Hur_%281959_film%29">link</a>
10891089 </p>
10901090 !! end
10911091
@@ -1093,7 +1093,7 @@
10941094 !! input
10951095 Some [http://example.com/ pretty ''italics'' and stuff]!
10961096 !! result
1097 -<p>Some <a href="http://example.com/" class="external text" rel="nofollow">pretty <i>italics</i> and stuff</a>!
 1097+<p>Some <a rel="nofollow" class="external text" href="http://example.com/">pretty <i>italics</i> and stuff</a>!
10981098 </p>
10991099 !! end
11001100
@@ -1102,7 +1102,7 @@
11031103 !! input
11041104 ''Some [http://example.com/ pretty ''italics'' and stuff]!''
11051105 !! result
1106 -<p><i>Some </i><a href="http://example.com/" class="external text" rel="nofollow"><i>pretty </i>italics<i> and stuff</i></a><i>!</i>
 1106+<p><i>Some </i><a rel="nofollow" class="external text" href="http://example.com/"><i>pretty </i>italics<i> and stuff</i></a><i>!</i>
11071107 </p>
11081108 !! end
11091109
@@ -1111,7 +1111,7 @@
11121112 !! input
11131113 [http://www.musee-picasso.fr/pages/page_id18528_u1l2.htm''La muerte de Casagemas'' (1901) en el sitio de [[Museo Picasso (París)|Museo Picasso]].]
11141114 !! result
1115 -<p><a href="http://www.musee-picasso.fr/pages/page_id18528_u1l2.htm" class="external text" rel="nofollow"><i>La muerte de Casagemas</i> (1901) en el sitio de <a href="https://www.mediawiki.org/index.php?title=Museo_Picasso_(Par%C3%ADs)&amp;action=edit&amp;redlink=1" class="new" title="Museo Picasso (París) (page does not exist)">Museo Picasso</a>.</a>
 1115+<p><a rel="nofollow" class="external text" href="http://www.musee-picasso.fr/pages/page_id18528_u1l2.htm"><i>La muerte de Casagemas</i> (1901) en el sitio de <a href="https://www.mediawiki.org/index.php?title=Museo_Picasso_(Par%C3%ADs)&amp;action=edit&amp;redlink=1" class="new" title="Museo Picasso (París) (page does not exist)">Museo Picasso</a>.</a>
11161116 </p>
11171117 !! end
11181118
@@ -1390,7 +1390,7 @@
13911391 !! result
13921392 <table>
13931393 <tr>
1394 -<td>[<a href="ftp://%7Cx" class="external free" rel="nofollow">ftp://%7Cx</a></td>
 1394+<td>[<a rel="nofollow" class="external free" href="ftp://%7Cx">ftp://%7Cx</a></td>
13951395 <td>]" onmouseover="alert(document.cookie)"&gt;test
13961396 </td>
13971397 </tr>
@@ -1633,7 +1633,7 @@
16341634 !! input
16351635 [[http://www.example.com]]
16361636 !! result
1637 -<p>[<a href="http://www.example.com" class="external autonumber" rel="nofollow">[1]</a>]
 1637+<p>[<a rel="nofollow" class="external autonumber" href="http://www.example.com">[1]</a>]
16381638 </p>
16391639 !! end
16401640
@@ -1653,7 +1653,7 @@
16541654 !! input
16551655 Piped link to URL: [[http://www.example.com|an example URL]]
16561656 !! result
1657 -<p>Piped link to URL: [<a href="http://www.example.com%7Can" class="external text" rel="nofollow">example URL</a>]
 1657+<p>Piped link to URL: [<a rel="nofollow" class="external text" href="http://www.example.com%7Can">example URL</a>]
16581658 </p>
16591659 !! end
16601660
@@ -2195,7 +2195,7 @@
21962196 !! input
21972197 {{SERVER}}
21982198 !! result
2199 -<p><a href="http://Britney-Spears" class="external free" rel="nofollow">http://Britney-Spears</a>
 2199+<p><a rel="nofollow" class="external free" href="http://Britney-Spears">http://Britney-Spears</a>
22002200 </p>
22012201 !! end
22022202
@@ -2360,7 +2360,7 @@
23612361 !! input
23622362 RFC 822
23632363 !! result
2364 -<p><a href="http://tools.ietf.org/html/rfc822" class="external mw-magiclink-rfc">RFC 822</a>
 2364+<p><a class="external mw-magiclink-rfc" href="http://tools.ietf.org/html/rfc822">RFC 822</a>
23652365 </p>
23662366 !! end
23672367
@@ -2378,7 +2378,7 @@
23792379 !! input
23802380 PMID 1234
23812381 !! result
2382 -<p><a href="http://www.ncbi.nlm.nih.gov/pubmed/1234?dopt=Abstract" class="external mw-magiclink-pmid">PMID 1234</a>
 2382+<p><a class="external mw-magiclink-pmid" href="http://www.ncbi.nlm.nih.gov/pubmed/1234?dopt=Abstract">PMID 1234</a>
23832383 </p>
23842384 !! end
23852385
@@ -3541,7 +3541,7 @@
35423542 !! input
35433543 [[Image:foobar.jpg|thumb|http://example.com]]
35443544 !! result
3545 -<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/3/3a/Foobar.jpg" width="180" height="20" class="thumbimage" /></a> <div class="thumbcaption"><div class="magnify"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="internal" title="Enlarge"><img src="/skins/common/images/magnify-clip.png" width="15" height="11" alt="" /></a></div><a href="http://example.com" class="external free" rel="nofollow">http://example.com</a></div></div></div>
 3545+<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/3/3a/Foobar.jpg" width="180" height="20" class="thumbimage" /></a> <div class="thumbcaption"><div class="magnify"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="internal" title="Enlarge"><img src="/skins/common/images/magnify-clip.png" width="15" height="11" alt="" /></a></div><a rel="nofollow" class="external free" href="http://example.com">http://example.com</a></div></div></div>
35463546
35473547 !! end
35483548
@@ -3550,7 +3550,7 @@
35513551 !! input
35523552 [[Image:foobar.jpg|thumb|http://example.com|alt=Alteration]]
35533553 !! result
3554 -<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="image"><img alt="Alteration" src="http://example.com/images/3/3a/Foobar.jpg" width="180" height="20" class="thumbimage" /></a> <div class="thumbcaption"><div class="magnify"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="internal" title="Enlarge"><img src="/skins/common/images/magnify-clip.png" width="15" height="11" alt="" /></a></div><a href="http://example.com" class="external free" rel="nofollow">http://example.com</a></div></div></div>
 3554+<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="image"><img alt="Alteration" src="http://example.com/images/3/3a/Foobar.jpg" width="180" height="20" class="thumbimage" /></a> <div class="thumbcaption"><div class="magnify"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="internal" title="Enlarge"><img src="/skins/common/images/magnify-clip.png" width="15" height="11" alt="" /></a></div><a rel="nofollow" class="external free" href="http://example.com">http://example.com</a></div></div></div>
35553555
35563556 !! end
35573557
@@ -3568,7 +3568,7 @@
35693569 !! input
35703570 [[Image:foobar.jpg|thumb|This is RFC 12354]]
35713571 !! result
3572 -<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/3/3a/Foobar.jpg" width="180" height="20" class="thumbimage" /></a> <div class="thumbcaption"><div class="magnify"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="internal" title="Enlarge"><img src="/skins/common/images/magnify-clip.png" width="15" height="11" alt="" /></a></div>This is <a href="http://tools.ietf.org/html/rfc12354" class="external mw-magiclink-rfc">RFC 12354</a></div></div></div>
 3572+<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/3/3a/Foobar.jpg" width="180" height="20" class="thumbimage" /></a> <div class="thumbcaption"><div class="magnify"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="internal" title="Enlarge"><img src="/skins/common/images/magnify-clip.png" width="15" height="11" alt="" /></a></div>This is <a class="external mw-magiclink-rfc" href="http://tools.ietf.org/html/rfc12354">RFC 12354</a></div></div></div>
35733573
35743574 !! end
35753575
@@ -3577,7 +3577,7 @@
35783578 !! input
35793579 [[Image:foobar.jpg|thumb|Please mailto:nobody@example.com]]
35803580 !! result
3581 -<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/3/3a/Foobar.jpg" width="180" height="20" class="thumbimage" /></a> <div class="thumbcaption"><div class="magnify"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="internal" title="Enlarge"><img src="/skins/common/images/magnify-clip.png" width="15" height="11" alt="" /></a></div>Please <a href="mailto:nobody@example.com" class="external free" rel="nofollow">mailto:nobody@example.com</a></div></div></div>
 3581+<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/3/3a/Foobar.jpg" width="180" height="20" class="thumbimage" /></a> <div class="thumbcaption"><div class="magnify"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="internal" title="Enlarge"><img src="/skins/common/images/magnify-clip.png" width="15" height="11" alt="" /></a></div>Please <a rel="nofollow" class="external free" href="mailto:nobody@example.com">mailto:nobody@example.com</a></div></div></div>
35823582
35833583 !! end
35843584
@@ -3691,7 +3691,7 @@
36923692 !! input
36933693 [[Image:Foobar.jpg|thumb|200px|This caption has [irc://example.net irc] and [https://example.com Secure] ext links in it.]]
36943694 !! result
3695 -<div class="thumb tright"><div class="thumbinner" style="width:202px;"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/3/3a/Foobar.jpg" width="200" height="23" class="thumbimage" /></a> <div class="thumbcaption"><div class="magnify"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="internal" title="Enlarge"><img src="/skins/common/images/magnify-clip.png" width="15" height="11" alt="" /></a></div>This caption has <a href="irc://example.net" class="external text" rel="nofollow">irc</a> and <a href="https://example.com" class="external text" rel="nofollow">Secure</a> ext links in it.</div></div></div>
 3695+<div class="thumb tright"><div class="thumbinner" style="width:202px;"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/3/3a/Foobar.jpg" width="200" height="23" class="thumbimage" /></a> <div class="thumbcaption"><div class="magnify"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="internal" title="Enlarge"><img src="/skins/common/images/magnify-clip.png" width="15" height="11" alt="" /></a></div>This caption has <a rel="nofollow" class="external text" href="irc://example.net">irc</a> and <a rel="nofollow" class="external text" href="https://example.com">Secure</a> ext links in it.</div></div></div>
36963696
36973697 !! end
36983698
@@ -4150,7 +4150,7 @@
41514151 !! input
41524152 http://example.com [[Image:foobar.jpg]]
41534153 !! result
4154 -<p><a href="http://example.com" class="external free" rel="nofollow">http://example.com</a> <a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a>
 4154+<p><a rel="nofollow" class="external free" href="http://example.com">http://example.com</a> <a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a>
41554155 </p>
41564156 !!end
41574157
@@ -4224,7 +4224,7 @@
42254225 !! input
42264226 http://example.com[[Image:foobar.jpg]]
42274227 !! result
4228 -<p><a href="http://example.com" class="external free" rel="nofollow">http://example.com</a><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a>
 4228+<p><a rel="nofollow" class="external free" href="http://example.com">http://example.com</a><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a>
42294229 </p>
42304230 !!end
42314231
@@ -4233,7 +4233,7 @@
42344234 !! input
42354235 http://en.wikinews.org/wiki/Wikinews:Workplace
42364236 !! result
4237 -<p><a href="http://en.wikinews.org/wiki/Wikinews:Workplace" class="external free" rel="nofollow">http://en.wikinews.org/wiki/Wikinews:Workplace</a>
 4237+<p><a rel="nofollow" class="external free" href="http://en.wikinews.org/wiki/Wikinews:Workplace">http://en.wikinews.org/wiki/Wikinews:Workplace</a>
42384238 </p>
42394239 !!end
42404240
@@ -5389,11 +5389,11 @@
53905390
53915391 mailto:inline@mail.tld
53925392 !! result
5393 -<p><a href="http://first/" class="external autonumber" rel="nofollow">[1]</a> <a href="http://second" class="external autonumber" rel="nofollow">[2]</a> <a href="ftp://ftp" class="external autonumber" rel="nofollow">[3]</a>
5394 -</p><p><a href="ftp://inlineftp" class="external free" rel="nofollow">ftp://inlineftp</a>
5395 -</p><p><a href="mailto:enclosed@mail.tld" class="external text" rel="nofollow">With target</a>
5396 -</p><p><a href="mailto:enclosed@mail.tld" class="external autonumber" rel="nofollow">[4]</a>
5397 -</p><p><a href="mailto:inline@mail.tld" class="external free" rel="nofollow">mailto:inline@mail.tld</a>
 5393+<p><a rel="nofollow" class="external autonumber" href="http://first/">[1]</a> <a rel="nofollow" class="external autonumber" href="http://second">[2]</a> <a rel="nofollow" class="external autonumber" href="ftp://ftp">[3]</a>
 5394+</p><p><a rel="nofollow" class="external free" href="ftp://inlineftp">ftp://inlineftp</a>
 5395+</p><p><a rel="nofollow" class="external text" href="mailto:enclosed@mail.tld">With target</a>
 5396+</p><p><a rel="nofollow" class="external autonumber" href="mailto:enclosed@mail.tld">[4]</a>
 5397+</p><p><a rel="nofollow" class="external free" href="mailto:inline@mail.tld">mailto:inline@mail.tld</a>
53985398 </p>
53995399 !! end
54005400
@@ -5476,7 +5476,7 @@
54775477 !! result
54785478 <table>
54795479 <tr>
5480 -<th> <a href="irc://{{ftp://a" class="external free" rel="nofollow">irc://{{ftp://a</a>" onmouseover="alert('hello world');"
 5480+<th> <a rel="nofollow" class="external free" href="irc://{{ftp://a">irc://{{ftp://a</a>" onmouseover="alert('hello world');"
54815481 </th>
54825482 <td>
54835483 </td>
@@ -5492,7 +5492,7 @@
54935493
54945494 {|
54955495 !!result
5496 -<p><a href="http://===r:::https://b" class="external free" rel="nofollow">http://===r:::https://b</a>
 5496+<p><a rel="nofollow" class="external free" href="http://===r:::https://b">http://===r:::https://b</a>
54975497 </p>
54985498 <table>
54995499 <tr><td></td></tr>
@@ -5556,7 +5556,7 @@
55575557 !! input
55585558 http://example.com <nowiki>junk</nowiki>
55595559 !! result
5560 -<p><a href="http://example.com" class="external free" rel="nofollow">http://example.com</a> junk
 5560+<p><a rel="nofollow" class="external free" href="http://example.com">http://example.com</a> junk
55615561 </p>
55625562 !!end
55635563
@@ -5566,7 +5566,7 @@
55675567 !! input
55685568 http://example.com<nowiki>junk</nowiki>
55695569 !! result
5570 -<p><a href="http://example.com" class="external free" rel="nofollow">http://example.com</a>junk
 5570+<p><a rel="nofollow" class="external free" href="http://example.com">http://example.com</a>junk
55715571 </p>
55725572 !!end
55735573
@@ -5576,7 +5576,7 @@
55775577 !! input
55785578 http://example.com<pre>junk</pre>
55795579 !! result
5580 -<a href="http://example.com" class="external free" rel="nofollow">http://example.com</a><pre>junk</pre>
 5580+<a rel="nofollow" class="external free" href="http://example.com">http://example.com</a><pre>junk</pre>
55815581
55825582 !!end
55835583
@@ -6602,7 +6602,7 @@
66036603 !! input
66046604 **irc://&#x0A;a
66056605 !! result
6606 -<ul><li><ul><li><a href="irc://%0Aa" class="external free" rel="nofollow">irc://%0Aa</a>
 6606+<ul><li><ul><li><a rel="nofollow" class="external free" href="irc://%0Aa">irc://%0Aa</a>
66076607 </li></ul>
66086608 </li></ul>
66096609
@@ -6709,7 +6709,7 @@
67106710 <li class="gallerybox" style="width: 155px"><div style="width: 155px">
67116711 <div style="height: 150px;">Image5.svg</div>
67126712 <div class="gallerytext">
6713 -<p><a href="http://///////" class="external free" rel="nofollow">http://///////</a>
 6713+<p><a rel="nofollow" class="external free" href="http://///////">http://///////</a>
67146714 </p>
67156715 </div>
67166716 </div></li>
@@ -6876,7 +6876,7 @@
68776877 !! input
68786878 <abbr>(fr)</abbr> ISBN 2753300917 [http://www.example.com example.com]
68796879 !! result
6880 -<p><abbr>(fr)</abbr> <a href="https://www.mediawiki.org/wiki/Special:BookSources/2753300917" class="internal mw-magiclink-isbn">ISBN 2753300917</a> <a href="http://www.example.com" class="external text" rel="nofollow">example.com</a>
 6880+<p><abbr>(fr)</abbr> <a href="https://www.mediawiki.org/wiki/Special:BookSources/2753300917" class="internal mw-magiclink-isbn">ISBN 2753300917</a> <a rel="nofollow" class="external text" href="http://www.example.com">example.com</a>
68816881 </p>
68826882 !! end
68836883
@@ -6885,7 +6885,7 @@
68866886 !! input
68876887 RFC RFC 1234
68886888 !! result
6889 -<p>RFC <a href="http://tools.ietf.org/html/rfc1234" class="external mw-magiclink-rfc">RFC 1234</a>
 6889+<p>RFC <a class="external mw-magiclink-rfc" href="http://tools.ietf.org/html/rfc1234">RFC 1234</a>
68906890 </p>
68916891 !! end
68926892
@@ -6903,7 +6903,7 @@
69046904 !! input
69056905 RFC 983&#x20;987
69066906 !! result
6907 -<p><a href="http://tools.ietf.org/html/rfc983" class="external mw-magiclink-rfc">RFC 983</a>&#x20;987
 6907+<p><a class="external mw-magiclink-rfc" href="http://tools.ietf.org/html/rfc983">RFC 983</a>&#x20;987
69086908 </p>
69096909 !! end
69106910
@@ -6997,7 +6997,7 @@
69986998 !! input
69996999 [[image:Foobar.jpg|thumb|An [http://test/?param1=|left|&param2=|x external] URL]]
70007000 !! result
7001 -<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/3/3a/Foobar.jpg" width="180" height="20" class="thumbimage" /></a> <div class="thumbcaption"><div class="magnify"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="internal" title="Enlarge"><img src="/skins/common/images/magnify-clip.png" width="15" height="11" alt="" /></a></div>An <a href="http://test/?param1=%7Cleft%7C&amp;param2=%7Cx" class="external text" rel="nofollow">external</a> URL</div></div></div>
 7001+<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/3/3a/Foobar.jpg" width="180" height="20" class="thumbimage" /></a> <div class="thumbcaption"><div class="magnify"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="internal" title="Enlarge"><img src="/skins/common/images/magnify-clip.png" width="15" height="11" alt="" /></a></div>An <a rel="nofollow" class="external text" href="http://test/?param1=%7Cleft%7C&amp;param2=%7Cx">external</a> URL</div></div></div>
70027002
70037003 !!end
70047004
@@ -8002,7 +8002,7 @@
80038003 !! input
80048004 [http://en.wikipedia.org/]
80058005 !! result
8006 -<p><a href="http://en.wikipedia.org/" class="external autonumber" rel="nofollow">[۱]</a>
 8006+<p><a rel="nofollow" class="external autonumber" href="http://en.wikipedia.org/">[۱]</a>
80078007 </p>
80088008 !! end
80098009
Index: trunk/phase3/includes/parser/Parser.php
@@ -1111,10 +1111,9 @@
11121112 throw new MWException( __METHOD__.': unrecognised match type "' .
11131113 substr( $m[0], 0, 20 ) . '"' );
11141114 }
1115 - $url = wfMsgForContent( $urlmsg, $id);
 1115+ $url = wfMsgForContent( $urlmsg, $id );
11161116 $sk = $this->mOptions->getSkin( $this->mTitle );
1117 - $la = $sk->getExternalLinkAttributes( "external $CssClass" );
1118 - return "<a href=\"{$url}\"{$la}>{$keyword} {$id}</a>";
 1117+ return $sk->makeExternalLink( $url, "{$keyword} {$id}", true, $CssClass );
11191118 } elseif ( isset( $m[5] ) && $m[5] !== '' ) {
11201119 # ISBN
11211120 $isbn = $m[5];
Index: trunk/phase3/includes/Linker.php
@@ -23,8 +23,10 @@
2424 *
2525 * @param $class String: the contents of the class attribute; if an empty
2626 * string is passed, which is the default value, defaults to 'external'.
 27+ * @deprecated Just pass the external class directly to something using Html::expandAttributes
2728 */
2829 function getExternalLinkAttributes( $class = 'external' ) {
 30+ wfDeprecated( __METHOD__ );
2931 return $this->getLinkAttributesInternal( '', $class );
3032 }
3133
@@ -795,25 +797,17 @@
796798 * @param $escape Boolean: do we escape the link text?
797799 * @param $linktype String: type of external link. Gets added to the classes
798800 * @param $attribs Array of extra attributes to <a>
799 - *
800 - * @todo FIXME: This is a really crappy implementation. $linktype and
801 - * 'external' are mashed into the class attrib for the link (which is made
802 - * into a string). Then, if we've got additional params in $attribs, we
803 - * add to it. People using this might want to change the classes (or other
804 - * default link attributes), but passing $attribsText is just messy. Would
805 - * make a lot more sense to make put the classes into $attribs, let the
806 - * hook play with them, *then* expand it all at once.
807801 */
808802 function makeExternalLink( $url, $text, $escape = true, $linktype = '', $attribs = array() ) {
809 - if ( isset( $attribs['class'] ) ) {
810 - # yet another hack :(
811 - $class = $attribs['class'];
812 - } else {
813 - $class = "external $linktype";
 803+ $class = "external";
 804+ if ( isset($linktype) && $linktype ) {
 805+ $class .= " $linktype";
814806 }
815 -
816 - $attribsText = $this->getExternalLinkAttributes( $class );
817 - $url = htmlspecialchars( $url );
 807+ if ( isset($attribs['class']) && $attribs['class'] ) {
 808+ $class .= " {$attribs['class']}";
 809+ }
 810+ $attribs['class'] = $class;
 811+
818812 if ( $escape ) {
819813 $text = htmlspecialchars( $text );
820814 }
@@ -823,10 +817,8 @@
824818 wfDebug( "Hook LinkerMakeExternalLink changed the output of link with url {$url} and text {$text} to {$link}\n", true );
825819 return $link;
826820 }
827 - if ( $attribs ) {
828 - $attribsText .= Html::expandAttributes( $attribs );
829 - }
830 - return '<a href="' . $url . '"' . $attribsText . '>' . $text . '</a>';
 821+ $attribs['href'] = $url;
 822+ return Html::rawElement( 'a', $attribs, $text );
831823 }
832824
833825 /**
Index: trunk/phase3/includes/api/ApiParse.php
@@ -388,23 +388,16 @@
389389 return '';
390390 }
391391
392 - $sk = $wgUser->getSkin(); // @todo Kill this once we kill getExternalLinkAttributes
393 -
394392 $s = htmlspecialchars( wfMsg( 'otherlanguages' ) . wfMsg( 'colon-separator' ) );
395393
396394 $langs = array();
397395 foreach ( $languages as $l ) {
398396 $nt = Title::newFromText( $l );
399 - $url = $nt->escapeFullURL();
400397 $text = $wgContLang->getLanguageName( $nt->getInterwiki() );
401 - $title = htmlspecialchars( $nt->getText() );
402398
403 - if ( $text == '' ) {
404 - $text = $l;
405 - }
406 -
407 - $style = $sk->getExternalLinkAttributes(); // @fixme Linker::getExternalLinkAttributes is best off completely killed
408 - $langs[] = "<a href=\"{$url}\" title=\"{$title}\"{$style}>{$text}</a>"; // @fixme Use Html::
 399+ $langs[] = Html::element( 'a',
 400+ array( 'href' => $nt->getFullURL(), 'title' => $nt->getText(), 'class' => "external" ),
 401+ $text == '' ? $l : $text );
409402 }
410403
411404 $s .= implode( htmlspecialchars( wfMsgExt( 'pipe-separator', 'escapenoentities' ) ), $langs );
Index: trunk/phase3/includes/SkinLegacy.php
@@ -412,16 +412,11 @@
413413 $first = false;
414414
415415 $nt = Title::newFromText( $l );
416 - $url = $nt->escapeFullURL();
417416 $text = $wgContLang->getLanguageName( $nt->getInterwiki() );
418 - $title = htmlspecialchars( $nt->getText() );
419417
420 - if ( $text == '' ) {
421 - $text = $l;
422 - }
423 -
424 - $style = $this->getExternalLinkAttributes();
425 - $s .= "<a href=\"{$url}\" title=\"{$title}\"{$style}>{$text}</a>";
 418+ $s .= Html::element( 'a',
 419+ array( 'href' => $nt->getFullURL(), 'title' => $nt->getText(), 'class' => "external" ),
 420+ $text == '' ? $l : $text );
426421 }
427422
428423 if ( $wgContLang->isRTL() ) {

Comments

#Comment by Dantman (talk | contribs)   23:12, 5 February 2011

For reference the only thing I did to the parser tests was:

$ sed 's#<a\( href="[^">]*"\)\( class="[^">]*"\)\( rel="nofollow"\)>#<a\3\2\1>#' -i [...]
$ sed 's#<a\( href="[^">]*"\)\( class="external[^">]*"\)>#<a\2\1>#' -i [...]

Ran on both parserTests.txt and extraParserTests.txt, the first one was run on parserTests.txt three times since there were some tests with two or three links on the same line.

So nothing should be changed in the parser tests besides the ordering of some attributes to match what happened when I killed $attribsText and the hardcoded stuff in makeExternalLink.

Status & tagging log