Dbrant has uploaded a new change for review.
https://gerrit.wikimedia.org/r/290960
Change subject: Fix links to page titles with plus signs.
......................................................................
Fix links to page titles with plus signs.
Bug: T136223
Change-Id: I3a5bd2a4adba4e6f320de554264717a38d7a696c
---
M app/src/main/java/org/wikipedia/util/UriUtil.java
1 file changed, 5 insertions(+), 1 deletion(-)
git pull ssh://gerrit.wikimedia.org:29418/apps/android/wikipedia
refs/changes/60/290960/1
diff --git a/app/src/main/java/org/wikipedia/util/UriUtil.java
b/app/src/main/java/org/wikipedia/util/UriUtil.java
index bca5ad7..e0c3f16 100644
--- a/app/src/main/java/org/wikipedia/util/UriUtil.java
+++ b/app/src/main/java/org/wikipedia/util/UriUtil.java
@@ -31,7 +31,11 @@
*/
public static String decodeURL(String url) {
try {
- return URLDecoder.decode(url, "UTF-8");
+ // Before decoding, replace plus signs with the correct encoded
character.
+ // The JavaScript layer doesn't escape plus signs when passing
data over
+ // the Bridge. However, the Java layer considers plus signs to be
spaces,
+ // so the encodings aren't symmetric for that single character.
+ return URLDecoder.decode(url.replace("+", "%2B"), "UTF-8");
} catch (UnsupportedEncodingException e) {
// Inexplicable decoding problem. This shouldn't happen. Return
the input.
Log.d("Wikipedia", "URL decoding failed. String was: " + url);
--
To view, visit https://gerrit.wikimedia.org/r/290960
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I3a5bd2a4adba4e6f320de554264717a38d7a696c
Gerrit-PatchSet: 1
Gerrit-Project: apps/android/wikipedia
Gerrit-Branch: master
Gerrit-Owner: Dbrant <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits