From: Alan Date: Wed, 16 Mar 2022 09:05:19 +0000 (+0800) Subject: Roo/htmleditor/FilterFileWarning.js X-Git-Url: http://git.roojs.org/?p=roojs1;a=commitdiff_plain;h=734a33dd1bf1f97e37446aeb998e4f5e253248e8 Roo/htmleditor/FilterFileWarning.js --- diff --git a/Roo/htmleditor/FilterFileWarning.js b/Roo/htmleditor/FilterFileWarning.js index e69de29bb2..16a2f8db9b 100644 --- a/Roo/htmleditor/FilterFileWarning.js +++ b/Roo/htmleditor/FilterFileWarning.js @@ -0,0 +1,27 @@ + +/** + * @class Roo.htmleditor.FilterAttributes + * clean attributes and styles including http:// etc.. in attribute + * @constructor +* Run a new Attribute Filter +* @param {Object} config Configuration options + */ +Roo.htmleditor.FilterAttributes = function(cfg) +{ + + var atag = cfg.node.getElementsByTagName('a'); + for(var i =0; i < atags.length;i++) { + var str = '' + atags.item(i).getAttribute('href'); + if (str.match(/^file:/)) { + throw new Exception ("got file url"); + } + } + // less likely + atag = cfg.node.getElementsByTagName('img'); + for(var i =0; i < atags.length;i++) { + var str = '' + atags.item(i).getAttribute('src'); + if (str.match(/^file:/)) { + throw new Exception ("got file url"); + } + } +}