diff options
Diffstat (limited to 'pdf-over-gui/src/main/java')
-rw-r--r-- | pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/mobile/MobileBKUHelper.java | 8 | ||||
-rw-r--r-- | pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/MobileBKUEnterNumberComposite.java | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/mobile/MobileBKUHelper.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/mobile/MobileBKUHelper.java index f6de0789..88a38a0e 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/mobile/MobileBKUHelper.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/mobile/MobileBKUHelper.java @@ -201,10 +201,12 @@ public class MobileBKUHelper { public static String normalizeMobileNumber(String number) { // Verify number and normalize - number = number.replaceAll("\\s",""); + number = number.trim(); + + String numberWithoutWhitespace = number.replaceAll("\\s",""); // Compile and use regular expression Pattern pattern = Pattern.compile(NUMBER_REGEX); - Matcher matcher = pattern.matcher(number); + Matcher matcher = pattern.matcher(numberWithoutWhitespace); if (!matcher.find()) return number; /* might be an idA username, return unchanged */ @@ -219,7 +221,7 @@ public class MobileBKUHelper { if (countryCode.equals("10301")) { // A-Trust Testnumber! Don't change - return number; + return numberWithoutWhitespace; } countryCode = countryCode.replace("00", "+"); diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/MobileBKUEnterNumberComposite.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/MobileBKUEnterNumberComposite.java index 427daefd..2a5b3e9c 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/MobileBKUEnterNumberComposite.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/MobileBKUEnterNumberComposite.java @@ -60,8 +60,6 @@ public class MobileBKUEnterNumberComposite extends StateComposite { try {
String number = MobileBKUEnterNumberComposite.this.txt_number.getText();
- number = number.replaceAll("\\s","");
-
MobileBKUEnterNumberComposite.this.setMobileNumber(number);
String password = MobileBKUEnterNumberComposite.this.txt_password.getText();
|