summaryrefslogtreecommitdiff
path: root/main/src
diff options
context:
space:
mode:
Diffstat (limited to 'main/src')
-rw-r--r--main/src/main/java/de/blinkt/openvpn/core/ConfigParser.java12
1 files changed, 9 insertions, 3 deletions
diff --git a/main/src/main/java/de/blinkt/openvpn/core/ConfigParser.java b/main/src/main/java/de/blinkt/openvpn/core/ConfigParser.java
index 0d7d54c0..028c8816 100644
--- a/main/src/main/java/de/blinkt/openvpn/core/ConfigParser.java
+++ b/main/src/main/java/de/blinkt/openvpn/core/ConfigParser.java
@@ -48,9 +48,15 @@ public class ConfigParser {
if (line == null)
break;
- if (lineno == 1 && (line.startsWith("PK\003\004")
- || (line.startsWith("PK\007\008"))))
- throw new ConfigParseError("Input looks like a ZIP Archive. Import is only possible for OpenVPN config files (.ovpn/.conf)");
+ if (lineno == 1) {
+ if ((line.startsWith("PK\003\004")
+ || (line.startsWith("PK\007\008")))) {
+ throw new ConfigParseError("Input looks like a ZIP Archive. Import is only possible for OpenVPN config files (.ovpn/.conf)");
+ }
+ if (line.startsWith("\uFEFF")) {
+ line = line.substring(1);
+ }
+ }
// Check for OpenVPN Access Server Meta information
if (line.startsWith("# OVPN_ACCESS_SERVER_")) {