Skip to content

Commit

Permalink
avoid HTTP image screenshot urls. closes #595
Browse files Browse the repository at this point in the history
  • Loading branch information
splitbrain committed Mar 8, 2014
1 parent d27c0c1 commit 0b1e74a
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions lib/plugins/extension/helper/list.php
Expand Up @@ -188,10 +188,17 @@ function make_author(helper_plugin_extension_extension $extension) {
* @return string The HTML code
*/
function make_screenshot(helper_plugin_extension_extension $extension) {
if($extension->getScreenshotURL()) {
$screen = $extension->getScreenshotURL();
$thumb = $extension->getThumbnailURL();

if($screen) {
// use protocol independent URLs for images coming from us #595
$screen = str_replace('http://www.dokuwiki.org', '//www.dokuwiki.org', $screen);
$thumb = str_replace('http://www.dokuwiki.org', '//www.dokuwiki.org', $thumb);

$title = sprintf($this->getLang('screenshot'), hsc($extension->getDisplayName()));
$img = '<a href="'.hsc($extension->getScreenshotURL()).'" target="_blank" class="extension_screenshot">'.
'<img alt="'.$title.'" width="120" height="70" src="'.hsc($extension->getThumbnailURL()).'" />'.
$img = '<a href="'.hsc($screen).'" target="_blank" class="extension_screenshot">'.
'<img alt="'.$title.'" width="120" height="70" src="'.hsc($thumb).'" />'.
'</a>';
} elseif($extension->isTemplate()) {
$img = '<img alt="" width="120" height="70" src="'.DOKU_BASE.'lib/plugins/extension/images/template.png" />';
Expand Down

0 comments on commit 0b1e74a

Please sign in to comment.