From 59ac7beaa56f2b43310b88bceca6c68a685f19e6 Mon Sep 17 00:00:00 2001 From: Michael Hamann Date: Sat, 8 Mar 2014 11:27:28 +0100 Subject: Extension manager: Fix cache extension to be .repo The dot was missing i.e. the cache files had no real extension at all. --- lib/plugins/extension/helper/repository.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'lib/plugins/extension/helper') diff --git a/lib/plugins/extension/helper/repository.php b/lib/plugins/extension/helper/repository.php index 1f603a866..6ffe89eb7 100644 --- a/lib/plugins/extension/helper/repository.php +++ b/lib/plugins/extension/helper/repository.php @@ -31,7 +31,7 @@ class helper_plugin_extension_repository extends DokuWiki_Plugin { $request_data = array('fmt' => 'php'); $request_needed = false; foreach ($list as $name) { - $cache = new cache('##extension_manager##'.$name, 'repo'); + $cache = new cache('##extension_manager##'.$name, '.repo'); $result = null; if (!isset($this->loaded_extensions[$name]) && $this->hasAccess() && !$cache->useCache(array('age' => 3600 * 24))) { $this->loaded_extensions[$name] = true; @@ -46,7 +46,7 @@ class helper_plugin_extension_repository extends DokuWiki_Plugin { if ($data !== false) { $extensions = unserialize($data); foreach ($extensions as $extension) { - $cache = new cache('##extension_manager##'.$extension['plugin'], 'repo'); + $cache = new cache('##extension_manager##'.$extension['plugin'], '.repo'); $cache->storeCache(serialize($extension)); } } else { @@ -63,7 +63,7 @@ class helper_plugin_extension_repository extends DokuWiki_Plugin { */ public function hasAccess() { if ($this->has_access === null) { - $cache = new cache('##extension_manager###hasAccess', 'repo'); + $cache = new cache('##extension_manager###hasAccess', '.repo'); $result = null; if (!$cache->useCache(array('age' => 3600 * 24, 'purge'=>1))) { $httpclient = new DokuHTTPClient(); @@ -90,7 +90,7 @@ class helper_plugin_extension_repository extends DokuWiki_Plugin { * @return array The data or null if nothing was found (possibly no repository access) */ public function getData($name) { - $cache = new cache('##extension_manager##'.$name, 'repo'); + $cache = new cache('##extension_manager##'.$name, '.repo'); $result = null; if (!isset($this->loaded_extensions[$name]) && $this->hasAccess() && !$cache->useCache(array('age' => 3600 * 24))) { $this->loaded_extensions[$name] = true; @@ -130,7 +130,7 @@ class helper_plugin_extension_repository extends DokuWiki_Plugin { // store cache info for each extension foreach($result as $ext){ $name = $ext['plugin']; - $cache = new cache('##extension_manager##'.$name, 'repo'); + $cache = new cache('##extension_manager##'.$name, '.repo'); $cache->storeCache(serialize($ext)); $ids[] = $name; } -- cgit v1.2.3 From 0b1e74a3a483dfda1906c0f636b27e4a15bd7a0f Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Sat, 8 Mar 2014 19:14:16 +0100 Subject: avoid HTTP image screenshot urls. closes #595 --- lib/plugins/extension/helper/list.php | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'lib/plugins/extension/helper') 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 = ''. - ''.$title.''. + $img = ''. + ''.$title.''. ''; } elseif($extension->isTemplate()) { $img = ''; -- cgit v1.2.3