plandem / lwrte

Export from Google Code. Lightweight Rich Text Editor (RTE / WYSIWYG) for jQuery
https://code.google.com/p/lwrte/
0 stars 0 forks source link

iframe linked style sheet function links array prototype functions as strings #49

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Switch between design and code mode
2. Watch net tab on firebug for bogus HTTP get requests

What is the expected output? What do you see instead?
No HTTP trafic beyond linked sheets.  Bad URI's in the net tab, 
http://yoursite/function(){....

What version of the product are you using? On what operating system?
Firefox 3.5, windows 7, Lightweight RTE - jQuery Plugin, version 1.2.

Please provide any additional information below.

Line 140 in jquery.rte.tb.js is loading up functions as Strings and 
inserting them into the href attr of the inital iframe src. This is the 
original line 140: 
{{{
        for(var i in self.css) 
                css += "<link type='text/css' rel='stylesheet' href='" + 
self.css[i] + "' />";
}}}

I changed it to the following so it would not load the prototype array 
functions: compare, sort. This fixes the problem.

{{{
for(var i in self.css){ 
                if(typeof self.css[i] == 'string'){ 
                        css += "<link type='text/css' rel='stylesheet' 
href='" + self.css[i] + "' />"; 
                }; 
        };
}}}

Original issue reported on code.google.com by tonygerm...@gmail.com on 11 Feb 2010 at 3:27