r18513 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r18512‎ | r18513 | r18514 >
Date:00:28, 23 December 2006
Author:brion
Status:old
Tags:
Comment:
* (bug 3696) Strip LRM and RLM characters from titles to work around the
problem some people have where titles cut-and-pasted from lists include
the bidi override characters appended to the lists.
A more thorough blacklist for forbidden and translatable characters would
be wise, though, as might a cleaner method for the lists in the first place.
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/Title.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Title.php
@@ -1477,10 +1477,18 @@
14781478
14791479 $this->mInterwiki = $this->mFragment = '';
14801480 $this->mNamespace = $this->mDefaultNamespace; # Usually NS_MAIN
 1481+
 1482+ $dbkey = $this->mDbkeyform;
14811483
 1484+ # Strip Unicode bidi override characters.
 1485+ # Sometimes they slip into cut-n-pasted page titles, where the
 1486+ # override chars get included in list displays.
 1487+ $dbkey = str_replace( "\xE2\x80\x8E", '', $dbkey ); // 200E LEFT-TO-RIGHT MARK
 1488+ $dbkey = str_replace( "\xE2\x80\x8F", '', $dbkey ); // 200F RIGHT-TO-LEFT MARK
 1489+
14821490 # Clean up whitespace
14831491 #
1484 - $dbkey = preg_replace( '/[ _]+/', '_', $this->mDbkeyform );
 1492+ $dbkey = preg_replace( '/[ _]+/', '_', $dbkey );
14851493 $dbkey = trim( $dbkey, '_' );
14861494
14871495 if ( '' == $dbkey ) {
Index: trunk/phase3/RELEASE-NOTES
@@ -381,8 +381,12 @@
382382 * (bug 8231) Gave useful alt text to the main <img> on image pages
383383 * (bug 371) Remove alt text for "Enlarge" icon on thumbnails
384384 * Initialize user_editcount to 0 instead of NULL for newly created accounts
 385+* (bug 3696) Strip LRM and RLM characters from titles to work around the
 386+ problem some people have where titles cut-and-pasted from lists include
 387+ the bidi override characters appended to the lists.
 388+ A more thorough blacklist for forbidden and translatable characters would
 389+ be wise, though, as might a cleaner method for the lists in the first place.
385390
386 -
387391 == Languages updated ==
388392
389393 * Basque (eu)