*/
public static function userLink( $userId, $userName, $altUserName = false ) {
if ( $userName === '' ) {
- wfLogWarning( __METHOD__ . ' received an empty username. Are there database errors ' .
+ wfDebug( __METHOD__ . ' received an empty username. Are there database errors ' .
'that need to be fixed?' );
return wfMessage( 'empty-username' )->parse();
}
$useParentheses = true
) {
if ( $userText === '' ) {
- wfLogWarning( __METHOD__ . ' received an empty username. Are there database errors ' .
+ wfDebug( __METHOD__ . ' received an empty username. Are there database errors ' .
'that need to be fixed?' );
return ' ' . wfMessage( 'empty-username' )->parse();
}
*/
public static function userTalkLink( $userId, $userText ) {
if ( $userText === '' ) {
- wfLogWarning( __METHOD__ . ' received an empty username. Are there database errors ' .
+ wfDebug( __METHOD__ . ' received an empty username. Are there database errors ' .
'that need to be fixed?' );
return wfMessage( 'empty-username' )->parse();
}
*/
public static function blockLink( $userId, $userText ) {
if ( $userText === '' ) {
- wfLogWarning( __METHOD__ . ' received an empty username. Are there database errors ' .
+ wfDebug( __METHOD__ . ' received an empty username. Are there database errors ' .
'that need to be fixed?' );
return wfMessage( 'empty-username' )->parse();
}
// that starts with "#". Before PHP 7 (and still on HHVM) substr() would
// return false if the start offset is the end of the string.
// On PHP 7+, it gracefully returns empty string instead.
- if ( $section === false ) {
- $section = '';
- }
- if ( $local ) {
- $sectionTitle = new TitleValue( NS_MAIN, '', $section );
- } else {
- $sectionTitle = $title->createFragmentTarget( $section );
- }
- if ( $sectionTitle ) {
+ if ( $section !== '' && $section !== false ) {
+ if ( $local ) {
+ $sectionTitle = new TitleValue( NS_MAIN, '', $section );
+ } else {
+ $sectionTitle = $title->createFragmentTarget( $section );
+ }
$auto = Linker::makeCommentLink(
- $sectionTitle, $wgLang->getArrow() . $wgLang->getDirMark() . $sectionText,
- $wikiId, 'noclasses'
+ $sectionTitle,
+ $wgLang->getArrow() . $wgLang->getDirMark() . $sectionText,
+ $wikiId,
+ 'noclasses'
);
}
}