Incorrect values concerning Page.IsRedirect() and Page.RedirectsTo()
Make robots for MediaWiki-powered sites!
Brought to you by:
code_driller
The MediaWiki software doesn't handle a page as redirect if the page text doesn't start with #REDIRECT. For instance, see https://de.wikibooks.org/w/index.php?title=Linux-Kompendium:_Links.
{{Delete|no more redirect [[Benutzer:Qwertz84|Qwertz84]] 15:03, 15. Dez. 2016 (CET)}}
#REDIRECT [[Linux-Praxisbuch: Links]]
In contradiction, the bot returns IsRedirect() as "true" and RedirectsTo() as "Linux-Praxisbuch: Links".
Compare https://de.wikibooks.org/w/index.php?title=SQL. This page text starts with the redirect:
#REDIRECT [[Einführung in SQL]]
{{Nicht löschen|grund=sinnvolle Weiterleitung|signatur=[[Benutzer:Juetho|Jürgen]] 08:05, 9. Mai 2014 (CEST)}}
Solution
The Page.IsRedirect() method has to check something like:
if(text.StartsWith("#REDIRECT"))
Clearly, this snippet must be extended by generalData["redirectTags"].
This bug is less important, but it should be corrected. Thanks, Juergen
You are mistaken. I just checked it out, IsRedirect() does not return "true" in this situation.
What version are you using?