Permalink
Browse files

Merge pull request #352 from trongrg/fix_infinite_loops

prevent infinite-loops when loading mercury editor
  • Loading branch information...
2 parents 3d5a1e2 + 1b06d2e commit 623daa26f42f0ecd4fef58e68de71a03121e6665 @jejacks0n committed Mar 10, 2013
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 623daa2

Please sign in to comment.