Ticket #8851: Fix_IE_memory_leak.patch
| File Fix_IE_memory_leak.patch, 1.5 kB (added by jamesots, 2 years ago) |
|---|
-
resources/js/prototype.js
old new 399 399 } 400 400 }); 401 401 402 if (Prototype.Browser.WebKit || Prototype.Browser.IE) Object.extend(String.prototype, { 403 escapeHTML: function() { 404 return this.replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>'); 405 }, 406 unescapeHTML: function() { 407 return this.replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>'); 408 } 409 }); 402 if (Prototype.Browser.WebKit || Prototype.Browser.IE) { 403 Object.extend(String.prototype, { 404 escapeHTML: function() { 405 return this.replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>'); 406 }, 407 unescapeHTML: function() { 408 return this.replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>'); 409 } 410 }); 411 } else { 412 Object.extend(String.prototype.escapeHTML, { 413 div: document.createElement('div'), 414 text: document.createTextNode('') 415 }); 410 416 417 with (String.prototype.escapeHTML) div.appendChild(text); 418 } 419 411 420 String.prototype.gsub.prepareReplacement = function(replacement) { 412 421 if (typeof replacement == 'function') return replacement; 413 422 var template = new Template(replacement); … … 416 425 417 426 String.prototype.parseQuery = String.prototype.toQueryParams; 418 427 419 Object.extend(String.prototype.escapeHTML, {420 div: document.createElement('div'),421 text: document.createTextNode('')422 });423 424 with (String.prototype.escapeHTML) div.appendChild(text);425 426 428 var Template = Class.create(); 427 429 Template.Pattern = /(^|.|\r|\n)(#\{(.*?)\})/; 428 430 Template.prototype = {