Skip to content
Browse files

prevent infinite-loops when loading mercury editor

  • Loading branch information...
1 parent 0c04803 commit 1b06d2edce5109987e462aad0d7af1e51a6270a6 @trongrg trongrg committed
Showing with 1 addition and 2 deletions.
  1. +1 −2 app/assets/javascripts/mercury/page_editor.js.coffee
View
3 app/assets/javascripts/mercury/page_editor.js.coffee
@@ -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

0 comments on commit 1b06d2e

Please sign in to comment.
Something went wrong with that request. Please try again.