projects
/
zxing.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Allow the + character in phone numbers. In the same time, fix a bug where other non...
[zxing.git]
/
zxing.appspot.com
/
generator
/
src
/
com
/
google
/
zxing
/
web
/
generator
/
client
/
Validators.java
diff --git
a/zxing.appspot.com/generator/src/com/google/zxing/web/generator/client/Validators.java
b/zxing.appspot.com/generator/src/com/google/zxing/web/generator/client/Validators.java
index
51646bf
..
99458e4
100644
(file)
--- a/
zxing.appspot.com/generator/src/com/google/zxing/web/generator/client/Validators.java
+++ b/
zxing.appspot.com/generator/src/com/google/zxing/web/generator/client/Validators.java
@@
-24,11
+24,11
@@
package com.google.zxing.web.generator.client;
*/
public final class Validators {
public static String filterNumber(String number) {
*/
public final class Validators {
public static String filterNumber(String number) {
- return number.replaceAll("[
+
\\.,\\-\\(\\)]", "");
+ return number.replaceAll("[ \\.,\\-\\(\\)]", "");
}
public static void validateNumber(String number) throws GeneratorException {
}
public static void validateNumber(String number) throws GeneratorException {
- if (!number.matches("[0-9]+")) {
+ if (!number.matches("
\\+?
[0-9]+")) {
throw new GeneratorException("Phone number must be digits only.");
}
}
throw new GeneratorException("Phone number must be digits only.");
}
}