Skip to content

prevent infinite-loops when loading mercury editor #352

Merged
merged 1 commit into from Mar 10, 2013
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
Something went wrong with that request. Please try again.