) {
$userId = $rev->getUser( Revision::FOR_THIS_USER );
$userText = $rev->getUserText( Revision::FOR_THIS_USER );
- if ( $userId && $userText ) {
+ if ( $userId || (string)$userText !== '' ) {
$link = self::userLink( $userId, $userText )
. self::userToolLinks( $userId, $userText, false, 0, null,
$useParentheses );
*
* @since 1.16.3
* @param string $toc Html of the Table Of Contents
- * @param string|Language|bool|null $lang Language for the toc title, defaults to user language.
- * The types string and bool are deprecated.
+ * @param Language|null $lang Language for the toc title, defaults to user language
* @return string Full html of the TOC
*/
- public static function tocList( $toc, $lang = null ) {
+ public static function tocList( $toc, Language $lang = null ) {
$lang = $lang ?? RequestContext::getMain()->getLanguage();
- if ( !$lang instanceof Language ) {
- wfDeprecated( __METHOD__ . ' with type other than Language for $lang', '1.33' );
- $lang = wfGetLangObj( $lang );
- }
$title = wfMessage( 'toc' )->inLanguage( $lang )->escaped();
*
* @since 1.16.3. $lang added in 1.17
* @param array $tree Return value of ParserOutput::getSections()
- * @param string|Language|bool|null $lang Language for the toc title, defaults to user language.
- * The types string and bool are deprecated.
+ * @param Language|null $lang Language for the toc title, defaults to user language
* @return string HTML fragment
*/
- public static function generateTOC( $tree, $lang = null ) {
+ public static function generateTOC( $tree, Language $lang = null ) {
$toc = '';
$lastLevel = 0;
foreach ( $tree as $section ) {