Repository navigation
fix: keep the ayah when a quran:// link has a query string - #4070
Open
BiskremMuhammad wants to merge 1 commit into
Open
BiskremMuhammad wants to merge 1 commit into
BiskremMuhammad wants to merge 1 commit into
Conversation
This was referenced Nov 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
quran://2/255?play=trueopens ayah 1, not ayah 255.QuranForwarderActivitydoes not parse the uri — it stringifies the whole thing, splits on/, and takes the first two pieces that survivetoInt(). With a query string the last piece is255?play=true,toInt()throws, thecatchleaves the value alone, and the ayah keeps its default of 1. There is no error anywhere; the reader simply lands at the top of the sura.This reads the authority and the path segments off the
Uriinstead, so the query is out of the numbers by construction.Nothing else changes: non-numeric pieces are still skipped, so
quran://quran.com/2/255still resolves; a sura on its own still opens at its first ayah; and no validation was added or removed.Tests
QuranForwarderActivityTestlaunches the activity and asserts the intent it forwards toQuranDataActivity, in the same style asShortcutsActivityTest. The two query cases fail onmainwith ayah 1 instead of 255, and pass here.How I ran into it
I link into the app from outside, with the parameters proposed in quran/quran-ios#1033. A link carrying any of them hits this before a single parameter is read, so the workaround today is a trailing slash —
quran://2/255/?play=true— which happens to split cleanly.