From 074ff98084e7e71b8218feeea4836eb4d26834f6 Mon Sep 17 00:00:00 2001 From: juanf <juanf> Date: Fri, 4 Mar 2016 13:56:29 +0000 Subject: [PATCH] SSDM-3295 : Style attributes are now allowed. SVN: 35806 --- .../lib/caja-HTML-sanitizer/js/sanitizer.js | 75 ++++++++++--------- 1 file changed, 38 insertions(+), 37 deletions(-) diff --git a/plasmid/source/core-plugins/eln-lims/1/as/webapps/eln-lims/html/lib/caja-HTML-sanitizer/js/sanitizer.js b/plasmid/source/core-plugins/eln-lims/1/as/webapps/eln-lims/html/lib/caja-HTML-sanitizer/js/sanitizer.js index 18739c1e4b3..fd659809d2b 100644 --- a/plasmid/source/core-plugins/eln-lims/1/as/webapps/eln-lims/html/lib/caja-HTML-sanitizer/js/sanitizer.js +++ b/plasmid/source/core-plugins/eln-lims/1/as/webapps/eln-lims/html/lib/caja-HTML-sanitizer/js/sanitizer.js @@ -905,43 +905,44 @@ var html = (function(html4) { } break; case html4.atype['STYLE']: - if ('undefined' === typeof parseCssDeclarations) { - value = null; - if (opt_logger) { - log(opt_logger, tagName, attribName, oldValue, value); - } - break; - } - var sanitizedDeclarations = []; - parseCssDeclarations( - value, - { - 'declaration': function (property, tokens) { - var normProp = property.toLowerCase(); - sanitizeCssProperty( - normProp, tokens, - opt_naiveUriRewriter - ? function (url) { - return safeUri( - url, html4.ueffects.SAME_DOCUMENT, - html4.ltypes.SANDBOXED, - { - "TYPE": "CSS", - "CSS_PROP": normProp - }, opt_naiveUriRewriter); - } - : null); - if (tokens.length) { - sanitizedDeclarations.push( - normProp + ': ' + tokens.join(' ')); - } - } - }); - value = sanitizedDeclarations.length > 0 ? - sanitizedDeclarations.join(' ; ') : null; - if (opt_logger) { - log(opt_logger, tagName, attribName, oldValue, value); - } +// TODO: Configure style tags to be allowed +// if ('undefined' === typeof parseCssDeclarations) { +// value = null; +// if (opt_logger) { +// log(opt_logger, tagName, attribName, oldValue, value); +// } +// break; +// } +// var sanitizedDeclarations = []; +// parseCssDeclarations( +// value, +// { +// 'declaration': function (property, tokens) { +// var normProp = property.toLowerCase(); +// sanitizeCssProperty( +// normProp, tokens, +// opt_naiveUriRewriter +// ? function (url) { +// return safeUri( +// url, html4.ueffects.SAME_DOCUMENT, +// html4.ltypes.SANDBOXED, +// { +// "TYPE": "CSS", +// "CSS_PROP": normProp +// }, opt_naiveUriRewriter); +// } +// : null); +// if (tokens.length) { +// sanitizedDeclarations.push( +// normProp + ': ' + tokens.join(' ')); +// } +// } +// }); +// value = sanitizedDeclarations.length > 0 ? +// sanitizedDeclarations.join(' ; ') : null; +// if (opt_logger) { +// log(opt_logger, tagName, attribName, oldValue, value); +// } break; case html4.atype['ID']: case html4.atype['IDREF']: -- GitLab