Page MenuHomePhabricator

ConditionalDefaultsLookup: CUDCOND_AFTER with invalid timestamp enables conditional default for all users
Closed, ResolvedPublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

Add config to $wgConditionalUserOptions with CUDCOND_AFTER set to something that is not a valid timestamp:

$wgConditionalUserOptions['my-preference'] = [
      [ 1, [ CUDCOND_AFTER, 'not-valid' ] ]                                                                                                                                                                                                                                                                                                                           
  ];

What happens?:

This will cause any registered user's option default will resolve to 1, regardless of their registration date

What should have happened instead?:

The condition should not match in this situation, and a warning logged to help alert to this misconfiguration.

Software version (on Special:Version page; skip for WMF-hosted wikis like Wikipedia):

Other information (browser name/version, screenshots, etc.):

Event Timeline

Change #1250585 had a related patch set uploaded (by Aude; author: Aude):

[mediawiki/core@master] ConditionalDefaultsLookup: Handle invalid CUDCOND_AFTER timestamp

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

This is a follow up task for https://phabricator.wikimedia.org/T419163, to make sure if the config is invalid, then we don't just opt users into the beta feature.

Change #1250585 merged by jenkins-bot:

[mediawiki/core@master] ConditionalDefaultsLookup: Handle invalid CUDCOND_AFTER timestamp

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