Skip to content

Commit

Permalink
#8602 : Image src is now properly hidden when running data through th…
Browse files Browse the repository at this point in the history
…e data processor.

git-svn-id: https://svn.ckeditor.com/CKEditor/trunk@7413 da63caf2-3823-0410-a1e8-d69ccee00dfb
  • Loading branch information
fredck authored and Garry Yao committed Apr 17, 2012
1 parent 643d1c9 commit 205ff14
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
2 changes: 1 addition & 1 deletion ckeditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
/*jsl:ignore*/
window.CKEDITOR || ( window.CKEDITOR = function() {
var e = {
timestamp: "", version: "%VERSION%", revision: "%REV%", _: { pending: [] },
timestamp: "", version: "%VERSION%", revision: "%REV%", rdn: Math.floor( 900 * Math.random() ) + 100, _: { pending: [] },
status: "unloaded", basePath: function() {
var a = window.CKEDITOR_BASEPATH || ""; if ( !a )
for ( var c = document.getElementsByTagName( "script" ), b = 0; b < c.length; b++ ) {
Expand Down
10 changes: 9 additions & 1 deletion core/ckeditor_base.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
// Must be updated on changes in the script as well as updated in the
// ckeditor_source.js and ckeditor_basic_source.js files.

//window.CKEDITOR||(window.CKEDITOR=function(){var e={timestamp:"",version:"%VERSION%",revision:"%REV%",_:{pending:[]},status:"unloaded",basePath:function(){var a=window.CKEDITOR_BASEPATH||"";if(!a)for(var c=document.getElementsByTagName("script"),b=0;b<c.length;b++){var d=c[b].src.match(/(^|.*[\\\/])ckeditor(?:_basic)?(?:_source)?.js(?:\?.*)?$/i);if(d){a=d[1];break}}-1==a.indexOf(":/")&&(a=0===a.indexOf("/")?location.href.match(/^.*?:\/\/[^\/]*/)[0]+a:location.href.match(/^[^\?]*\/(?:)/)[0]+a);if(!a)throw'The CKEditor installation path could not be automatically detected. Please set the global variable "CKEDITOR_BASEPATH" before creating editor instances.'; return a}(),getUrl:function(a){-1==a.indexOf(":/")&&0!==a.indexOf("/")&&(a=this.basePath+a);this.timestamp&&"/"!=a.charAt(a.length-1)&&!/[&?]t=/.test(a)&&(a+=(0<=a.indexOf("?")?"&":"?")+"t="+this.timestamp);return a},domReady:function(){function a(){try{document.addEventListener?document.removeEventListener("DOMContentLoaded",a,!1):document.attachEvent&&document.detachEvent("onreadystatechange",a)}catch(b){}for(var d;d=c.shift();)d()}var c=[];return function(b){c.push(b);"complete"===document.readyState&& setTimeout(a,1);if(1==c.length)if(document.addEventListener)document.addEventListener("DOMContentLoaded",a,!1),window.addEventListener("load",a,!1);else if(document.attachEvent){document.attachEvent("onreadystatechange",a);window.attachEvent("onload",a);b=!1;try{b=null==window.frameElement}catch(d){}document.documentElement.doScroll&&b&&function g(){try{document.documentElement.doScroll("left")}catch(b){setTimeout(g,1);return}a()}()}}}()},f=window.CKEDITOR_GETURL;if(f){var h=e.url;e.url=function(a){return f.call(e, a)||h.call(e,a)}}return e}());
// window.CKEDITOR||(window.CKEDITOR=function(){var e={timestamp:"",version:"%VERSION%",revision:"%REV%",rdn:Math.floor(900*Math.random())+100,_:{pending:[]},status:"unloaded",basePath:function(){var a=window.CKEDITOR_BASEPATH||"";if(!a)for(var c=document.getElementsByTagName("script"),b=0;b<c.length;b++){var d=c[b].src.match(/(^|.*[\\\/])ckeditor(?:_basic)?(?:_source)?.js(?:\?.*)?$/i);if(d){a=d[1];break}}-1==a.indexOf(":/")&&(a=0===a.indexOf("/")?location.href.match(/^.*?:\/\/[^\/]*/)[0]+a:location.href.match(/^[^\?]*\/(?:)/)[0]+ a);if(!a)throw'The CKEditor installation path could not be automatically detected. Please set the global variable "CKEDITOR_BASEPATH" before creating editor instances.';return a}(),getUrl:function(a){-1==a.indexOf(":/")&&0!==a.indexOf("/")&&(a=this.basePath+a);this.timestamp&&"/"!=a.charAt(a.length-1)&&!/[&?]t=/.test(a)&&(a+=(0<=a.indexOf("?")?"&":"?")+"t="+this.timestamp);return a},domReady:function(){function a(){try{document.addEventListener?document.removeEventListener("DOMContentLoaded",a,!1): document.attachEvent&&document.detachEvent("onreadystatechange",a)}catch(b){}for(var d;d=c.shift();)d()}var c=[];return function(b){c.push(b);"complete"===document.readyState&&setTimeout(a,1);if(1==c.length)if(document.addEventListener)document.addEventListener("DOMContentLoaded",a,!1),window.addEventListener("load",a,!1);else if(document.attachEvent){document.attachEvent("onreadystatechange",a);window.attachEvent("onload",a);b=!1;try{b=null==window.frameElement}catch(d){}document.documentElement.doScroll&& b&&function g(){try{document.documentElement.doScroll("left")}catch(b){setTimeout(g,1);return}a()}()}}}()},f=window.CKEDITOR_GETURL;if(f){var h=e.url;e.url=function(a){return f.call(e,a)||h.call(e,a)}}return e}());

// The Closure Compiler online service should be used when updating this manually:
// http://closure-compiler.appspot.com/
Expand Down Expand Up @@ -72,6 +72,14 @@ if ( !window.CKEDITOR ) {
*/
revision: '%REV%',

/**
* A 3-digit random integer, valid for the entire life of the CKEDITOR object.
* @type Number
* @example
* alert( CKEDITOR.rnd ); // e.g. '319'
*/
rdn: Math.floor( Math.random() * ( 999 /*Max*/ - 100 /*Min*/ + 1 ) ) + 100 /*Min*/,

/**
* Private object used to hold core stuff. It should not be used outside of
* the API code as properties defined here may change at any time
Expand Down
8 changes: 2 additions & 6 deletions plugins/htmldataprocessor/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
// Avoid corrupting the inline event attributes (#7243).
// We should not rewrite the existed protected attributes, e.g. clipboard content from editor. (#5218)
if ( !( /^on/ ).test( attrName ) && attributes.indexOf( 'data-cke-saved-' + attrName ) == -1 )
return ' data-cke-saved-' + fullAttr + ' ' + fullAttr;
return ' data-cke-saved-' + fullAttr + ' data-cke-' + CKEDITOR.rdn + '-' + fullAttr;

return fullAttr;
}) + '>';
Expand Down Expand Up @@ -453,10 +453,6 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
isPre = 1;
}

// Prevent execution of event handlers in the div (#8630)
var prefix = 'data-cke' + CKEDITOR.tools.getNextNumber() + '-';
data = data.replace( /(\s)(on)/ig, '$1' + prefix + '$2' );

// Call the browser to help us fixing a possibly invalid HTML
// structure.
var el = this.editor.document.createElement( fixBin );
Expand All @@ -465,7 +461,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
data = el.getHtml().substr( 1 );

// Restore shortly protected attribute names.
data = data.replace( new RegExp( ' data-cke-' + CKEDITOR.rnd + '-', 'ig' ), ' ' );
data = data.replace( new RegExp( ' data-cke-' + CKEDITOR.rdn + '-', 'ig' ), ' ' );

isPre && ( data = data.replace( /^<pre>|<\/pre>$/gi, '' ) );

Expand Down

0 comments on commit 205ff14

Please sign in to comment.