From 9ae579726fcff62309f91b619a6390de9a82f560 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Thu, 25 Apr 2013 15:31:02 +0200 Subject: [PATCH] Fixed evaluation of HTML through jQuery You should alway return HTML using the array index "template" (accessible as data.returnValues.template), as it's contents will be automatically trimmed. If you fail to use it, make sure to either trim it server-side or use $($.parseHTML(htmlString)). See http://jquery.com/upgrade-guide/1.9/#jquery-htmlstring-versus-jquery-selectorstring --- wcfsetup/install/files/js/WCF.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/wcfsetup/install/files/js/WCF.js b/wcfsetup/install/files/js/WCF.js index d50ea00533..6c08977146 100755 --- a/wcfsetup/install/files/js/WCF.js +++ b/wcfsetup/install/files/js/WCF.js @@ -1629,6 +1629,11 @@ WCF.Action.Proxy = Class.extend({ // call child method if applicable if ($.isFunction(this.options.success)) { + // trim HTML before processing, see http://jquery.com/upgrade-guide/1.9/#jquery-htmlstring-versus-jquery-selectorstring + if (data.returnValues && data.returnValues.template !== undefined) { + data.returnValues.template = $.trim(data.returnValues.template); + } + this.options.success(data, textStatus, jqXHR); } -- 2.20.1