"Jason Y. Lee" jylee@cs.ucr.edu wrote:
The getReferences() function needs to be re-written due to the new change in the What links here page since the addition of '(inclusion)' marking
things
as templates. The reason is that the current regex will count that as a redirect.
OK, I've checked in a patch that seems to work in my testing. The key is that a (redirect) link is followed by a <ul> tag, while an (inclusion) link is not. I've also updated the code to check for false-positive redirects; this deals with things like redirect templates (#REDIRECT [[Fubar]] {{R from misspelling}}), which MediaWiki incorrectly treats as a redirect to *every* page linked from the included template.
In fact, if you had a page that read "#REDIRECT [[Foo]] [[Bar]]", it would show up on [[Special:Whatlinkshere/Bar]] as a redirect, even though the link to [[Bar]] is invisible to users unless they try to edit the redirect page. Weird. This patch hopefully will ignore such items on the Whatlinkshere page, although at the cost of slower performance (more page loads).
If you find any bugs, please let me know (here or on en:User talk:RussBlau).