]> source.dussan.org Git - jquery.git/commitdiff
For fix #1999 changed the RegExp to be non-greedy. Thanks emartin24.
authorDavid Serduke <davidserduke@gmail.com>
Tue, 4 Dec 2007 07:36:03 +0000 (07:36 +0000)
committerDavid Serduke <davidserduke@gmail.com>
Tue, 4 Dec 2007 07:36:03 +0000 (07:36 +0000)
src/ajax.js

index d4f2e12714b0634dab19be08f75e36b5db936fdf..104961497c96b4eeb553a425d70cc669b1ca7d57 100644 (file)
@@ -200,7 +200,7 @@ jQuery.extend({
                if ( s.cache === false && s.type.toLowerCase() == "get" ) {
                        var ts = (new Date()).getTime();
                        // try replacing _= if it is there
-                       var ret = s.url.replace(/(\?|&)_=.*(&|$)/, "$1_=" + ts + "$2");
+                       var ret = s.url.replace(/(\?|&)_=.*?(&|$)/, "$1_=" + ts + "$2");
                        // if nothing was replaced, add timestamp to the end
                        s.url = ret + ((ret == s.url) ? (s.url.match(/\?/) ? "&" : "?") + "_=" + ts : "");
                }