Roo/htmleditor/FilterFileWarning.js
authorAlan <alan@roojs.com>
Wed, 16 Mar 2022 09:05:19 +0000 (17:05 +0800)
committerAlan <alan@roojs.com>
Wed, 16 Mar 2022 09:05:19 +0000 (17:05 +0800)
Roo/htmleditor/FilterFileWarning.js

index e69de29..16a2f8d 100644 (file)
@@ -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");
+        }
+    }
+}