Page MenuHomePhabricator

Backlinks API gives different results from Special:WhatLinksHere when a redirect contains links other than the redirect target
Open, Needs TriagePublic

Description

The backlinks query API gives different results from Special:WhatLinksHere when a redirect contains links other than the redirect target. This caused an issue with XFDcloser removing the wrong links a few days ago. I've created a minimal test case over on the Test Wikipedia which should reproduce it — WhatLinksHere for Page1 (archive) and backlinks for Page1 (archive) both correctly show pages that link to the redirect, while WhatLinksHere for Page2 (archive) does not show pages that link to the redirect (as the redirect only links to Page2; it doesn't redirect to it). However, backlinks for Page2 (archive) incorrectly includes pages linking to the redirect, even though those links do not go to Page2 since the redirect does not target Page2.

This is probably the same issue as T125331, but in that case the user could switch to a different API; for XFDcloser backlinks seems to be the correct option.