diff --git a/keepassxc-browser/content/keepassxc-browser.js b/keepassxc-browser/content/keepassxc-browser.js index 60a4a47..7473c50 100755 --- a/keepassxc-browser/content/keepassxc-browser.js +++ b/keepassxc-browser/content/keepassxc-browser.js @@ -155,20 +155,19 @@ kpxcFields.inputQueryPattern = 'input[type=\'text\'], input[type=\'email\'], inp // copied from Sizzle.js kpxcFields.rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g; kpxcFields.fcssescape = function(ch, asCodePoint) { - if (asCodePoint) { - - // U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER - if (ch === "\0") { - return "\uFFFD"; - } - - // Control characters and (dependent upon position) numbers get escaped as code points - return ch.slice(0, -1) + "\\" + ch.charCodeAt(ch.length - 1).toString(16) + " "; + if (asCodePoint) { + // U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER + if (ch === '\0') { + return '\uFFFD'; } - // Other potentially-special ASCII characters get backslash-escaped - return "\\" + ch; - }; + // Control characters and (dependent upon position) numbers get escaped as code points + return ch.slice(0, -1) + '\\' + ch.charCodeAt(ch.length - 1).toString(16) + ' '; + } + + // Other potentially-special ASCII characters get backslash-escaped + return '\\' + ch; +}; // Unique number as new IDs for input fields kpxcFields.uniqueNumber = 342845638; @@ -194,7 +193,7 @@ kpxcFields.setUniqueId = function(field) { }; kpxcFields.prepareId = function(id) { - return (id + "").replace(kpxcFields.rcssescape, kpxcFields.fcssescape); + return (id + '').replace(kpxcFields.rcssescape, kpxcFields.fcssescape); }; /**