From: Alexander Ebert Date: Thu, 25 Apr 2013 13:31:02 +0000 (+0200) Subject: Fixed evaluation of HTML through jQuery X-Git-Tag: 2.0.0_Beta_1~299 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=9ae579726fcff62309f91b619a6390de9a82f560;p=GitHub%2FWoltLab%2FWCF.git 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 --- 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); }