Menu

#113 Incorrect values concerning Page.IsRedirect() and Page.RedirectsTo()

closed-invalid
nobody
None
2017-03-13
2017-02-20
No

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

Discussion

  • CodeDriller

    CodeDriller - 2017-02-25

    You are mistaken. I just checked it out, IsRedirect() does not return "true" in this situation.

    // Testing code snippet, DotNetWikiBot 3.15
    Site dewb = new Site("https://de.wikibooks.org");
    Page p = new Page(dewb, "Linux-Kompendium:_Links");
    p.Load();
    p.IsRedirect();
    // false is returned
    

    What version are you using?

     
  • CodeDriller

    CodeDriller - 2017-03-13
    • status: open --> closed-invalid
     

Log in to post a comment.