[FIX] pad: very bad conception that produced html injection that produced a lot of incorrect css

bzr revid: nicolas.vanhoren@openerp.com-20121120155155-y1wd0px4trljf453
This commit is contained in:
niv-openerp 2012-11-20 16:51:55 +01:00
parent 5f4f975d30
commit 6bc1e836a7
1 changed files with 4 additions and 1 deletions

View File

@ -37,7 +37,10 @@ openerp.pad = function(instance) {
}else{
this.content = '<div class="oe_pad_loading">... Loading pad ...</div>';
$.get(value+'/export/html').success(function(data){
self.$('.oe_pad_content').html('<div class="oe_pad_readonly">'+data+'<div>');
groups = /\<\s*body\s*\>(.*?)\<\s*\/body\s*\>/.exec(data);
data = (groups || []).length >= 2 ? groups[1] : '';
self.$('.oe_pad_content').html('<div class="oe_pad_readonly"><div>');
self.$('.oe_pad_readonly').html(data);
}).error(function(){
self.$('.oe_pad_content').text('Unable to load pad');
});