* (bug 4020) Update namespaces for ms
* (bug 2894) Enhanced Recent Changes link fixes
* (bug 4059) fix 'hide minor edits' on Recentchangeslinked
+* (bug 3922) bidi embedding overrides on category links
=== Caveats ===
function getCategoryLinks () {
global $wgOut, $wgTitle, $wgParser;
- global $wgUseCategoryMagic, $wgUseCategoryBrowser, $wgLang;
+ global $wgUseCategoryMagic, $wgUseCategoryBrowser, $wgContLang;
if( !$wgUseCategoryMagic ) return '' ;
if( count( $wgOut->mCategoryLinks ) == 0 ) return '';
- # Taken out so that they will be displayed in previews -- TS
- #if( !$wgOut->isArticle() ) return '';
-
- $t = implode ( ' | ' , $wgOut->mCategoryLinks );
+ // Use Unicode bidi embedding override characters,
+ // to make sure links don't smash each other up in ugly ways.
+ // FIXME: should we use 'dir=emded' or something on links instead?
+ $embed = $wgContLang->isRTL() ? '‫' : '‪';
+ $pop = '‬';
+ $t = $embed . implode ( "$pop | $embed" , $wgOut->mCategoryLinks ) . $pop;
+
$msg = count( $wgOut->mCategoryLinks ) === 1 ? 'categories1' : 'categories';
$s = $this->makeKnownLinkObj( Title::makeTitle( NS_SPECIAL, 'Categories' ),
wfMsg( $msg ), 'article=' . urlencode( $wgTitle->getPrefixedDBkey() ) )