mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-22 03:56:53 -06:00
Escape text passed as display values to slim-select
This commit is contained in:
parent
5a5fcf7d37
commit
1f71d3570a
BIN
netbox/project-static/dist/netbox.js
vendored
BIN
netbox/project-static/dist/netbox.js
vendored
Binary file not shown.
BIN
netbox/project-static/dist/netbox.js.map
vendored
BIN
netbox/project-static/dist/netbox.js.map
vendored
Binary file not shown.
@ -30,6 +30,7 @@
|
|||||||
"dayjs": "^1.11.5",
|
"dayjs": "^1.11.5",
|
||||||
"flatpickr": "4.6.13",
|
"flatpickr": "4.6.13",
|
||||||
"gridstack": "^7.2.3",
|
"gridstack": "^7.2.3",
|
||||||
|
"html-entities": "^2.3.3",
|
||||||
"htmx.org": "^1.8.0",
|
"htmx.org": "^1.8.0",
|
||||||
"just-debounce-it": "^3.1.1",
|
"just-debounce-it": "^3.1.1",
|
||||||
"query-string": "^7.1.1",
|
"query-string": "^7.1.1",
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import { readableColor } from 'color2k';
|
import { readableColor } from 'color2k';
|
||||||
import debounce from 'just-debounce-it';
|
import debounce from 'just-debounce-it';
|
||||||
|
import { encode } from 'html-entities';
|
||||||
import queryString from 'query-string';
|
import queryString from 'query-string';
|
||||||
import SlimSelect from 'slim-select';
|
import SlimSelect from 'slim-select';
|
||||||
import { createToast } from '../../bs';
|
import { createToast } from '../../bs';
|
||||||
@ -446,7 +447,7 @@ export class APISelect {
|
|||||||
// Build SlimSelect options from all already-selected options.
|
// Build SlimSelect options from all already-selected options.
|
||||||
const preSelectedOptions = preSelected.map(option => ({
|
const preSelectedOptions = preSelected.map(option => ({
|
||||||
value: option.value,
|
value: option.value,
|
||||||
text: option.innerText,
|
text: encode(option.innerText),
|
||||||
selected: true,
|
selected: true,
|
||||||
disabled: false,
|
disabled: false,
|
||||||
})) as Option[];
|
})) as Option[];
|
||||||
@ -454,7 +455,7 @@ export class APISelect {
|
|||||||
let options = [] as Option[];
|
let options = [] as Option[];
|
||||||
|
|
||||||
for (const result of data.results) {
|
for (const result of data.results) {
|
||||||
let text = result.display;
|
let text = encode(result.display);
|
||||||
|
|
||||||
if (typeof result._depth === 'number' && result._depth > 0) {
|
if (typeof result._depth === 'number' && result._depth > 0) {
|
||||||
// If the object has a `_depth` property, indent its display text.
|
// If the object has a `_depth` property, indent its display text.
|
||||||
|
@ -1818,6 +1818,11 @@ has@^1.0.3:
|
|||||||
dependencies:
|
dependencies:
|
||||||
function-bind "^1.1.1"
|
function-bind "^1.1.1"
|
||||||
|
|
||||||
|
html-entities@^2.3.3:
|
||||||
|
version "2.3.3"
|
||||||
|
resolved "https://registry.yarnpkg.com/html-entities/-/html-entities-2.3.3.tgz#117d7626bece327fc8baace8868fa6f5ef856e46"
|
||||||
|
integrity sha512-DV5Ln36z34NNTDgnz0EWGBLZENelNAtkiFA4kyNOG2tDI6Mz1uSWiq1wAKdyjnJwyDiDO7Fa2SO1CTxPXL8VxA==
|
||||||
|
|
||||||
htmx.org@^1.8.0:
|
htmx.org@^1.8.0:
|
||||||
version "1.8.0"
|
version "1.8.0"
|
||||||
resolved "https://registry.yarnpkg.com/htmx.org/-/htmx.org-1.8.0.tgz#f3a2f681f3e2b6357b5a29bba24a2572a8e48fd3"
|
resolved "https://registry.yarnpkg.com/htmx.org/-/htmx.org-1.8.0.tgz#f3a2f681f3e2b6357b5a29bba24a2572a8e48fd3"
|
||||||
|
Loading…
Reference in New Issue
Block a user