r83521 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r83520‎ | r83521 | r83522 >
Date:14:38, 8 March 2011
Author:mah
Status:reverted (Comments)
Tags:
Comment:
followup r76127 — use language-aware comparison between link text and possible title attribute
Modified paths:
  • /trunk/phase3/includes/Linker.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Linker.php
@@ -290,7 +290,8 @@
291291 if ( $target->getPrefixedText() == '' ) {
292292 # A link like [[#Foo]]. This used to mean an empty title
293293 # attribute, but that's silly. Just don't output a title.
294 - } elseif ( $known && strtolower($linkText) !== strtolower($target->getPrefixedText() ) ) {
 294+ } elseif ( $known &&
 295+ Language::lc($linkText) !== Language::lc($target->getPrefixedText() ) ) {
295296 $defaults['title'] = $target->getPrefixedText();
296297 } elseif ( !$known ) {
297298 $defaults['title'] = wfMsg( 'red-link-title', $target->getPrefixedText() );

Follow-up revisions

RevisionCommit summaryAuthorDate
r83526revert r83521; this needs to be fixed better, but fixing the crash is first p...vyznev15:54, 8 March 2011
r83535* Followup r76127 and r83521 by adding parsertests and using caseFoldmah18:09, 8 March 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r76127Resolves Bug#542 by removing the link title from in-wiki links where...mah19:06, 5 November 2010

Comments

#Comment by OverlordQ (talk | contribs)   15:39, 8 March 2011

Fatal error: Call to undefined method SkinMonoBook::isMultibyte() in /var/www/site/w/languages/Language.php on line 1754

#Comment by Ilmari Karonen (talk | contribs)   15:55, 8 March 2011

Reverted in r83526.

I'm pretty sure using either strtolower() or Language::lc() is wrong here: titles are only case-insensitive in their first letter (and namespace). To be able to say what would be more appropriate here, though, I'd first have to understand just what this code is trying to accomplish...

#Comment by Ilmari Karonen (talk | contribs)   15:57, 8 March 2011

BTW, the fatal error is because Language::lc() is not meant to be called as a static method. You should've called it as $wgContLang->lc() or something instead.

Status & tagging log