Partial upgrade of libsedml, fixed cli plot bugs#1627
Partial upgrade of libsedml, fixed cli plot bugs#1627CodeByDrescher wants to merge 27 commits intomasterfrom
Conversation
| if (null != id) return new SId(id); | ||
| if (filename == null) return null; | ||
| String alternativeFilename = filename.substring(0, filename.lastIndexOf(".")); | ||
| if (!alternativeFilename.matches("[a-zA-z0-9_]+")) return null; |
Check warning
Code scanning / CodeQL
Overly permissive regular expression range Medium
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 17 days ago
In general, the fix is to replace the overly broad A-z character range with a precise range that includes only uppercase letters, A-Z. This avoids unintentionally allowing punctuation characters between Z and a in ASCII while preserving the intended functionality of accepting letters, digits, and underscores.
Concretely, in vcell-core/src/main/java/org/jlibsedml/SedMLReader.java, the parseId(String id, String filename) method builds alternativeFilename and checks it with alternativeFilename.matches("[a-zA-z0-9_]+"). This should be changed to use [a-zA-Z0-9_]+. No additional methods or imports are needed; we are only changing the regex literal. Functionality remains the same except that IDs derived from filenames will no longer accept the five punctuation characters [ \ ] ^ ` as valid, which aligns the check with the apparent intent of allowing only letters, digits, and underscores.
| @@ -827,7 +827,7 @@ | ||
| if (null != id) return new SId(id); | ||
| if (filename == null) return null; | ||
| String alternativeFilename = filename.substring(0, filename.lastIndexOf(".")); | ||
| if (!alternativeFilename.matches("[a-zA-z0-9_]+")) return null; | ||
| if (!alternativeFilename.matches("[a-zA-Z0-9_]+")) return null; | ||
| return new SId(alternativeFilename); | ||
| } | ||
| } |
d69f4ec to
f1fcddb
Compare
… bug Fixed search paths
Fixes include logging, raising plot-pixel accurate thresholds, making code more convenient and/or easier to read / conceptualize (plus some improvements!).
fixed missed compiler errors, and remove bad comment
67af9ee to
006b089
Compare
Uh oh!
There was an error while loading. Please reload this page.