From 734a33dd1bf1f97e37446aeb998e4f5e253248e8 Mon Sep 17 00:00:00 2001 From: Alan Date: Wed, 16 Mar 2022 17:05:19 +0800 Subject: [PATCH] Roo/htmleditor/FilterFileWarning.js --- Roo/htmleditor/FilterFileWarning.js | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) 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"); + } + } +} -- 2.39.2