I want to view a image in the Description-part in albums. But when I write:
{img}http://gallery.menalto.com/gallery2/main.php?g2_view=core.DownloadItem&g2_itemId=8234&g2_serialNumber=2{/img} (switched [] with {} for display purpose)
it get converted to:
<img src="http://gallery.menalto.com/gallery2/main.php?g2_view=core.DownloadItem&amp;g2_itemId=8234&amp;g2_serialNumber=2" alt="">
And the image is not working. Any ideas on how I can fix this?
Knut Magne
Norway
Posts: 2
Made a quick and dirty hack in my theme.inc. Added
$item->setDescription(str_replace('amp;','', $item->getDescription()));
as the first line of the showAlbumPage() method.
But I guess it's a better way to fix it.
Btw: I'm running G2 v2.0.2
Posts: 8601
there's an htmlspecialchars call in our bbcode code that looks suspicious.. try removing your dirty hack and making this change in lib/smarty_plugins/modifier.markup.php function image() change:
return sprintf('<img src="%s" alt=""/>', htmlspecialchars($elementContents));to:
return sprintf('<img src="%s" alt=""/>', $elementContents);Let us know if that works.. we already escape things we store in the db, so I think this htmlspecialchars call may be redundant/extra escaping.
Posts: 1
Thanks! Works like a charm now..
Posts: 8601
i have added a unit test and committed this change to cvs; thanks for the report