diff options
author | Andreas Gohr <andi@splitbrain.org> | 2014-03-08 19:14:16 +0100 |
---|---|---|
committer | Andreas Gohr <andi@splitbrain.org> | 2014-03-08 19:14:16 +0100 |
commit | 0b1e74a3a483dfda1906c0f636b27e4a15bd7a0f (patch) | |
tree | 220233d6e25723b37d51bbc0e6c0938aa4cf9651 /lib/plugins | |
parent | d27c0c1701c342ed9d6553163a71ac5cd7314a9f (diff) | |
download | rpg-0b1e74a3a483dfda1906c0f636b27e4a15bd7a0f.tar.gz rpg-0b1e74a3a483dfda1906c0f636b27e4a15bd7a0f.tar.bz2 |
avoid HTTP image screenshot urls. closes #595
Diffstat (limited to 'lib/plugins')
-rw-r--r-- | lib/plugins/extension/helper/list.php | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/lib/plugins/extension/helper/list.php b/lib/plugins/extension/helper/list.php index 01a5c516a..47edca8c1 100644 --- a/lib/plugins/extension/helper/list.php +++ b/lib/plugins/extension/helper/list.php @@ -188,10 +188,17 @@ class helper_plugin_extension_list extends DokuWiki_Plugin { * @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" />'; |