From c0b32f5992d027eef16294568557d26a28a1eb89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Niesner?= Date: Wed, 24 Mar 2021 18:06:05 +0100 Subject: [PATCH] Convert to string before replace (#186) This fixes this error text.replace is not a function When somebody has this nickname 1234567890 it thorws error in the server viewer. --- src/js/script.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/script.js b/src/js/script.js index f8ed73f..bafa763 100644 --- a/src/js/script.js +++ b/src/js/script.js @@ -124,7 +124,7 @@ function escapeHtml(text) { "'": ''' }; - return text.replace(/[&<>"']/g, function(m) { return map[m]; }); + return text.toString().replace(/[&<>"']/g, function(m) { return map[m]; }); } function updateTooltip(el, text) {