From b04706cefe8f33f0b6c1c8898346404f3b6ceef1 Mon Sep 17 00:00:00 2001 From: Maximilian Mader Date: Thu, 30 May 2013 20:36:28 +0200 Subject: [PATCH] Unify newlines in encodeJS to prevent JS errors on Windows style line endings --- wcfsetup/install/files/lib/util/StringUtil.class.php | 3 +++ 1 file changed, 3 insertions(+) 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); -- 2.20.1