From bf3df43621e3977862da0848db648043886c0046 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Wed, 5 Jun 2013 15:22:47 +0200 Subject: [PATCH] Cast to String in WCF.String.* --- wcfsetup/install/files/js/WCF.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/wcfsetup/install/files/js/WCF.js b/wcfsetup/install/files/js/WCF.js index bd28005948..cc930ff78b 100755 --- a/wcfsetup/install/files/js/WCF.js +++ b/wcfsetup/install/files/js/WCF.js @@ -3372,7 +3372,7 @@ WCF.String = { * @return string */ escapeHTML: function (string) { - return string.replace(/&/g, '&').replace(/"/g, '"').replace(//g, '>'); + return String(string).replace(/&/g, '&').replace(/"/g, '"').replace(//g, '>'); }, /** @@ -3383,7 +3383,7 @@ WCF.String = { * @return string */ escapeRegExp: function(string) { - return string.replace(/([.*+?^=!:${}()|[\]\/\\])/g, '\\$1'); + return String(string).replace(/([.*+?^=!:${}()|[\]\/\\])/g, '\\$1'); }, /** @@ -3409,7 +3409,7 @@ WCF.String = { * @return string */ lcfirst: function(string) { - return string.substring(0, 1).toLowerCase() + string.substring(1); + return String(string).substring(0, 1).toLowerCase() + string.substring(1); }, /** @@ -3419,7 +3419,7 @@ WCF.String = { * @return string */ ucfirst: function(string) { - return string.substring(0, 1).toUpperCase() + string.substring(1); + return String(string).substring(0, 1).toUpperCase() + string.substring(1); } }; -- 2.20.1