Skip to content

Commit a844e70

Browse files
alanpaxtonadamretter
authored andcommitted
[bugfix] Finess white space in decimal digit pattern
Disallow *vertical* whitespace to make strange layouts end up defaulting to “1”, i.e. the standard layout.
1 parent 48f2d9b commit a844e70

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

exist-core/src/main/java/org/exist/xquery/functions/integer/IntegerPicture.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,10 @@ public abstract class IntegerPicture {
4949

5050
final static BigInteger TEN = BigInteger.valueOf(10L);
5151

52-
final static Pattern decimalDigitPattern = Pattern.compile("^((\\p{Nd}|#|[^\\p{N}\\p{L}])+)$", Pattern.UNICODE_CHARACTER_CLASS);
52+
//This contains \\v (vertical whitespace characters) so anything with vertical white space isn't a pattern
53+
//It also disallows 0 instances of the pattern
54+
//When decimal digit pattern doesn't match, we end up falling into a standard default.
55+
final static Pattern decimalDigitPattern = Pattern.compile("^((\\p{Nd}|#|[^\\p{N}\\p{L}\\v])+)$", Pattern.UNICODE_CHARACTER_CLASS);
5356
final static Pattern invalidDigitPattern = Pattern.compile("(\\p{Nd})");
5457

5558
/**

0 commit comments

Comments
 (0)