loading SVG via <img> instead of <object> to stop inline JS execution
This commit is contained in:
parent
e2272e7786
commit
2b62cc8171
@ -3,7 +3,7 @@
|
|||||||
* Name: Handle SVG
|
* Name: Handle SVG
|
||||||
* Author: Shish <webmaster@shishnet.org>
|
* Author: Shish <webmaster@shishnet.org>
|
||||||
* Link: http://code.shishnet.org/shimmie2/
|
* Link: http://code.shishnet.org/shimmie2/
|
||||||
* Description: Handle SVG files. (No thumbnail is generated for SVG files)
|
* Description: Handle static SVG files. (No thumbnail is generated for SVG files)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class SVGFileHandler extends Extension {
|
class SVGFileHandler extends Extension {
|
||||||
|
@ -5,9 +5,8 @@ class SVGFileHandlerTheme extends Themelet {
|
|||||||
$ilink = make_link("get_svg/{$image->id}/{$image->id}.svg");
|
$ilink = make_link("get_svg/{$image->id}/{$image->id}.svg");
|
||||||
// $ilink = $image->get_image_link();
|
// $ilink = $image->get_image_link();
|
||||||
$html = "
|
$html = "
|
||||||
<object data='$ilink' type='image/svg+xml' data-width='{$image->width}' data-height='{$image->height}' id='main_image' class='shm-main-image'>
|
<img src='$ilink' id='main_image' class='shm-main-image' data-width='{$image->width}' data-height='{$image->height}' />
|
||||||
<embed src='$ilink' type='image/svg+xml' />
|
|
||||||
</object>
|
|
||||||
";
|
";
|
||||||
$page->add_block(new Block("Image", $html, "main", 10));
|
$page->add_block(new Block("Image", $html, "main", 10));
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user