From 8b74ba07aabc11c1e987e3c7dfe8314c23bb5452 Mon Sep 17 00:00:00 2001 From: David Serduke Date: Tue, 4 Dec 2007 07:36:03 +0000 Subject: [PATCH] For fix #1999 changed the RegExp to be non-greedy. Thanks emartin24. --- src/ajax.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ajax.js b/src/ajax.js index d4f2e127..10496149 100644 --- a/src/ajax.js +++ b/src/ajax.js @@ -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 : ""); }