From 3f493982942e5112788dd8372d92acb3f70e12d7 Mon Sep 17 00:00:00 2001 From: Aryeh Gregor Date: Mon, 27 Oct 2008 23:57:43 +0000 Subject: [PATCH] Allow '0' as an accesskey. PHP weak typing strikes again! --- RELEASE-NOTES | 1 + includes/Linker.php | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 2632c39963..88a32366f7 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -289,6 +289,7 @@ The following extensions are migrated into MediaWiki 1.14: JavaScript is disabled. * (bug 4253) Recentchanges IRC messages no longer include title in diff URLs and the comment is trimmed if necessary to maintain proper message length. +* Allow '0' to be an accesskey. === API changes in 1.14 === diff --git a/includes/Linker.php b/includes/Linker.php index 8981947100..ad41cb01aa 100644 --- a/includes/Linker.php +++ b/includes/Linker.php @@ -1719,7 +1719,7 @@ class Linker { } $accesskey = wfMsg( "accesskey-$name" ); - if( $accesskey && $accesskey != '-' && + if( $accesskey != '' && $accesskey != '-' && !wfEmptyMsg( "accesskey-$name", $accesskey ) ) { if( isset( $attribs['title'] ) ) { $attribs['title'] .= " [$accesskey]"; @@ -1756,7 +1756,7 @@ class Linker { if( isset( $attribs['title'] ) && $options == 'withaccess' ) { $accesskey = wfMsg( "accesskey-$name" ); - if( $accesskey && $accesskey != '-' && + if( $accesskey != '' && $accesskey != '-' && !wfEmptyMsg( "accesskey-$name", $accesskey ) ) { $attribs['title'] .= " [$accesskey]"; } -- 2.20.1