Page MenuHomePhabricator

DoubleRedirectConstraint fails to re-validate when redirect target changes between redirect pages
Closed, ResolvedPublicBUG REPORT

Description

Steps to replicate the issue

  • Try to create a redirect to another redirect. E.g. on English Wikipedia, [[USA]], which redirects to [[United States]].
  • An error is thrown (expected behaviour), which suggests the target be changed (e.g. to [[United States]])
  • Ignore these instructions, and instead redirect to a different redirect page (e.g. to [[United States of America]]), or some other redirect with a different target, e.g. [[Republic of France]].

What happens?

What I think will happen here is that it will allow the creation of a double redirect because the self-constraint is passed.

What should have happened here instead?

Another warning should have been thrown about this edit attempt.

Notes

The key condition in checkConstraint() is:

if ( !$currentTarget || !$currentTarget->isRedirect() ) {
    // fail constraint
}

Event Timeline

Change #1153950 had a related patch set uploaded (by Gerrit Patch Uploader; author: Finchgold):

[mediawiki/core@master] Fixes T395768 DoubleRedirectConstraint fails to re-validate when redirect target changes between redirect pages

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

Change #1153950 had a related patch set uploaded (by Pppery; author: Finchgold):

[mediawiki/core@master] DoubleRedirectConstraint: show error when changing from one double redirect to a different double redirecy

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

Change #1175966 had a related patch set uploaded (by SomeRandomDeveloper; author: SomeRandomDeveloper):

[mediawiki/core@master] DoubleRedirectConstraint: fail if target changed but is still a redirect

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

Change #1176231 had a related patch set uploaded (by SomeRandomDeveloper; author: SomeRandomDeveloper):

[mediawiki/core@master] Merge all redirect constraints into one

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

Change #1153950 abandoned by Bartosz Dziewoński:

[mediawiki/core@master] DoubleRedirectConstraint: show error when changing from one double redirect to a different double redirecy

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

Change #1175966 abandoned by SomeRandomDeveloper:

[mediawiki/core@master] DoubleRedirectConstraint: fail if target changed but is still a redirect

Reason:

in favor of 1176231

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

Change #1176231 merged by jenkins-bot:

[mediawiki/core@master] editpage: merge all redirect constraints into one

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