-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Description
Checklist
- I am reporting an issue in existing functionality that does not work as intended
- I've searched for existing GitHub issues
Description
Recently in the iOS Telegram app, when user taps a URL and redirect to Safari, app will automatically replaces all "https://" substrings in the URL with "x-safari-https://". This behavior will break the URL when it contain multiple "https://" substrings.
Note: This URL is used only to verify the bug and has no actual purpose, so it still works even after being corrupted by the bug. Affected URLs that have a real purpose would be corrupted by this bug and fail to work properly, like various “search by image” websites.
For example,send this URL in the app and click it to open in Safari:
https://1.1.1.1/cdn-cgi/trace?https://example.com/a.jpg.
The actual URL opened is probably:
x-safari-https://1.1.1.1/cdn-cgi/trace?x-safari-https://example.com/a.jpg.
The actual URL visited in Safari is:
https://1.1.1.1/cdn-cgi/trace?x-safari-https://example.com/a.jpg.
I’m not a professional, so this is just for reference: Since this issue appeared around early March, could it be related to the changes made here?
bae4591#diff-1574ace781887a2bbe54244000d055d1bd577a98490998490c8421889f872cd1R106
Expected Behavior
Only replace "https://" substrings when it appears at the start of the URL.
Actual Behavior
All "https://" substrings in the URL were replaced.
Steps to Reproduce
- Set Safari as your default browser.
- Send
https://1.1.1.1/cdn-cgi/trace?https://example.com/a.jpgin app. - Click this link, it will automatically redirect to Safari.
- Click on the Safari address bar to view the URL.
- You will see that the URL is:
https://1.1.1.1/cdn-cgi/trace?x-safari-https://example.com/a.jpg.
Environment
Device: iPhone 13 Pro Max
iOS version: iOS 26.3.1
App version: 12.5.2 (32493)