Page MenuHomePhorge

Fix an error regarding GlobalSettings
Closed, ResolvedPublic

Description


While setting up OAuth , an issue occured - GlobalSettings.php was treating the REST API page as a wiki page, thus it can't find its title because it doesn't exist. Even though BeforePageDisplay is being used. The error persisted.

Event Timeline

jazz triaged this task as Normal priority.May 14 2025, 2:52 PM
jazz added a project: mw-config.
jazz subscribed.

I believe SkyWiki's GlobalSettings.php is not publicly available, but I'm assuming it's similar to Miraheze's GlobalSettings, where this appears to be the problematic code (lines 18–23):

$wgHooks['BeforePageDisplay'][] = static function ( &$out, &$skin ) {
	if ( $out->getTitle()->isSpecialPage() ) {
		$out->setRobotPolicy( 'noindex,nofollow' );
	}
	return true;
};

If so, is there any good reason not to replace the hook with $wgNamespaceRobotPolicies, a built-in MediaWiki configuration variable?

$wgNamespaceRobotPolicies[NS_SPECIAL] = 'noindex,nofollow';

Seems like that would accomplish the same purpose.

jazz changed the visibility from "All Users" to "Public (No Login Required)".May 15 2025, 11:01 PM