Revised the JavaScript regular expressions used in the summary helper, as suggested by SonarQube for security.
This commit is contained in:
parent
57482f81fc
commit
535ff96ab3
@ -698,15 +698,15 @@ class SummaryHelper {
|
||||
return;
|
||||
}
|
||||
let found;
|
||||
found = summary.value.match(/^(.+?)—(.+?)—(.+?)→(.+?)(?:×(\d+)?)?$/);
|
||||
found = summary.value.match(/^([^—]+)—([^—]+)—([^—→]+)→(.+?)(?:×(\d+))?$/);
|
||||
if (found !== null) {
|
||||
return this.#populateBusTrip(found[1], found[2], found[3], found[4], found[5]);
|
||||
}
|
||||
found = summary.value.match(/^(.+?)—(.+?)([→↔])(.+?)(?:×(\d+)?)?$/);
|
||||
found = summary.value.match(/^([^—]+)—([^—→↔]+)([→↔])(.+?)(?:×(\d+))?$/);
|
||||
if (found !== null) {
|
||||
return this.#populateGeneralTrip(found[1], found[2], found[3], found[4], found[5]);
|
||||
}
|
||||
found = summary.value.match(/^(.+?)—.+?(?:×(\d+)?)?$/);
|
||||
found = summary.value.match(/^([^—]+)—.+?(?:×(\d+)?)?$/);
|
||||
if (found !== null) {
|
||||
return this.#populateGeneralTag(found[1], found[2]);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user