Skip to content

Commit 08470ec

Browse files
committed
Checking only ISO Latin 1 digits for IPs
1 parent ebf5d42 commit 08470ec

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

x-pack/plugin/mapper-patterned-text/src/main/java/org/elasticsearch/xpack/patternedtext/PatternedTextValueProcessor.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,8 @@ public static boolean isIpv4_manual_iterative(String text) {
187187
return false;
188188
}
189189
octet = 0;
190-
} else if (Character.isDigit(c)) {
190+
} else if ('0' <= c && c <= '9') {
191+
// Character.isDigit(c) is invalid for IPs and inconsistent with the calculation of the numeric value of the character
191192
octet = octet * 10 + c - '0';
192193
if (octet > 255) {
193194
return false;

0 commit comments

Comments
 (0)