Page MenuHomePhabricator

wmf-config/CommonSettings.php SpecialVersionVersionUrl hook does not check for regex match before using
Closed, ResolvedPublicPRODUCTION ERROR

Description

Nov 24 16:39:04 deployment-mediawiki01 hhvm: #012Notice: Undefined index: 1 in /srv/mediawiki/wmf-config/CommonSettings.php on line 2913
Nov 24 16:39:04 deployment-mediawiki01 hhvm: #012Notice: Undefined index: 2 in /srv/mediawiki/wmf-config/CommonSettings.php on line 2913

// On Special:Version, link to useful release notes
$wgHooks['SpecialVersionVersionUrl'][] = function( $wgVersion, &$versionUrl ) {
    $matches = array();
    preg_match( "/(\d+\.\d+)wmf(\d+)/", $wgVersion, $matches );
    $versionUrl = "https://www.mediawiki.org/wiki/MediaWiki_{$matches[1]}/wmf{$matches[2]}";
    return false;
};

Details

Event Timeline

bd808 raised the priority of this task from to Needs Triage.
bd808 updated the task description. (Show Details)
bd808 changed Security from none to None.
bd808 added a subscriber: Reedy.
bd808 subscribed.

Yeah. The code shouldn't assume that we'll always have a wmf-named branch in production.

However on the other hand, this code shouldn't run in beta where we (by design) don't have wmf branches.

Change 191927 had a related patch set uploaded (by Chad):
Tidy up SpecialVersionUrl hook usage

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

Patch-For-Review

Change 191927 merged by jenkins-bot:
Tidy up SpecialVersionUrl hook usage

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

demon claimed this task.
demon triaged this task as Medium priority.Jul 9 2015, 4:40 PM
mmodell changed the subtype of this task from "Task" to "Production Error".Aug 28 2019, 11:12 PM