From 9e2a5e5152570fadf03ed70594a80a3c87558d4d Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Thu, 24 Nov 2005 00:00:30 +0000 Subject: [PATCH] * (bug 3922) bidi embedding overrides on category links Based on gangleri's suggestion in http://bugzilla.wikimedia.org/show_bug.cgi?id=03922#c11 --- RELEASE-NOTES | 1 + includes/Skin.php | 13 ++++++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 3760de6414..cf8f4db441 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -245,6 +245,7 @@ fully support the editing toolbar, but was found to be too confusing. * (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 === diff --git a/includes/Skin.php b/includes/Skin.php index 58b92cd6c1..0fa54683ae 100644 --- a/includes/Skin.php +++ b/includes/Skin.php @@ -421,15 +421,18 @@ END; 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() ) ) -- 2.20.1