Skip to content

Commit e4b4476

Browse files
committed
sanitizer: Fix input validation
Make it to work again with 'commandline', 'offlineapps' and 'sitesettings' arguments
1 parent 0bbbe9d commit e4b4476

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

common/content/sanitizer.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,16 +95,17 @@ const Sanitizer = Module("sanitizer", {
9595
}
9696
else {
9797
liberator.assert(args.length > 0, "Argument required");
98-
let items = [item for (item of args.map(Sanitizer.argToPref))];
99-
for (let item of items) {
100-
if (!options.get("sanitizeitems").isValidValue(item)) {
101-
liberator.echoerr("Invalid data item: " + item);
98+
99+
for (let [,elem] in args) {
100+
if (!options.get("sanitizeitems").isValidValue(elem)) {
101+
liberator.echoerr("Invalid data item: " + elem);
102102
return;
103103
}
104104
}
105105

106106
liberator.echomsg("Sanitizing " + args + " items...");
107107

108+
let items = [item for (item of args.map(Sanitizer.argToPref))];
108109
for (let item of items) {
109110
if (sanitizer.canClearItem(item, function () {})) {
110111
try {

0 commit comments

Comments
 (0)