Index: trunk/phase3/tests/parser/parserTests.txt |
— | — | @@ -8433,7 +8433,27 @@ |
8434 | 8434 | </p> |
8435 | 8435 | !! end |
8436 | 8436 | |
| 8437 | +!! article |
| 8438 | +A |
| 8439 | +!! text |
| 8440 | +A |
| 8441 | +!! endarticle |
8437 | 8442 | |
| 8443 | +!! article |
| 8444 | +Ä |
| 8445 | +!! text |
| 8446 | +Ä |
| 8447 | +!! endarticle |
| 8448 | + |
| 8449 | +!! test |
| 8450 | +Bug#542 Link text shouldn't be duplicated in title attributes |
| 8451 | +!! input |
| 8452 | +[[A]] [[a]] [[Ä]] [[ä]] |
| 8453 | +!! result |
| 8454 | +<p><a href="https://www.mediawiki.org/wiki/A">A</a> <a href="https://www.mediawiki.org/wiki/A">a</a> <a href="https://www.mediawiki.org/wiki/%C3%84">Ä</a> <a href="https://www.mediawiki.org/wiki/%C3%84">ä</a> |
| 8455 | +</p> |
| 8456 | +!! end |
| 8457 | + |
8438 | 8458 | TODO: |
8439 | 8459 | more images |
8440 | 8460 | more tables |
Index: trunk/phase3/includes/Linker.php |
— | — | @@ -286,11 +286,14 @@ |
287 | 287 | } |
288 | 288 | |
289 | 289 | # Get a default title attribute. |
| 290 | + global $wgLang; |
290 | 291 | $known = in_array( 'known', $options ); |
291 | 292 | if ( $target->getPrefixedText() == '' ) { |
292 | 293 | # A link like [[#Foo]]. This used to mean an empty title |
293 | 294 | # attribute, but that's silly. Just don't output a title. |
294 | | - } elseif ( $known && strtolower($linkText) !== strtolower($target->getPrefixedText() ) ) { |
| 295 | + } elseif ( $known && |
| 296 | + $wgLang->caseFold($linkText) !== $wgLang->caseFold($target->getPrefixedText() ) ) |
| 297 | + { |
295 | 298 | $defaults['title'] = $target->getPrefixedText(); |
296 | 299 | } elseif ( !$known ) { |
297 | 300 | $defaults['title'] = wfMsg( 'red-link-title', $target->getPrefixedText() ); |