Skip to content

Commit a19627c

Browse files
committed
optionally ignore everything after a dash
1 parent 523c15c commit a19627c

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

javascript/ql/lib/semmle/javascript/security/CryptoAlgorithms.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ abstract class CryptographicAlgorithm extends TCryptographicAlgorithm {
8989
*/
9090
bindingset[name]
9191
predicate matchesName(string name) {
92-
name.toUpperCase().regexpCapture("^(\\w+)(?:-.*)?$", 1).regexpReplaceAll("[-_ ]", "") =
93-
getName()
92+
[name.toUpperCase(), name.toUpperCase().regexpCapture("^(\\w+)(?:-.*)?$", 1)]
93+
.regexpReplaceAll("[-_ ]", "") = getName()
9494
}
9595

9696
/**

python/ql/lib/semmle/python/concepts/CryptoAlgorithms.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ abstract class CryptographicAlgorithm extends TCryptographicAlgorithm {
8989
*/
9090
bindingset[name]
9191
predicate matchesName(string name) {
92-
name.toUpperCase().regexpCapture("^(\\w+)(?:-.*)?$", 1).regexpReplaceAll("[-_ ]", "") =
93-
getName()
92+
[name.toUpperCase(), name.toUpperCase().regexpCapture("^(\\w+)(?:-.*)?$", 1)]
93+
.regexpReplaceAll("[-_ ]", "") = getName()
9494
}
9595

9696
/**

0 commit comments

Comments
 (0)