Ticket #5218: 5218.2.patch
File 5218.2.patch, 1.4 KB (added by , 14 years ago) |
---|
-
_source/plugins/htmldataprocessor/plugin.js
263 263 defaultHtmlFilterRules.elements[ i ] = unprotectReadyOnly; 264 264 } 265 265 266 var protectAttributeRegex = /<(?:a|area|img|input)[\s\S]*?\s((?:href|src|name)\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|(?:[^ "'>]+)))/gi; 266 var protectAttributeRegex = /<((?:a|area|img|input)[\s\S]*?\s)((href|src|name)\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|(?:[^ "'>]+)))([^>]*)>/gi, 267 findSavedSrcRegex = /\s_cke_saved_src\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|(?:[^ "'>]+))/; 267 268 268 269 var protectElementsRegex = /(?:<style(?=[ >])[^>]*>[\s\S]*<\/style>)|(?:<(:?link|meta|base)[^>]*>)/gi, 269 270 encodedElementsRegex = /<cke:encoded>([^<]*)<\/cke:encoded>/gi; … … 275 276 276 277 function protectAttributes( html ) 277 278 { 278 return html.replace( protectAttributeRegex, '$& _cke_saved_$1' ); 279 return html.replace( protectAttributeRegex, function( tag, beginning, fullAttr, attrName, end ) 280 { 281 // We should not rewrite the _cke_saved_src attribute (#5218) 282 if ( attrName == 'src' && findSavedSrcRegex.test( tag ) ) 283 return tag; 284 else 285 return '<' + beginning + fullAttr + ' _cke_saved_' + fullAttr + end + '>'; 286 }); 279 287 } 280 288 281 289 function protectElements( html )