Page MenuHomePhabricator

Error: Call to a member function getPrefixedText() on null (Special:Log)
Closed, ResolvedPublicPRODUCTION ERROR

Description

Error
normalized_message
[{reqId}] {exception_url}   Error: Call to a member function getPrefixedText() on null
exception.trace
from /srv/mediawiki/php-1.41.0-wmf.16/includes/specials/SpecialLog.php(174)
#0 /srv/mediawiki/php-1.41.0-wmf.16/includes/specialpage/SpecialPage.php(701): MediaWiki\Specials\SpecialLog->execute(string)
#1 /srv/mediawiki/php-1.41.0-wmf.16/includes/specialpage/SpecialPageFactory.php(1562): SpecialPage->run(string)
#2 /srv/mediawiki/php-1.41.0-wmf.16/includes/MediaWiki.php(328): MediaWiki\SpecialPage\SpecialPageFactory->executePath(string, RequestContext)
#3 /srv/mediawiki/php-1.41.0-wmf.16/includes/MediaWiki.php(927): MediaWiki->performRequest()
#4 /srv/mediawiki/php-1.41.0-wmf.16/includes/MediaWiki.php(581): MediaWiki->main()
#5 /srv/mediawiki/php-1.41.0-wmf.16/index.php(50): MediaWiki->run()
#6 /srv/mediawiki/php-1.41.0-wmf.16/index.php(46): wfIndexMain()
#7 /srv/mediawiki/w/index.php(3): require(string)
#8 {main}
Impact

Minor logspam.

Notes

Details

Request URL
https://ko.wiktionary.org/w/index.php?page=*&title=*
Related Changes in Gerrit:

Event Timeline

Affected code:

SpecialLog::execute()
		if ( in_array( $opts->getValue( 'type' ), self::getLogTypesOnUser( $this->getHookRunner() ) ) ) {
			# ok we have a type of log which expect a user title.
			$page = $opts->getValue( 'page' );
			$target = Title::newFromText( $page );
			if ( $target && $target->getNamespace() === NS_MAIN ) {
				if ( IPUtils::isValidRange( $target->getText() ) ) {
					$page = IPUtils::sanitizeRange( $target->getText() );
				}
				# User forgot to add 'User:', we are adding it for him
				$page = Title::makeTitleSafe( NS_USER, $page )->getPrefixedText();

Easy enough to reproduce locally: Special:Log?type=newusers&page=%23 (that’s a URL-encoded #)

Prior to SpecialLog: Fix some interface issues (follow-up to commit 2ac0720), this probably silently did the wrong thing instead of crashing (the old code had $opts->setValue( 'page', Title::makeTitleSafe( NS_USER, $page ) );).

Change 936705 had a related patch set uploaded (by Lucas Werkmeister (WMDE); author: Lucas Werkmeister (WMDE)):

[mediawiki/core@master] SpecialLog: Handle invalid title better

https://gerrit.wikimedia.org/r/936705

Change 936705 merged by jenkins-bot:

[mediawiki/core@master] SpecialLog: Handle invalid title better

https://gerrit.wikimedia.org/r/936705