From 04ef2712af4deff5dc7980c218338a9268c44a6a Mon Sep 17 00:00:00 2001 From: garybhwang Date: Thu, 10 Mar 2022 14:26:43 +0800 Subject: [PATCH] fix(decode_utf-8): fixed utf-8 decode --- lib/esapi.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/esapi.js b/lib/esapi.js index 6429351..458ae3b 100644 --- a/lib/esapi.js +++ b/lib/esapi.js @@ -974,9 +974,9 @@ esapi.codecs.UTF8 = { i += 2; } else { - c2 = utftext.charCodeAt(i + 1); - c3 = utftext.charCodeAt(i + 2); - string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63)); + c2 = sInput.charCodeAt(i + 1); + c3 = sInput.charCodeAt(i + 2); + out += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63)); i += 3; } }