Commits

John Wright committed 5eadd19

Making sure that CSS href attributes aren't mangled when they have a query string.

Comments (0)

Files changed (1)

src/app/public/js/refresh.coffee

 
 	for style in styles
 		if style.getAttribute('rel') is 'stylesheet'
-			style.href = style.href.replace /\?.*|$/, "?stamp=#{stamp}"
+			href = style.href
+			queryIndex = href.indexOf '?'
+			if queryIndex >= 0
+				if href.indexOf('stamp', queryIndex) >= 0
+					style.href = href.replace /([\?&]_frontfax_stamp=)\d+/, "$1#{stamp}"
+				else
+					style.href += "&_frontfax_stamp=#{stamp}"
+			else
+				style.href += "?_frontfax_stamp=#{stamp}"