Ticket #4502: 4502.diff
| File 4502.diff, 2.3 KB (added by , 19 years ago) |
|---|
-
wp-includes/js/prototype.js
1 /* Prototype JavaScript framework, version 1.5.1 1 /* Prototype JavaScript framework, version 1.5.1.1 2 2 * (c) 2005-2007 Sam Stephenson 3 3 * 4 4 * Prototype is freely distributable under the terms of an MIT-style license. … … 7 7 /*--------------------------------------------------------------------------*/ 8 8 9 9 var Prototype = { 10 Version: '1.5.1 ',10 Version: '1.5.1.1', 11 11 12 12 Browser: { 13 13 IE: !!(window.attachEvent && !window.opera), … … 24 24 document.createElement('form').__proto__) 25 25 }, 26 26 27 ScriptFragment: '<script[^>]*>([\\ s\\S]*?)<\/script>',28 JSONFilter: /^\/\*-secure- \s*(.*)\s*\*\/\s*$/,27 ScriptFragment: '<script[^>]*>([\\S\\s]*?)<\/script>', 28 JSONFilter: /^\/\*-secure-([\s\S]*)\*\/\s*$/, 29 29 30 30 emptyFunction: function() { }, 31 31 K: function(x) { return x } … … 364 364 return this.sub(filter || Prototype.JSONFilter, '#{1}'); 365 365 }, 366 366 367 isJSON: function() { 368 var str = this.replace(/\\./g, '@').replace(/"[^"\\\n\r]*"/g, ''); 369 return (/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/).test(str); 370 }, 371 367 372 evalJSON: function(sanitize) { 368 373 var json = this.unfilterJSON(); 369 374 try { 370 if (!sanitize || (/^("(\\.|[^"\\\n\r])*?"|[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t])+?$/.test(json))) 371 return eval('(' + json + ')'); 375 if (!sanitize || json.isJSON()) return eval('(' + json + ')'); 372 376 } catch (e) { } 373 377 throw new SyntaxError('Badly formed JSON string: ' + this.inspect()); 374 378 }, … … 1270 1274 1271 1275 } else document.getElementsByClassName = function(className, parentElement) { 1272 1276 var children = ($(parentElement) || document.body).getElementsByTagName('*'); 1273 var elements = [], child ;1277 var elements = [], child, pattern = new RegExp("(^|\\s)" + className + "(\\s|$)"); 1274 1278 for (var i = 0, length = children.length; i < length; i++) { 1275 1279 child = children[i]; 1276 if (Element.hasClassName(child, className)) 1280 var elementClassName = child.className; 1281 if (elementClassName.length == 0) continue; 1282 if (elementClassName == className || elementClassName.match(pattern)) 1277 1283 elements.push(Element.extend(child)); 1278 1284 } 1279 1285 return elements;