Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: templates/sitekey_frame.tmpl

Issue 29329256: Issue 3122 - Restrict allowed URLs for the sitekey_frame (Closed)
Patch Set: Created Oct. 16, 2015, 12:25 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: templates/sitekey_frame.tmpl
diff --git a/templates/sitekey_frame.tmpl b/templates/sitekey_frame.tmpl
index c136b2ad2086070e81ff33f6584859f3a870fa98..96d392e02519bb389616eb8e6523a878057b106b 100644
--- a/templates/sitekey_frame.tmpl
+++ b/templates/sitekey_frame.tmpl
@@ -4,7 +4,11 @@
<script type="text/javascript">
function frame_url(parent_location)
{
- return parent_location.hash.substring(1);
+ var href = parent_location.href;
+ var hash = parent_location.hash;
+ return base_href = href.substr(
saroyanm 2015/11/16 13:53:25 The description says Restrict allowed URLs for the
kzar 2015/11/16 23:01:09 So the sitekey_frame page contains a big iFrame an
saroyanm 2015/11/17 11:28:33 I see. What about: return parent_location.origin +
kzar 2015/11/19 12:56:00 Good point, much better. Done.
+ 0, href.length - hash.length - parent_location.pathname.length
+ ) + hash.substring(1);
}
</script>
{% endblock %}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld