Skip to content

Commit fa8833b

Browse files
authored
Merge pull request ev-flow#399 from haeter525/feat/add_quark_script_case_for_cwe_780
Add Quark Script to detect CWE-780
2 parents ba158b0 + e31c7e0 commit fa8833b

25 files changed

+183
-187
lines changed
16 Bytes
Binary file not shown.
16 Bytes
Binary file not shown.
16 Bytes
Binary file not shown.

docs/build/doctrees/dev.doctree

16 Bytes
Binary file not shown.
16 Bytes
Binary file not shown.
131 KB
Binary file not shown.

docs/build/doctrees/index.doctree

16 Bytes
Binary file not shown.
16 Bytes
Binary file not shown.

docs/build/html/_static/basic.css

Lines changed: 2 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,6 @@ div.body p, div.body dd, div.body li, div.body blockquote {
236236
a.headerlink {
237237
visibility: hidden;
238238
}
239-
240239
a.brackets:before,
241240
span.brackets > a:before{
242241
content: "[";
@@ -247,6 +246,7 @@ span.brackets > a:after {
247246
content: "]";
248247
}
249248

249+
250250
h1:hover > a.headerlink,
251251
h2:hover > a.headerlink,
252252
h3:hover > a.headerlink,
@@ -334,13 +334,11 @@ aside.sidebar {
334334
p.sidebar-title {
335335
font-weight: bold;
336336
}
337-
338337
div.admonition, div.topic, blockquote {
339338
clear: left;
340339
}
341340

342341
/* -- topics ---------------------------------------------------------------- */
343-
344342
div.topic {
345343
border: 1px solid #ccc;
346344
padding: 7px;
@@ -610,8 +608,6 @@ ol.simple p,
610608
ul.simple p {
611609
margin-bottom: 0;
612610
}
613-
614-
/* Docutils 0.17 and older (footnotes & citations) */
615611
dl.footnote > dt,
616612
dl.citation > dt {
617613
float: left;
@@ -629,33 +625,6 @@ dl.citation > dd:after {
629625
clear: both;
630626
}
631627

632-
/* Docutils 0.18+ (footnotes & citations) */
633-
aside.footnote > span,
634-
div.citation > span {
635-
float: left;
636-
}
637-
aside.footnote > span:last-of-type,
638-
div.citation > span:last-of-type {
639-
padding-right: 0.5em;
640-
}
641-
aside.footnote > p {
642-
margin-left: 2em;
643-
}
644-
div.citation > p {
645-
margin-left: 4em;
646-
}
647-
aside.footnote > p:last-of-type,
648-
div.citation > p:last-of-type {
649-
margin-bottom: 0em;
650-
}
651-
aside.footnote > p:last-of-type:after,
652-
div.citation > p:last-of-type:after {
653-
content: "";
654-
clear: both;
655-
}
656-
657-
/* Footnotes & citations ends */
658-
659628
dl.field-list {
660629
display: grid;
661630
grid-template-columns: fit-content(30%) auto;
@@ -667,11 +636,11 @@ dl.field-list > dt {
667636
padding-left: 0.5em;
668637
padding-right: 5px;
669638
}
670-
671639
dl.field-list > dt:after {
672640
content: ":";
673641
}
674642

643+
675644
dl.field-list > dd {
676645
padding-left: 0.5em;
677646
margin-top: 0em;

docs/build/html/_static/doctools.js

Lines changed: 11 additions & 119 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,13 @@
1010
*/
1111
"use strict";
1212

13+
const BLACKLISTED_KEY_CONTROL_ELEMENTS = new Set([
14+
"TEXTAREA",
15+
"INPUT",
16+
"SELECT",
17+
"BUTTON",
18+
]);
19+
1320
const _ready = (callback) => {
1421
if (document.readyState !== "loading") {
1522
callback();
@@ -18,73 +25,11 @@ const _ready = (callback) => {
1825
}
1926
};
2027

21-
/**
22-
* highlight a given string on a node by wrapping it in
23-
* span elements with the given class name.
24-
*/
25-
const _highlight = (node, addItems, text, className) => {
26-
if (node.nodeType === Node.TEXT_NODE) {
27-
const val = node.nodeValue;
28-
const parent = node.parentNode;
29-
const pos = val.toLowerCase().indexOf(text);
30-
if (
31-
pos >= 0 &&
32-
!parent.classList.contains(className) &&
33-
!parent.classList.contains("nohighlight")
34-
) {
35-
let span;
36-
37-
const closestNode = parent.closest("body, svg, foreignObject");
38-
const isInSVG = closestNode && closestNode.matches("svg");
39-
if (isInSVG) {
40-
span = document.createElementNS("http://www.w3.org/2000/svg", "tspan");
41-
} else {
42-
span = document.createElement("span");
43-
span.classList.add(className);
44-
}
45-
46-
span.appendChild(document.createTextNode(val.substr(pos, text.length)));
47-
parent.insertBefore(
48-
span,
49-
parent.insertBefore(
50-
document.createTextNode(val.substr(pos + text.length)),
51-
node.nextSibling
52-
)
53-
);
54-
node.nodeValue = val.substr(0, pos);
55-
56-
if (isInSVG) {
57-
const rect = document.createElementNS(
58-
"http://www.w3.org/2000/svg",
59-
"rect"
60-
);
61-
const bbox = parent.getBBox();
62-
rect.x.baseVal.value = bbox.x;
63-
rect.y.baseVal.value = bbox.y;
64-
rect.width.baseVal.value = bbox.width;
65-
rect.height.baseVal.value = bbox.height;
66-
rect.setAttribute("class", className);
67-
addItems.push({ parent: parent, target: rect });
68-
}
69-
}
70-
} else if (node.matches && !node.matches("button, select, textarea")) {
71-
node.childNodes.forEach((el) => _highlight(el, addItems, text, className));
72-
}
73-
};
74-
const _highlightText = (thisNode, text, className) => {
75-
let addItems = [];
76-
_highlight(thisNode, addItems, text, className);
77-
addItems.forEach((obj) =>
78-
obj.parent.insertAdjacentElement("beforebegin", obj.target)
79-
);
80-
};
81-
8228
/**
8329
* Small JavaScript module for the documentation.
8430
*/
8531
const Documentation = {
8632
init: () => {
87-
Documentation.highlightSearchWords();
8833
Documentation.initDomainIndexTable();
8934
Documentation.initOnKeyListeners();
9035
},
@@ -126,51 +71,6 @@ const Documentation = {
12671
Documentation.LOCALE = catalog.locale;
12772
},
12873

129-
/**
130-
* highlight the search words provided in the url in the text
131-
*/
132-
highlightSearchWords: () => {
133-
const highlight =
134-
new URLSearchParams(window.location.search).get("highlight") || "";
135-
const terms = highlight.toLowerCase().split(/\s+/).filter(x => x);
136-
if (terms.length === 0) return; // nothing to do
137-
138-
// There should never be more than one element matching "div.body"
139-
const divBody = document.querySelectorAll("div.body");
140-
const body = divBody.length ? divBody[0] : document.querySelector("body");
141-
window.setTimeout(() => {
142-
terms.forEach((term) => _highlightText(body, term, "highlighted"));
143-
}, 10);
144-
145-
const searchBox = document.getElementById("searchbox");
146-
if (searchBox === null) return;
147-
searchBox.appendChild(
148-
document
149-
.createRange()
150-
.createContextualFragment(
151-
'<p class="highlight-link">' +
152-
'<a href="javascript:Documentation.hideSearchWords()">' +
153-
Documentation.gettext("Hide Search Matches") +
154-
"</a></p>"
155-
)
156-
);
157-
},
158-
159-
/**
160-
* helper function to hide the search marks again
161-
*/
162-
hideSearchWords: () => {
163-
document
164-
.querySelectorAll("#searchbox .highlight-link")
165-
.forEach((el) => el.remove());
166-
document
167-
.querySelectorAll("span.highlighted")
168-
.forEach((el) => el.classList.remove("highlighted"));
169-
const url = new URL(window.location);
170-
url.searchParams.delete("highlight");
171-
window.history.replaceState({}, "", url);
172-
},
173-
17474
/**
17575
* helper function to focus on search bar
17676
*/
@@ -210,15 +110,11 @@ const Documentation = {
210110
)
211111
return;
212112

213-
const blacklistedElements = new Set([
214-
"TEXTAREA",
215-
"INPUT",
216-
"SELECT",
217-
"BUTTON",
218-
]);
219113
document.addEventListener("keydown", (event) => {
220-
if (blacklistedElements.has(document.activeElement.tagName)) return; // bail for input elements
221-
if (event.altKey || event.ctrlKey || event.metaKey) return; // bail with special keys
114+
// bail for input elements
115+
if (BLACKLISTED_KEY_CONTROL_ELEMENTS.has(document.activeElement.tagName)) return;
116+
// bail with special keys
117+
if (event.altKey || event.ctrlKey || event.metaKey) return;
222118

223119
if (!event.shiftKey) {
224120
switch (event.key) {
@@ -240,10 +136,6 @@ const Documentation = {
240136
event.preventDefault();
241137
}
242138
break;
243-
case "Escape":
244-
if (!DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS) break;
245-
Documentation.hideSearchWords();
246-
event.preventDefault();
247139
}
248140
}
249141

0 commit comments

Comments
 (0)