Applied the RegExp issues reported by Jeff Robinson here: http://jmrware.com/articles...
[jquery.git] / src / ajax.js
index bfae782..cc87133 100644 (file)
@@ -1,12 +1,13 @@
 (function( jQuery ) {
 
 var jsc = jQuery.now(),
-       rscript = /<script(.|\s)*?\/script>/gi,
-       rselectTextarea = /select|textarea/i,
-       rinput = /color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week/i,
+       rscript = /<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,
+       rselectTextarea = /^(?:select|textarea)/i,
+       rinput = /^(?:color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,
+       rbracket = /\[\]$/,
        jsre = /\=\?(&|$)/,
        rquery = /\?/,
-       rts = /(\?|&)_=.*?(&|$)/,
+       rts = /([?&])_=[^&]*(&?)/,
        rurl = /^(\w+:)?\/\/([^\/?#]+)/,
        r20 = /%20/g,
 
@@ -61,7 +62,7 @@ jQuery.fn.extend({
                                        // See if a selector was specified
                                        self.html( selector ?
                                                // Create a dummy div to hold the results
-                                               jQuery("<div />")
+                                               jQuery("<div>")
                                                        // inject the contents of the document in, removing the scripts
                                                        // to avoid any 'Permission Denied' errors in IE
                                                        .append(res.responseText.replace(rscript, ""))
@@ -542,7 +543,7 @@ function buildParams( prefix, obj, traditional, add ) {
        if ( jQuery.isArray(obj) ) {
                // Serialize array item.
                jQuery.each( obj, function( i, v ) {
-                       if ( traditional || /\[\]$/.test( prefix ) ) {
+                       if ( traditional || rbracket.test( prefix ) ) {
                                // Treat each array item as a scalar.
                                add( prefix, v );