Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Change embedded regexp to a variable (for #6876).
  • Loading branch information
dmethvin authored and csnover committed Jan 9, 2011
1 parent 1d1d4fe commit 4e86766
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/ajax.js
Expand Up @@ -11,6 +11,7 @@ var r20 = /%20/g,
rselectTextarea = /^(?:select|textarea)/i, rselectTextarea = /^(?:select|textarea)/i,
rts = /([?&])_=[^&]*/, rts = /([?&])_=[^&]*/,
rurl = /^(\w+:)?\/\/([^\/?#:]+)(?::(\d+))?/, rurl = /^(\w+:)?\/\/([^\/?#:]+)(?::(\d+))?/,
rCRLF = /\r?\n/g,


// Slice function // Slice function
sliceFunc = Array.prototype.slice, sliceFunc = Array.prototype.slice,
Expand Down Expand Up @@ -107,9 +108,9 @@ jQuery.fn.extend({
null : null :
jQuery.isArray(val) ? jQuery.isArray(val) ?
jQuery.map( val, function(val, i){ jQuery.map( val, function(val, i){
return {name: elem.name, value: val.replace(/\r?\n/g, "\r\n")}; return { name: elem.name, value: val.replace(rCRLF, "\r\n") };
}) : }) :
{name: elem.name, value: val.replace(/\r?\n/g, "\r\n")}; { name: elem.name, value: val.replace(rCRLF, "\r\n") };
}).get(); }).get();
} }
}); });
Expand Down

0 comments on commit 4e86766

Please sign in to comment.