From: Tim Düsterhus Date: Wed, 5 Jun 2013 13:22:47 +0000 (+0200) Subject: Cast to String in WCF.String.* X-Git-Tag: 2.0.0_Beta_4~127^2~1^2~1 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=bf3df43621e3977862da0848db648043886c0046;p=GitHub%2FWoltLab%2FWCF.git Cast to String in WCF.String.* --- 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); } };