diff options
-rw-r--r-- | main/src/main/java/de/blinkt/openvpn/VpnProfile.java | 2 | ||||
-rw-r--r-- | main/src/test/java/de/blinkt/openvpn/core/TestConfigGenerator.java | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/main/src/main/java/de/blinkt/openvpn/VpnProfile.java b/main/src/main/java/de/blinkt/openvpn/VpnProfile.java index edbc38ed..00a53565 100644 --- a/main/src/main/java/de/blinkt/openvpn/VpnProfile.java +++ b/main/src/main/java/de/blinkt/openvpn/VpnProfile.java @@ -204,7 +204,7 @@ public class VpnProfile implements Serializable, Cloneable { if (escapedString.equals(unescaped) && !escapedString.contains(" ") && !escapedString.contains("#") && !escapedString.contains(";") - && !escapedString.equals("")) + && !escapedString.equals("") && !escapedString.contains("'")) return unescaped; else return '"' + escapedString + '"'; diff --git a/main/src/test/java/de/blinkt/openvpn/core/TestConfigGenerator.java b/main/src/test/java/de/blinkt/openvpn/core/TestConfigGenerator.java index 378bc630..e2be04b4 100644 --- a/main/src/test/java/de/blinkt/openvpn/core/TestConfigGenerator.java +++ b/main/src/test/java/de/blinkt/openvpn/core/TestConfigGenerator.java @@ -67,6 +67,10 @@ public class TestConfigGenerator { { String uglyPassword = "^OrFg1{G^SS8b4J@B$Y1Dr\\GwG-dw3aBJ/R@WI*doCVP',+:>zjqC[&b6[8=KL:`{l&:i!_4*npE?4k2c^(n>9Tjp~u2Z]l8(y&Gg<-cwR2k=yKK:-%f-ezQ\"^g)[d,kbsu$cqih\\wA~on$~)QSODtip2cd,+->qv,roF*9>6q:lTepm=r?Y-+(K]ERGn\"+AiLj<(R_'BOg:vsh0wh]BQ-PVo534;l%R*FF!+,$?Q00%839(k?E!x0R[Lx6qK\\&"; String escapedUglyPassword = VpnProfile.openVpnEscape(uglyPassword); + + String testWithQuote = "'meinpw"; + String escapedQuote = VpnProfile.openVpnEscape(testWithQuote); + org.junit.Assert.assertEquals("\"'meinpw\"", escapedQuote); } |