mirror of
https://github.com/zxing/zxing.git
synced 2025-03-05 20:48:51 -08:00
Issue 1102 fix escaping in wifi codes
git-svn-id: https://zxing.googlecode.com/svn/trunk@2084 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
parent
a569f179ff
commit
873608de67
|
@ -106,7 +106,7 @@ public final class ContactInfoGenerator implements GeneratorSource {
|
|||
|
||||
private static void maybeAppendMECARD(StringBuilder output, String prefix, String value) {
|
||||
if (value.length() > 0) {
|
||||
value = value.replaceAll("([:;])", "\\\\$1");
|
||||
value = value.replaceAll("([\\\\:;])", "\\\\$1");
|
||||
value = value.replaceAll("\\n", "");
|
||||
output.append(prefix).append(':').append(value).append(';');
|
||||
}
|
||||
|
|
|
@ -86,11 +86,7 @@ public final class WifiGenerator implements GeneratorSource {
|
|||
if (input.contains("\n")) {
|
||||
throw new GeneratorException(name + " field must not contain \\n characters.");
|
||||
}
|
||||
input = input.replace(";", "\\;");
|
||||
input = input.replace(":", "\\:");
|
||||
input = input.replace("\\", "\\\\");
|
||||
input = input.replace("/", "\\/");
|
||||
return input;
|
||||
return input.replaceAll("([\\\\:;])", "\\\\$1");
|
||||
}
|
||||
|
||||
private String getSsidField() throws GeneratorException {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
application: zxing
|
||||
version: 4
|
||||
version: 5
|
||||
runtime: python
|
||||
api_version: 1
|
||||
|
||||
|
|
Loading…
Reference in a new issue