diff options
author | Daniel Albert <da-kid@da-kid.tk> | 2014-06-23 19:10:50 +0200 |
---|---|---|
committer | Daniel Albert <da-kid@da-kid.tk> | 2014-06-23 19:10:50 +0200 |
commit | f68cf2a435f493968591cd948fe6e5400b7da435 (patch) | |
tree | c05a7541c75489653d0cfb10a627348023b2172e | |
parent | b43fb63753bc9be7a1a0b05e7369a2373f65c03f (diff) | |
download | open-keychain-f68cf2a435f493968591cd948fe6e5400b7da435.tar.gz open-keychain-f68cf2a435f493968591cd948fe6e5400b7da435.tar.bz2 open-keychain-f68cf2a435f493968591cd948fe6e5400b7da435.zip |
Fixed Issue #683 which caused OK to crash upon importing keys which contain percent signs.
-rw-r--r-- | OpenKeychain/src/main/java/org/sufficientlysecure/keychain/keyimport/HkpKeyserver.java | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/keyimport/HkpKeyserver.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/keyimport/HkpKeyserver.java index 2ec9e1c07..df1a7e937 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/keyimport/HkpKeyserver.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/keyimport/HkpKeyserver.java @@ -316,6 +316,12 @@ public class HkpKeyserver extends Keyserver { while (uidMatcher.find()) { String tmp = uidMatcher.group(1).trim(); if (tmp.contains("%")) { + if(tmp.contains("%%")) { + // This is a fix for issue #683 + // The server encodes a percent sign as %%, so it is swapped out with its + // urlencoded counterpart to prevent errors + tmp = tmp.replace("%%", "%25"); + } try { // converts Strings like "Universit%C3%A4t" to a proper encoding form "Universität". tmp = (URLDecoder.decode(tmp, "UTF8")); |