From cbcc75067abd10f83055164ed4db000ef97b5c29 Mon Sep 17 00:00:00 2001
From: "Mark A. Hershberger"
Date: Wed, 27 Apr 2011 19:13:34 +0000
Subject: [PATCH] revert r76127, r76129, and r83535 b/c I'm backing out the fix
for bug #542. Fixing ancient bugs causes grief for many people.
---
includes/Linker.php | 12 ++----
tests/parser/parserTests.txt | 82 ++++++++++++++----------------------
2 files changed, 35 insertions(+), 59 deletions(-)
diff --git a/includes/Linker.php b/includes/Linker.php
index 2d36829e51..2274ff54bb 100644
--- a/includes/Linker.php
+++ b/includes/Linker.php
@@ -201,7 +201,7 @@ class Linker {
$attribs = array_merge(
$attribs,
- self::linkAttribs( $target, $customAttribs, $options, $text )
+ self::linkAttribs( $target, $customAttribs, $options )
);
if ( is_null( $text ) ) {
$text = self::linkText( $target );
@@ -258,7 +258,7 @@ class Linker {
*
* @param $target Title
*/
- private static function linkAttribs( $target, $attribs, $options, $linkText ) {
+ private static function linkAttribs( $target, $attribs, $options ) {
wfProfileIn( __METHOD__ );
global $wgUser;
$defaults = array();
@@ -289,16 +289,12 @@ class Linker {
}
# Get a default title attribute.
- global $wgLang;
- $known = in_array( 'known', $options );
if ( $target->getPrefixedText() == '' ) {
# A link like [[#Foo]]. This used to mean an empty title
# attribute, but that's silly. Just don't output a title.
- } elseif ( $known &&
- $wgLang->caseFold($linkText) !== $wgLang->caseFold($target->getPrefixedText() ) )
- {
+ } elseif ( in_array( 'known', $options ) ) {
$defaults['title'] = $target->getPrefixedText();
- } elseif ( !$known ) {
+ } else {
$defaults['title'] = wfMsg( 'red-link-title', $target->getPrefixedText() );
}
diff --git a/tests/parser/parserTests.txt b/tests/parser/parserTests.txt
index a929ca293f..062c43e5f9 100644
--- a/tests/parser/parserTests.txt
+++ b/tests/parser/parserTests.txt
@@ -1911,7 +1911,7 @@ Plain link, capitalized
!! input
[[Main Page]]
!! result
-Main Page
+
Main Page
!! end
@@ -1920,7 +1920,7 @@ Plain link, uncapitalized
!! input
[[main Page]]
!! result
-main Page
+
main Page
!! end
@@ -1974,7 +1974,7 @@ Link with prefix
!! input
xxx[[main Page]], xxx[[Main Page]], Xxx[[main Page]] XXX[[main Page]], XXX[[Main Page]]
!! result
-xxxmain Page, xxxMain Page, Xxxmain Page XXXmain Page, XXXMain Page
+
xxxmain Page, xxxMain Page, Xxxmain Page XXXmain Page, XXXMain Page
!! end
@@ -1983,7 +1983,7 @@ Link with suffix
!! input
[[Main Page]]xxx, [[Main Page]]XXX, [[Main Page]]!!!
!! result
-Main Pagexxx, Main PageXXX, Main Page!!!
+
Main Pagexxx, Main PageXXX, Main Page!!!
!! end
@@ -2216,7 +2216,7 @@ title=[[0]]
!!input
[[00]]
!!result
-00
+
00
!!end
@@ -2245,7 +2245,7 @@ language=ca
!! input
'''[[Main Page]]'''
!! result
-Main Page
+
Main Page
!! end
@@ -2256,7 +2256,7 @@ language=ca
!! input
''[[Main Page]]''
!! result
-Main Page
+
Main Page
!! end
@@ -2302,7 +2302,7 @@ Inline interwiki link
!! input
[[MeatBall:SoftSecurity]]
!! result
-MeatBall:SoftSecurity
+
MeatBall:SoftSecurity
!! end
@@ -2311,7 +2311,7 @@ Inline interwiki link with empty title (bug 2372)
!! input
[[MeatBall:]]
!! result
-MeatBall:
+
MeatBall:
!! end
@@ -3220,7 +3220,7 @@ Template as link source
!! input
[[{{linktest2}}]]
!! result
-Main Page
+
Main Page
!! end
@@ -3242,7 +3242,7 @@ Template infinite loop
!! input
{{loop1}}
!! result
-Template loop detected: Template:Loop1
+
Template loop detected: Template:Loop1
!! end
@@ -4065,7 +4065,7 @@ Image with frame and link
!! input
[[Image:Foobar.jpg|frame|left|This is a test image [[Main Page]]]]
!! result
-
+
!! end
@@ -4074,7 +4074,7 @@ Image with frame and link and explicit alt
!! input
[[Image:Foobar.jpg|frame|left|This is a test image [[Main Page]]|alt=Altitude]]
!! result
-
+
!! end
@@ -4274,7 +4274,7 @@ Redirected image
!! input
[[Image:Barfoo.jpg]]
!! result
-File:Barfoo.jpg
+
File:Barfoo.jpg
!! end
@@ -4285,7 +4285,7 @@ wgEnableUploads=0
!! input
[[Image:Foobaz.jpg]]
!! result
-File:Foobaz.jpg
+
File:Foobaz.jpg
!! end
@@ -4355,7 +4355,7 @@ Link to category
!! input
[[:Category:MediaWiki User's Guide]]
!! result
-Category:MediaWiki User's Guide
+
Category:MediaWiki User's Guide
!! end
@@ -5025,7 +5025,7 @@ The page's name is U+05d0 U+05b7, with non-canonical form U+FB2E
אַ
אÖ·
×ַ
-×Ö·
+×Ö·
!! end
@@ -5088,7 +5088,7 @@ Bug 2095: link with three closing brackets
!! input
[[Main Page]]]
!! result
-Main Page]
+
Main Page]
!! end
@@ -6291,7 +6291,7 @@ Special page transclusion
!! result
-
+
!! end
@@ -6304,10 +6304,10 @@ Special page transclusion twice (bug 5021)
!! result
-
+
-
+
!! end
@@ -7202,7 +7202,7 @@ Special:Search page linking.
!! input
{{Special:search}}
!! result
-Special:Search
+
Special:Search
!! end
@@ -7316,7 +7316,7 @@ image:foobar.jpg|Blabla|alt=This is a foo-bar.|blabla.
!! result
- - Foo Main Page
+ - Foo Main Page
Nonexistant.jpg
@@ -7332,7 +7332,7 @@ image:foobar.jpg|Blabla|alt=This is a foo-bar.|blabla.
@@ -7409,7 +7409,7 @@ caption
Foobar.jpg
-some caption Main Page
+some caption Main Page
@@ -8035,7 +8035,7 @@ language=sr
!! input
[[Main Page]] can be written as [[Ðаин Ðаге]] same as [[Ðаин Ðаге]].
!! result
-
Main Page can be written as Ðаин Ðаге same as Ðаин Ðаге.
+
Main Page can be written as Ðаин Ðаге same as Ðаин Ðаге.
!!end
@@ -8130,7 +8130,7 @@ language=sr variant=sr-ec
!! input
-{[[Main Page]]}-
!! result
-
Main Page
+
Main Page
!! end
@@ -8637,9 +8637,9 @@ wgLinkHolderBatchSize=0
[[meatball:2]]
[[meatball:3]]
!! result
-
meatball:1
-meatball:2
-meatball:3
+
meatball:1
+meatball:2
+meatball:3
!! end
@@ -8756,7 +8756,7 @@ comment
!! input
I like the [[Main Page]] a lot
!! result
-I like the
Main Page a lot
+I like the
Main Page a lot
!!end
!! test
@@ -9108,26 +9108,6 @@ Special characters in embedded file links (bug 27679)
!! end
-!! article
-A
-!! text
-A
-!! endarticle
-
-!! article
-Ã
-!! text
-Ã
-!! endarticle
-
-!! test
-Bug#542 Link text shouldn't be duplicated in title attributes
-!! input
-[[A]] [[a]] [[Ã]] [[ä]]
-!! result
-
A a à ä
-
-!! end
TODO:
more images
--
2.20.1