-
Notifications
You must be signed in to change notification settings - Fork 136
Fix crash when logging in with site address #8083
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
You can test the changes on this Pull Request by downloading an installable build, or scanning this QR code: |
This reverts commit a0ba019.
Codecov ReportBase: 43.02% // Head: 43.02% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## trunk #8083 +/- ##
============================================
- Coverage 43.02% 43.02% -0.01%
Complexity 3522 3522
============================================
Files 679 679
Lines 36956 36958 +2
Branches 4790 4790
============================================
Hits 15901 15901
- Misses 19629 19631 +2
Partials 1426 1426
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
| * Basic sanitization of the URL based on the same logic we use in the XMLRPC discovery | ||
| * see: https://github.com/wordpress-mobile/WordPress-FluxC-Android/blob/94601a5d4c1c98068adde0352ecc25e6d0046f35/fluxc/src/main/java/org/wordpress/android/fluxc/network/discovery/SelfHostedEndpointFinder.java#L292 | ||
| */ | ||
| fun String.sanitiseUrl(): String { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a np, this extension will be suggested in the autocomplete for all of the String instances, this is not a blocker, but without context, it's not clear what it does. Before, it was a private extension inside the class SitePickerSiteDiscoveryViewModel, so it was clear what it was about.
WDYT about moving it inside UrlUtils? we can then keep it as an extension and call it by providing the context receiver: with(urlUtils) { url.sanitiseUrl() }, or make it a regular function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point @hichamboushaba . I've moved it inside UrlUtils to make it clear “sanitizing” should only be applied to URLs.
hichamboushaba
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works well, thanks for taking care of this @JorgeMucientes 👍.
I left a comment above, but it's not a blocker, feel free to merge if you want 🙂.
hichamboushaba
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for making the changes @JorgeMucientes 💯
Fixes: #8056
Description
Fixes crash when trying to log in using their site address if the site address contains suffixes like wp-admin or wp-login.php
Testing instructions
Log into the app using site address with
wp-adminsuffix and check that the app doesn't crash.Images/gif
RELEASE-NOTES.txtif necessary.