Skip to content

Commit abb63ac

Browse files
committed
Improve styling & clarity for fix.
1 parent e441a61 commit abb63ac

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/chrome/content/code/ApplicableList.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -214,12 +214,14 @@ ApplicableList.prototype = {
214214

215215
add_command: function(rule) {
216216
// basic validation for data to be added to xul
217-
if(!String(rule.id).match(/^[a-zA-Z_0-9]+$/))
217+
var ruleId = String(rule.id);
218+
if (!ruleId.match(/^[a-zA-Z_0-9]+$/)) {
218219
return;
220+
}
219221

220222
var command = this.document.getElementById("https-everywhere-menuitem-rule-toggle-template").cloneNode();
221-
command.setAttribute('id', rule.id+'-command');
222-
command.setAttribute('data-id', rule.id);
223+
command.setAttribute('id', ruleId+'-command');
224+
command.setAttribute('data-id', ruleId);
223225
command.setAttribute('label', rule.name);
224226
this.commandset.appendChild(command);
225227
},

0 commit comments

Comments
 (0)