File tree Expand file tree Collapse file tree 2 files changed +4
-5
lines changed
itext/itext.kernel/itext/kernel Expand file tree Collapse file tree 2 files changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -286,11 +286,10 @@ internal static String[] ParseVersionString(String version) {
286
286
}
287
287
288
288
internal static bool IsVersionNumeric ( String version ) {
289
- //I did not want to introduce an extra dependency on apache.commons in order to use StringUtils.
290
- //This small method is not the most optimal, but it should do for release
291
289
try {
292
- Double . Parse ( version , System . Globalization . CultureInfo . InvariantCulture ) ;
293
- return true ;
290
+ int value = ( int ) Convert . ToInt32 ( version ) ;
291
+ // parseInt accepts numbers which start with a plus sign, but for a version it's unacceptable
292
+ return value >= 0 && ! version . Contains ( "+" ) ;
294
293
}
295
294
catch ( FormatException ) {
296
295
return false ;
Original file line number Diff line number Diff line change 1
- c4350c80a574cb144e5687475ccf6aaa90af4b1a
1
+ 2ac169237cc009d2bbc9d7386fe35abf79eb38e5
You can’t perform that action at this time.
0 commit comments