cip/WikiOnBoard — Issue #66: Links not working if welcome page shown before
Author: cip
Created: 2011-11-01 09:28:58+00:00
State: open
Labels: BUG

Appearantly not all zim files affected.
Observed with wikipedia-de.zim while wikipedia_de_all_10_2010_beta1.zim fine.

Occurs after first installation (welcome page automatically shown). Works fine after restarting app.
Also occurs if help is manually openend.
To reproduce: Open wikipedia-de.zim. Select Help/Help. Goto Index. Open Article. Clicking link in article
always opens incorrect article.
E.g. Open Graz -> Click "UNESCO-Weltkulturerbe" -> Opens Making Games Magazin. (Which is appearantly
redirection from /GameStar/dev)
Observed in both Version 1.1.11 and 1.1.1.
Root cause:
After opening welcome page appearantly base url is "wikionboard://welcome", that a clicked link is appended to this
URL. WIkionboard only uses the URL path, but a "/" is then kept at the beginning of the URL. This is already handled
explictly for URL which contain a namespace. (/A/ and A/ is removed before searching in zim),
but not if no namespace is included in url.
Newer zims appearantly have (/)A/ style links, therfore it works, while wikipedia-de.zim has links without namespace.
Fix: Remove leading / of URLs. URLs are percent encoded before removal, therefore this should not have sideeffects like
Articles starting with / cannot be opened.