Fossil SCM
Load HTML files in iframes instead of inlining them directly into /artifact pages.
Commit
63443f920b06653a6f0ae9ad97d419d52187a5d3
Parent
5a936f984cfe314…
1 file changed
+5
-4
+5
-4
| --- src/info.c | ||
| +++ src/info.c | ||
| @@ -1629,14 +1629,15 @@ | ||
| 1629 | 1629 | @ <hr /> |
| 1630 | 1630 | content_get(rid, &content); |
| 1631 | 1631 | if( renderAsWiki ){ |
| 1632 | 1632 | wiki_convert(&content, 0, 0); |
| 1633 | 1633 | }else if( renderAsHtml ){ |
| 1634 | - @ <div> | |
| 1635 | - blob_to_utf8_no_bom(&content, 0); | |
| 1636 | - cgi_append_content(blob_buffer(&content), blob_size(&content)); | |
| 1637 | - @ </div> | |
| 1634 | + @ <iframe src="%R/raw/%T(blob_str(&downloadName))?name=%s(zUuid)" | |
| 1635 | + @ width="100%%" frameborder="0" marginwidth="0" marginheight="0" | |
| 1636 | + @ sandbox="allow-same-origin" | |
| 1637 | + @ onload="this.height = this.contentDocument.documentElement.scrollHeight;"> | |
| 1638 | + @ </iframe> | |
| 1638 | 1639 | }else{ |
| 1639 | 1640 | style_submenu_element("Hex","Hex", "%s/hexdump?name=%s", g.zTop, zUuid); |
| 1640 | 1641 | zMime = mimetype_from_content(&content); |
| 1641 | 1642 | @ <blockquote> |
| 1642 | 1643 | if( zMime==0 ){ |
| 1643 | 1644 |
| --- src/info.c | |
| +++ src/info.c | |
| @@ -1629,14 +1629,15 @@ | |
| 1629 | @ <hr /> |
| 1630 | content_get(rid, &content); |
| 1631 | if( renderAsWiki ){ |
| 1632 | wiki_convert(&content, 0, 0); |
| 1633 | }else if( renderAsHtml ){ |
| 1634 | @ <div> |
| 1635 | blob_to_utf8_no_bom(&content, 0); |
| 1636 | cgi_append_content(blob_buffer(&content), blob_size(&content)); |
| 1637 | @ </div> |
| 1638 | }else{ |
| 1639 | style_submenu_element("Hex","Hex", "%s/hexdump?name=%s", g.zTop, zUuid); |
| 1640 | zMime = mimetype_from_content(&content); |
| 1641 | @ <blockquote> |
| 1642 | if( zMime==0 ){ |
| 1643 |
| --- src/info.c | |
| +++ src/info.c | |
| @@ -1629,14 +1629,15 @@ | |
| 1629 | @ <hr /> |
| 1630 | content_get(rid, &content); |
| 1631 | if( renderAsWiki ){ |
| 1632 | wiki_convert(&content, 0, 0); |
| 1633 | }else if( renderAsHtml ){ |
| 1634 | @ <iframe src="%R/raw/%T(blob_str(&downloadName))?name=%s(zUuid)" |
| 1635 | @ width="100%%" frameborder="0" marginwidth="0" marginheight="0" |
| 1636 | @ sandbox="allow-same-origin" |
| 1637 | @ onload="this.height = this.contentDocument.documentElement.scrollHeight;"> |
| 1638 | @ </iframe> |
| 1639 | }else{ |
| 1640 | style_submenu_element("Hex","Hex", "%s/hexdump?name=%s", g.zTop, zUuid); |
| 1641 | zMime = mimetype_from_content(&content); |
| 1642 | @ <blockquote> |
| 1643 | if( zMime==0 ){ |
| 1644 |