Skip to content
This repository has been archived by the owner on Jan 6, 2023. It is now read-only.

1.4.3.3版本在windows下,多图选择的image.html加载需要20s #3232

Open
wants to merge 42 commits into
base: dev-1.4.3
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
74ee0e8
用例调整
Jul 22, 2013
c4d3d7e
调整用例
Jul 22, 2013
0730c6c
调整用例
Jul 22, 2013
69223db
ie9,10range问题标注
Jul 22, 2013
8fba9bf
[add]by Jinqn 初始化项目
Sep 25, 2013
7ab47ef
[add]by Jinqn
Sep 25, 2013
cdb42a6
[fix]by Jinqn 修改分页符为 <br dataType="page" />
Sep 26, 2013
fc33a59
[fix]恢复到1.2.6.1
Sep 27, 2013
ab68c3a
asp support for dev-1.2.6
techird Oct 18, 2013
134a8a4
Merge pull request #35 from techird/dev-1.2.6
campaign Oct 18, 2013
3c05b4c
1.3.5 merge to master
campaign Dec 1, 2013
9fad64a
1.3.5 merge to master
campaign Dec 1, 2013
69b8cd9
更新readme的下载链接
campaign Dec 1, 2013
7bccbfc
更新readme的下载链接
campaign Dec 1, 2013
2765a93
merge dev1.3.6
Dec 25, 2013
92f9c6f
Update link.html
adin283 Dec 26, 2013
6539e39
修复有些文本标签解析错误
hodorwang Feb 20, 2014
125815f
Update table.cmds.js
AJSoft Mar 8, 2014
1dd4866
Update table.cmds.js
AJSoft Mar 8, 2014
925e2a7
Merge pull request #122 from hodor-cn/master
campaign Mar 27, 2014
a6a9496
Merge pull request #113 from adin283/master
campaign Mar 27, 2014
a1c0139
Merge pull request #124 from AJSoft/patch-1
campaign Apr 10, 2014
09d198c
Merge remote-tracking branch 'origin/dev-1.4.0'
carsonxu May 16, 2014
fd52226
修改php编码
carsonxu May 16, 2014
dced77f
Merge remote-tracking branch 'origin/dev-1.4.3'
carsonxu May 29, 2014
c7f9166
Merge remote-tracking branch 'remotes/origin/dev-1.4.3'
carsonxu May 29, 2014
969b674
修复了 PHP 版本的 SSRF 漏洞
zhangbobell Aug 19, 2015
33222fe
continue to fix SSRF bug
zhangbobell Aug 19, 2015
6e2365e
增加远程抓取图片时对内部地址的过滤
Aug 24, 2015
a182014
升级java版本,增加内部ip地址过滤
Aug 24, 2015
cfa764d
增加远程抓取图片时对私有地址的过滤
Aug 24, 2015
debfc4c
update video-js.swf to fix xss vulnerability, see https://github.com/…
zhangbobell Feb 25, 2016
b23a95b
add xss lib
Phinome May 12, 2016
dfa8586
修复添加图片和视频的xss
May 12, 2016
8cfdc15
Merge pull request #2774 from l5oo00/dev-1.4.3.3
Phinome May 12, 2016
1888d11
添加xssfileter过滤器插件
May 13, 2016
b7ff315
Merge pull request #2776 from robbenmu/dev-1.4.3.3
Phinome May 13, 2016
2499c96
merge config item
Phinome May 18, 2016
7c5fc6b
update img whiltList
Phinome May 26, 2016
8ac9ce5
xssWhiteList filter style attribute & uglify instead of closurecompiler
Phinome Jun 4, 2016
3bebf82
fix(kityformula-plugin): updated xss whitelist to avoid mistaken kity…
zhangbobell Aug 10, 2016
c590734
Update ueditor.config.js
Dafrok Dec 5, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
16 changes: 3 additions & 13 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,16 +107,6 @@ module.exports = function (grunt) {
dest: disDir + '<%= pkg.name %>.parse.min.js'
}
},
closurecompiler: {
dist: {
src: disDir + '<%= pkg.name %>.all.js',
dest: disDir + '<%= pkg.name %>.all.min.js'
},
parse: {
src: disDir + '<%= pkg.name %>.parse.js',
dest: disDir + '<%= pkg.name %>.parse.min.js'
}
},
copy: {
base: {
files: [
Expand Down Expand Up @@ -229,14 +219,14 @@ module.exports = function (grunt) {
grunt.loadNpmTasks('grunt-text-replace');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-closurecompiler');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-transcoding');
grunt.loadNpmTasks('grunt-contrib-clean');

grunt.registerTask('default', 'UEditor build', function () {

var tasks = [ 'concat', 'cssmin', 'closurecompiler', 'copy:base', 'copy:' + server, 'copy:demo', 'replace:demo', 'clean' ];
var tasks = [ 'concat', 'cssmin', 'uglify', 'copy:base', 'copy:' + server, 'copy:demo', 'replace:demo', 'clean' ];

if (encode === 'gbk') {
tasks.push('replace:fileEncode');
Expand Down Expand Up @@ -279,4 +269,4 @@ module.exports = function (grunt) {

}

};
};
Empty file modified _examples/completeDemo.html
100755 → 100644
Empty file.
Empty file modified _examples/customPluginDemo.html
100755 → 100644
Empty file.
Empty file modified _examples/customToolbarDemo.html
100755 → 100644
Empty file.
10 changes: 5 additions & 5 deletions _examples/editor_api.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,9 @@
'plugins/section.js',
'plugins/simpleupload.js',
'plugins/serverparam.js',
'plugins/insertfile.js',
'ui/ui.js',
'plugins/insertfile.js',
'plugins/xssFilter.js',
'ui/ui.js',
'ui/uiutils.js',
'ui/uibase.js',
'ui/separator.js',
Expand Down Expand Up @@ -119,9 +120,8 @@
'adapter/editorui.js',
'adapter/editor.js',
'adapter/message.js',
'adapter/autosave.js'

],
'adapter/autosave.js'
],
baseURL = '../_src/';
for (var i=0,pi;pi = paths[i++];) {
document.write('<script type="text/javascript" src="'+ baseURL + pi +'"></script>');
Expand Down
Empty file modified _examples/filterRuleDemo.html
100755 → 100644
Empty file.
Empty file modified _examples/highlightDemo.html
100755 → 100644
Empty file.
Empty file modified _examples/index.html
100755 → 100644
Empty file.
Empty file modified _examples/jqueryCompleteDemo.html
100755 → 100644
Empty file.
Empty file modified _examples/jqueryValidation.html
100755 → 100644
Empty file.
Empty file modified _examples/multiDemo.html
100755 → 100644
Empty file.
Empty file modified _examples/renderInTable.html
100755 → 100644
Empty file.
Empty file modified _examples/resetDemo.html
100755 → 100644
Empty file.
Empty file modified _examples/setWidthHeightDemo.html
100755 → 100644
Empty file.
Empty file modified _examples/simpleDemo.html
100755 → 100644
Empty file.
Empty file modified _examples/submitFormDemo.html
100755 → 100644
Empty file.
Empty file modified _examples/textareaDemo.html
100755 → 100644
Empty file.
Empty file modified _examples/uparsedemo.html
100755 → 100644
Empty file.
2 changes: 1 addition & 1 deletion _src/core/htmlparser.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,4 +194,4 @@ var htmlparser = UE.htmlparser = function (htmlstr,ignoreBlank) {
text(currentParent, htmlstr.slice(nextIndex));
}
return root;
};
};
20 changes: 19 additions & 1 deletion _src/core/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,24 @@ var utils = UE.utils = {

}) : '';
},
/**
* 将url中的html字符转义, 仅转义 ', ", <, > 四个字符
* @param { String } str 需要转义的字符串
* @param { RegExp } reg 自定义的正则
* @return { String } 转义后的字符串
*/
unhtmlForUrl:function (str, reg) {
return str ? str.replace(reg || /[<">']/g, function (a) {
return {
'<':'&lt;',
'&':'&amp;',
'"':'&quot;',
'>':'&gt;',
"'":'&#39;'
}[a]

}) : '';
},

/**
* 将str中的转义字符还原成html字符
Expand Down Expand Up @@ -1189,4 +1207,4 @@ utils.each(['String', 'Function', 'Array', 'Number', 'RegExp', 'Object', 'Date']
UE.utils['is' + v] = function (obj) {
return Object.prototype.toString.apply(obj) == '[object ' + v + ']';
}
});
});
Empty file modified _src/editor.js
100755 → 100644
Empty file.
28 changes: 27 additions & 1 deletion _src/plugins/image.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,29 @@ UE.commands['insertimage'] = {
return;
}

function unhtmlData(imgCi) {

utils.each('width,height,border,hspace,vspace'.split(','), function (item) {

if (imgCi[item]) {
imgCi[item] = parseInt(imgCi[item], 10) || 0;
}
});

utils.each('src,_src'.split(','), function (item) {

if (imgCi[item]) {
imgCi[item] = utils.unhtmlForUrl(imgCi[item]);
}
});
utils.each('title,alt'.split(','), function (item) {

if (imgCi[item]) {
imgCi[item] = utils.unhtml(imgCi[item]);
}
});
}

if (img && /img/i.test(img.tagName) && (img.className != "edui-faked-video" || img.className.indexOf("edui-upload-video")!=-1) && !img.getAttribute("word_img")) {
var first = opt.shift();
var floatStyle = first['floatStyle'];
Expand All @@ -213,6 +236,8 @@ UE.commands['insertimage'] = {
var html = [], str = '', ci;
ci = opt[0];
if (opt.length == 1) {
unhtmlData(ci);

str = '<img src="' + ci.src + '" ' + (ci._src ? ' _src="' + ci._src + '" ' : '') +
(ci.width ? 'width="' + ci.width + '" ' : '') +
(ci.height ? ' height="' + ci.height + '" ' : '') +
Expand All @@ -229,6 +254,7 @@ UE.commands['insertimage'] = {

} else {
for (var i = 0; ci = opt[i++];) {
unhtmlData(ci);
str = '<p ' + (ci['floatStyle'] == 'center' ? 'style="text-align: center" ' : '') + '><img src="' + ci.src + '" ' +
(ci.width ? 'width="' + ci.width + '" ' : '') + (ci._src ? ' _src="' + ci._src + '" ' : '') +
(ci.height ? ' height="' + ci.height + '" ' : '') +
Expand All @@ -244,4 +270,4 @@ UE.commands['insertimage'] = {

me.fireEvent('afterinsertimage', opt)
}
};
};
2 changes: 1 addition & 1 deletion _src/plugins/table.cmds.js
Original file line number Diff line number Diff line change
Expand Up @@ -933,4 +933,4 @@
return [];
}
}
})();
})();
10 changes: 9 additions & 1 deletion _src/plugins/video.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,14 @@ UE.plugins['video'] = function (){
* @param addParagraph 是否需要添加P 标签
*/
function creatInsertStr(url,width,height,id,align,classname,type){

url = utils.unhtmlForUrl(url);
align = utils.unhtml(align);
classname = utils.unhtml(classname);

width = parseInt(width, 10) || 0;
height = parseInt(height, 10) || 0;

var str;
switch (type){
case 'image':
Expand Down Expand Up @@ -150,4 +158,4 @@ UE.plugins['video'] = function (){
return flag ? 1 : 0;
}
};
};
};
79 changes: 79 additions & 0 deletions _src/plugins/xssFilter.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
/**
* @file xssFilter.js
* @desc xss过滤器
* @author robbenmu
*/

UE.plugins.xssFilter = function() {

var config = UEDITOR_CONFIG;
var whitList = config.whitList;

function filter(node) {

var tagName = node.tagName;
var attrs = node.attrs;

if (!whitList.hasOwnProperty(tagName)) {
node.parentNode.removeChild(node);
return false;
}

UE.utils.each(attrs, function (val, key) {

if (whitList[tagName].indexOf(key) === -1) {
node.setAttr(key);
}
});
}

// 添加inserthtml\paste等操作用的过滤规则
if (whitList && config.xssFilterRules) {
this.options.filterRules = function () {

var result = {};

UE.utils.each(whitList, function(val, key) {
result[key] = function (node) {
return filter(node);
};
});

return result;
}();
}

var tagList = [];

UE.utils.each(whitList, function (val, key) {
tagList.push(key);
});

// 添加input过滤规则
//
if (whitList && config.inputXssFilter) {
this.addInputRule(function (root) {

root.traversal(function(node) {
if (node.type !== 'element') {
return false;
}
filter(node);
});
});
}
// 添加output过滤规则
//
if (whitList && config.outputXssFilter) {
this.addOutputRule(function (root) {

root.traversal(function(node) {
if (node.type !== 'element') {
return false;
}
filter(node);
});
});
}

};
Empty file modified _src/ui/button.js
100755 → 100644
Empty file.
Empty file modified _src/ui/dialog.js
100755 → 100644
Empty file.
Empty file modified _src/ui/toolbar.js
100755 → 100644
Empty file.
Empty file modified _src/ui/ui.js
100755 → 100644
Empty file.
43 changes: 43 additions & 0 deletions _test/coverage/api.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/* automatically generated by JSCoverage - do not edit */
try {
if (typeof top === 'object' && top !== null && typeof top.opener === 'object' && top.opener !== null) {
// this is a browser window that was opened from another window

if (! top.opener._$jscoverage) {
top.opener._$jscoverage = {};
}
}
}
catch (e) {}

try {
if (typeof top === 'object' && top !== null) {
// this is a browser window

try {
if (typeof top.opener === 'object' && top.opener !== null && top.opener._$jscoverage) {
top._$jscoverage = top.opener._$jscoverage;
}
}
catch (e) {}

if (! top._$jscoverage) {
top._$jscoverage = {};
}
}
}
catch (e) {}

try {
if (typeof top === 'object' && top !== null && top._$jscoverage) {
_$jscoverage = top._$jscoverage;
}
}
catch (e) {}
if (typeof _$jscoverage !== 'object') {
_$jscoverage = {};
}
if (! _$jscoverage['api.js']) {
_$jscoverage['api.js'] = [];
}
_$jscoverage['api.js'].source = ["<span class=\"c\">/**</span>","<span class=\"c\"> * &#35813;&#25991;&#20214;&#23450;&#20041;&#20102;API&#25991;&#26723;&#25152;&#20351;&#29992;&#21040;&#30340;&#26412;&#22320;&#20989;&#25968;&#30340;&#35828;&#26126;</span>","<span class=\"c\"> * @file</span>","<span class=\"c\"> * @module Native</span>","<span class=\"c\"> */</span>","","<span class=\"c\">/**</span>","<span class=\"c\"> * &#36741;&#21161;&#25509;&#21475;&#35828;&#26126;</span>","<span class=\"c\"> * @module Native</span>","<span class=\"c\"> * @unfile</span>","<span class=\"c\"> */</span>","","<span class=\"c\">/**</span>","<span class=\"c\"> * &#21407;&#29983;String&#23545;&#35937;&#65292; &#23383;&#31526;&#20018;</span>","<span class=\"c\"> * @class String</span>","<span class=\"c\"> */</span>","","<span class=\"c\">/**</span>","<span class=\"c\"> * &#21407;&#29983;Function&#23545;&#35937;&#65292; &#20989;&#25968;</span>","<span class=\"c\"> * @class Function</span>","<span class=\"c\"> */</span>","","<span class=\"c\">/**</span>","<span class=\"c\"> * &#21407;&#29983;Object&#23545;&#35937;&#65292; &#26222;&#36890;&#23545;&#35937;</span>","<span class=\"c\"> * @class Object</span>","<span class=\"c\"> */</span>","","<span class=\"c\">/**</span>","<span class=\"c\"> * &#21407;&#29983;Boolean&#23545;&#35937;&#65292; &#24067;&#23572;&#20540;</span>","<span class=\"c\"> * @class Boolean</span>","<span class=\"c\"> */</span>","","<span class=\"c\">/**</span>","<span class=\"c\"> * &#21407;&#29983;Number&#23545;&#35937;&#65292; &#25968;&#20540;</span>","<span class=\"c\"> * @class Number</span>","<span class=\"c\"> */</span>","","<span class=\"c\">/**</span>","<span class=\"c\"> * &#21407;&#29983;NULL&#23545;&#35937;&#65292; &#31354;</span>","<span class=\"c\"> * @class NULL</span>","<span class=\"c\"> */</span>","","<span class=\"c\">/**</span>","<span class=\"c\"> * &#21407;&#29983;Array&#23545;&#35937;&#65292; &#25968;&#32452;</span>","<span class=\"c\"> * @class Array</span>","<span class=\"c\"> */</span>","","<span class=\"c\">/**</span>","<span class=\"c\"> * &#27983;&#35272;&#22120;DOMNode&#65292; dom&#33410;&#28857;</span>","<span class=\"c\"> * @class Node</span>","<span class=\"c\"> */</span>","","<span class=\"c\">/**</span>","<span class=\"c\"> * &#27983;&#35272;&#22120;DOMElement&#65292; dom&#20803;&#32032;</span>","<span class=\"c\"> * @class Element</span>","<span class=\"c\"> */</span>"];
43 changes: 43 additions & 0 deletions _test/coverage/commands.js

Large diffs are not rendered by default.

Loading