Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 75a3f34

Browse files
erik-kroghesbena
andauthored
use if-else in ReDoSUtil::getCanonicalizationFlags
Co-authored-by: Esben Sparre Andreasen <[email protected]>
1 parent f5a1a12 commit 75a3f34

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

  • javascript/ql/lib/semmle/javascript/security/performance

javascript/ql/lib/semmle/javascript/security/performance/ReDoSUtil.qll

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -187,11 +187,10 @@ private predicate isCanonicalTerm(RelevantRegExpTerm term, string str) {
187187
string getCanonicalizationFlags(RegExpTerm root) {
188188
root.isRootTerm() and
189189
(
190-
RegExpFlags::isIgnoreCase(root) and
191-
result = "i"
192-
or
193-
not RegExpFlags::isIgnoreCase(root) and
194-
result = ""
190+
if RegExpFlags::isIgnoreCase(root) then
191+
result = "i"
192+
else
193+
result = ""
195194
)
196195
}
197196

0 commit comments

Comments
 (0)