kiwix-android
kiwix-android copied to clipboard
Articles containing "?" cannot be opened
Kiwix Version: 3.4.4 ZIM: 2021-03 German and English Wikipedia
Articles that contain a "?" cannot be opened. You can only open them by opening them in a new tab, as demonstrated in the videos below:
https://user-images.githubusercontent.com/71934042/124366295-f58ab480-dc4e-11eb-93b7-cdb7edb5d0ea.mp4
https://user-images.githubusercontent.com/71934042/124366296-f6bbe180-dc4e-11eb-861b-1a7330a44a96.mp4
Hello ! Can I fix it?
@ibrahim1520 Yes, but first, what is your analysis of the problem? How would look like your solution?
This issue has been automatically marked as stale because it has not had recent activity. It will be now be reviewed manually. Thank you for your contributions.
Hi @kelson42 , I would like to work on this issue. However I'm a newbie here so could you guide me with this issue?
@puranjayK OK, but what isnthe root cause? How do you plan to fix the problem?
@puranjayK OK, but what isnthe root cause? How do you plan to fix the problem?
@kelson42 I'm a newbie, so i don't have much idea what about this. Could u guide me where I need to start from and if I should even take this issue?
@puranjayK This is not a programming lesson here. Either you have a clue how to fix it and you take it and if you have technical questions we might then help. But you need to know first what you have to do. All the necessary information should be available in the README.md
to start with.
@kelson42 I might have come out wrong but I wasn't asking for progamming lessons. I meant I'm new to this org so can you help me from where I should begin for this issue?
well I'd like to work on this issue might take 2-3 days cause i still need to look at the source code (downloaded it and got graddle working but its kinda late here for now and i got some classes)
also its funny (Varenyam Bhardwaj here)
Seems like the "?" does something weird and messes up the URL for some reason well atleast this is what i could tell from the logs
also im so sorry @puranjayK I totally ignored the fact that you wanted to work on this issue!
Seems like the "?" does something weird and messes up the URL for some reason well atleast this is what i could tell from the logs
@airpods69 could you tell me where you got the article which had this ?
so that I can reproduce and see if I get something :)
Seems like the "?" does something weird and messes up the URL for some reason well atleast this is what i could tell from the logs
@airpods69 could you tell me where you got the article which had this
?
so that I can reproduce and see if I get something :)
found it in the wikipedia (the simplified english one i forgot the name ;-;) search for rihana then scroll down and look for the loud album open it and you should find the article with a "?" in it
Thanks @airpods69 telling me the file name. @kelson42 seems like the content doesn't exist in the kiwix library itself so it can't find it which results in not opening the next article for eg: http://library.kiwix.org/wikipedia_en_simple_all_maxi_2022-01/A/What's_My_Name? I don't think so if the issue is with our app
maybe it is an issue with link if you ask me (just a hunch tbh) but looking at the links it doesnt allow or even consider "?" while looking for it
and also i used the simplified wikipedia because it had a smaller download size the person who opened the issue must have been using the complete version of wikipedia
maybe it is an issue with a link if you ask me, but looking at the links it doesn't allow or even consider "?" while looking for it
you are correct but I have noticed many times that the link with the ?
mark in end doesn't matter it will go to the same link
try: https://www.kiwix.org/en/support-us/code? https://www.primevideo.com?
put the whole URL including ?
in end, you will see it redirects to the same page.
and also I used the simplified Wikipedia because it had a smaller download size the person who opened the issue must have been using the complete version of Wikipedia
I checked in complete version only that is https://download.kiwix.org/zim/wikipedia/wikipedia_en_simple_all_maxi_2022-01.zim
well no thats not the issue here
"whats my name?" does exist instead of "?" it goes to %3F
so it doesnt exist cause its the wrong link which we are going to
replacing "?" with "%3F" should solve the issue while looking up for the link
we are looking for: http://library.kiwix.org/wikipedia_en_simple_all_maxi_2022-01/A/What's_My_Name?
when we should be looking for: http://library.kiwix.org/wikipedia_en_simple_all_maxi_2022-01/A/What's_My_Name%3F
so there you go the issue should be easy to solve just need to change how the link thingy works
well no thats not the issue here
"whats my name?" does exist instead of "?" it goes to %3F
so it doesnt exist cause its the wrong link which we are going to
replacing "?" with "%3F" should solve the issue while looking up for the link
we are looking for: http://library.kiwix.org/wikipedia_en_simple_all_maxi_2022-01/A/What's_My_Name?
when we should be looking for: http://library.kiwix.org/wikipedia_en_simple_all_maxi_2022-01/A/What's_My_Name%3F
okay yeah, that does solve the thing, I thought the link didn't exist. Thanks for the info ;)
so there you go the issue should be easy to solve just need to change how the link thingy works
I think it has to change from the library itself?
yep that seems to be the case for rihana but lemme just check with the german one
actually that doesnt explain one thing
if it doesnt redirect then why does it work when the link is opened in a new tab so that means its not a library issue right?
I am not sure how libraries work but replacing "?" with "%3F" at all occurrences when loading the URL should fix it without changing everything in the library
me and @cdhiraj40 discussed this but i thought putting it up here also would make sense so that everyone knows
something interesting that i found
Hi all, this is an issue we also had in Kiwix JS. Please see https://github.com/kiwix/kiwix-js/issues/806 and the PR that fixes it https://github.com/kiwix/kiwix-js/pull/807. The issue is simply that the URL needs to have any querystrings and anchors removed BEFORE it is decoded.
A URL in a ZIM article is URI-encoded by default, but it may have additionally have a querystring, or an anchor (and that question mark and hash, if any, are not encoded). Usually a reader will have a function that removes any querysting and anchor before then decoding the URI and sending it to the backend for reading from the ZIM.
However, if the URI is decoded first and then querystrings are removed, then of course the question mark will be interpreted as a querystring and it and everything after will be removed.
You shouldn't substitute all question marks for %3F in the backend, or else you will introduce more problems than you solve! You should use a proper decodeURIComponent
function after you have removed any querystring or hash anchor from the encoded URL in the article's HTML.
org.kiwix.kiwixmobile.core.main.CoreWebViewClient in line 143 the url "https://kiwix.app/A/What's_My_Name?" is not encoded. So that would mean that the url is decoded somewhere else? I was not able to find the place where the actual request is done.
This issue has been automatically marked as stale because it has not had recent activity. It will be now be reviewed manually. Thank you for your contributions.
@Inbefortus Maybe this bug is already fixed in 3.6.0, but otherwise we will fic it in 3.7.0.
@MohitMaliFtechiz Not a duplicate of #2847
@MohitMaliFtechiz Not a duplicate of #2847
hi @kelson42 , Both Issue are different. since #2847 is related to new tab(webview is not giving proper url to handle) and #2671 is for article contains ? not opening in same tab. but i have placed a fix for both issues in #2968.
@kelson42, We already fixed this issue in https://github.com/kiwix/kiwix-android/pull/2968
@Inbefortus I will close the ticket but woukd be glad to get your feedback to confirm this is fixed in 3.7.