Index: trunk/phase3/includes/Linker.php |
— | — | @@ -1628,13 +1628,16 @@ |
1629 | 1629 | public function titleAttrib( $name, $options = null ) { |
1630 | 1630 | wfProfileIn( __METHOD__ ); |
1631 | 1631 | |
1632 | | - $tooltip = wfMsg( "tooltip-$name" ); |
1633 | | - # Compatibility: formerly some tooltips had [alt-.] hardcoded |
1634 | | - $tooltip = preg_replace( "/ ?\[alt-.\]$/", '', $tooltip ); |
1635 | | - |
1636 | | - # Message equal to '-' means suppress it. |
1637 | | - if ( wfEmptyMsg( "tooltip-$name", $tooltip ) || $tooltip == '-' ) { |
| 1632 | + if ( wfEmptyMsg( "tooltip-$name" ) ) { |
1638 | 1633 | $tooltip = false; |
| 1634 | + } else { |
| 1635 | + $tooltip = wfMsg( "tooltip-$name" ); |
| 1636 | + # Compatibility: formerly some tooltips had [alt-.] hardcoded |
| 1637 | + $tooltip = preg_replace( "/ ?\[alt-.\]$/", '', $tooltip ); |
| 1638 | + # Message equal to '-' means suppress it. |
| 1639 | + if ( $tooltip == '-' ) { |
| 1640 | + $tooltip = false; |
| 1641 | + } |
1639 | 1642 | } |
1640 | 1643 | |
1641 | 1644 | if ( $options == 'withaccess' ) { |
— | — | @@ -1665,18 +1668,20 @@ |
1666 | 1669 | public function accesskey( $name ) { |
1667 | 1670 | wfProfileIn( __METHOD__ ); |
1668 | 1671 | |
1669 | | - $accesskey = wfMsg( "accesskey-$name" ); |
1670 | | - |
1671 | | - # FIXME: Per standard MW behavior, a value of '-' means to suppress the |
1672 | | - # attribute, but this is broken for accesskey: that might be a useful |
1673 | | - # value. |
1674 | | - if( $accesskey != '' && $accesskey != '-' && !wfEmptyMsg( "accesskey-$name", $accesskey ) ) { |
1675 | | - wfProfileOut( __METHOD__ ); |
1676 | | - return $accesskey; |
| 1672 | + if ( wfEmptyMsg( "accesskey-$name" ) ) { |
| 1673 | + $accesskey = false; |
| 1674 | + } else { |
| 1675 | + $accesskey = wfMsg( "accesskey-$name" ); |
| 1676 | + if ( $accesskey === '' || $accesskey === '-' ) { |
| 1677 | + # FIXME: Per standard MW behavior, a value of '-' means to suppress the |
| 1678 | + # attribute, but this is broken for accesskey: that might be a useful |
| 1679 | + # value. |
| 1680 | + $accesskey = false; |
| 1681 | + } |
1677 | 1682 | } |
1678 | 1683 | |
1679 | 1684 | wfProfileOut( __METHOD__ ); |
1680 | | - return false; |
| 1685 | + return $accesskey; |
1681 | 1686 | } |
1682 | 1687 | |
1683 | 1688 | /** |
— | — | @@ -2038,7 +2043,7 @@ |
2039 | 2044 | } |
2040 | 2045 | |
2041 | 2046 | /** |
2042 | | - * Returns the attributes for the tooltip and access key |
| 2047 | + * Returns the attributes for the tooltip and access key. |
2043 | 2048 | */ |
2044 | 2049 | public function tooltipAndAccesskeyAttribs( $name ) { |
2045 | 2050 | global $wgEnableTooltipsAndAccesskeys; |