Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #352 from trongrg/fix_infinite_loops

prevent infinite-loops when loading mercury editor
  • Loading branch information...
commit 623daa26f42f0ecd4fef58e68de71a03121e6665 2 parents 3d5a1e2 + 1b06d2e
Jeremy Jackson authored
Showing with 1 addition and 2 deletions.
  1. +1 −2  app/assets/javascripts/mercury/page_editor.js.coffee
3  app/assets/javascripts/mercury/page_editor.js.coffee
View
@@ -177,8 +177,7 @@ class @Mercury.PageEditor
iframeSrc: (url = null, params = false) ->
# remove the /editor segment of the url if it gets passed through
url = (url ? window.location.href).replace(Mercury.config.editorUrlRegEx ?= /([http|https]:\/\/.[^\/]*)\/editor\/?(.*)/i, "$1/$2")
- url = url.replace(/[\?|\&]mercury_frame=true/gi, '')
- url = url.replace(/\&_=\d+/gi, '')
+ url = url.replace(/[\?|\&]mercury_frame=true/gi, '').replace(/\&_=\d+/gi, '').replace(/#$/, '')
if params
# add a param allowing the server to know that the request is coming from mercury
# and add a cache busting param so we don't get stale content
Please sign in to comment.
Something went wrong with that request. Please try again.