From: Maximilian Mader Date: Thu, 30 May 2013 18:36:28 +0000 (+0200) Subject: Unify newlines in encodeJS to prevent JS errors on Windows style line endings X-Git-Tag: 2.0.0_Beta_2~7^2~2^2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=b04706cefe8f33f0b6c1c8898346404f3b6ceef1;p=GitHub%2FWoltLab%2FWCF.git Unify newlines in encodeJS to prevent JS errors on Windows style line endings --- diff --git a/wcfsetup/install/files/lib/util/StringUtil.class.php b/wcfsetup/install/files/lib/util/StringUtil.class.php index d042630a9d..4c44cc6407 100644 --- a/wcfsetup/install/files/lib/util/StringUtil.class.php +++ b/wcfsetup/install/files/lib/util/StringUtil.class.php @@ -97,6 +97,9 @@ final class StringUtil { public static function encodeJS($string) { if (is_object($string)) $string = $string->__toString(); + // unify newlines + $string = self::unifyNewlines($string); + // escape backslash $string = self::replace("\\", "\\\\", $string);