]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 995873 - Don't use replaceState if it would result in an invalid URL
authorSimon Green <sgreen@redhat.com>
Tue, 15 Apr 2014 01:28:11 +0000 (11:28 +1000)
committerSimon Green <sgreen@redhat.com>
Tue, 15 Apr 2014 01:28:11 +0000 (11:28 +1000)
r=justdave, a=justdave

template/en/default/list/list.html.tmpl

index de289e3dd0e46c5bef3ed9c37af0c76c750ff7ba..c85564d27398af3cfe45acdf6482aa66690126e9 100644 (file)
     [% new_param = cgi.canonicalise_query %]
   [% END %]
 
-  if (history && history.replaceState) {
-    history.replaceState(null, "[% unfiltered_title FILTER js %]",
-                         "buglist.cgi?[% new_param FILTER js %]");
-    document.title = "[% unfiltered_title FILTER js %]";
-  }
+  [% IF new_param.length + 12 < constants.CGI_URI_LIMIT %]
+    if (history && history.replaceState) {
+      history.replaceState(null, "[% unfiltered_title FILTER js %]",
+                           "buglist.cgi?[% new_param FILTER js %]");
+      document.title = "[% unfiltered_title FILTER js %]";
+    }
+  [% END %]
   [% javascript FILTER none %]
 [% END %]