diff options
author | ArthurHoaro <arthur@hoa.ro> | 2020-09-25 10:59:40 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-25 10:59:40 +0200 |
commit | 85b972baf67c61ebabf1ce332358e4dfd2456a4e (patch) | |
tree | 6f890cf93ac6cd30da509fa9c39ec7d061f25709 /plugins | |
parent | 71eb87353ca09a1476c3f94e51ccfbfb45a91170 (diff) | |
parent | 76fe68d924d424283d0a1784c5f5e7582dda3a00 (diff) | |
download | Shaarli-85b972baf67c61ebabf1ce332358e4dfd2456a4e.tar.gz Shaarli-85b972baf67c61ebabf1ce332358e4dfd2456a4e.tar.zst Shaarli-85b972baf67c61ebabf1ce332358e4dfd2456a4e.zip |
Merge pull request #1558 from ArthurHoaro/fix/plugins-base-path
Fix plugin base path in core plugins
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/archiveorg/archiveorg.php | 6 | ||||
-rw-r--r-- | plugins/isso/isso.php | 2 | ||||
-rw-r--r-- | plugins/qrcode/qrcode.php | 4 |
3 files changed, 7 insertions, 5 deletions
diff --git a/plugins/archiveorg/archiveorg.php b/plugins/archiveorg/archiveorg.php index f26e6129..922b5966 100644 --- a/plugins/archiveorg/archiveorg.php +++ b/plugins/archiveorg/archiveorg.php | |||
@@ -20,10 +20,12 @@ function hook_archiveorg_render_linklist($data) | |||
20 | $path = ($data['_BASE_PATH_'] ?? '') . '/' . PluginManager::$PLUGINS_PATH; | 20 | $path = ($data['_BASE_PATH_'] ?? '') . '/' . PluginManager::$PLUGINS_PATH; |
21 | 21 | ||
22 | foreach ($data['links'] as &$value) { | 22 | foreach ($data['links'] as &$value) { |
23 | if ($value['private'] && preg_match('/^\?[a-zA-Z0-9-_@]{6}($|&|#)/', $value['real_url'])) { | 23 | $isNote = startsWith($value['real_url'], '/shaare/'); |
24 | if ($value['private'] && $isNote) { | ||
24 | continue; | 25 | continue; |
25 | } | 26 | } |
26 | $archive = sprintf($archive_html, $value['url'], $path, t('View on archive.org')); | 27 | $url = $isNote ? rtrim(index_url($_SERVER), '/') . $value['real_url'] : $value['real_url']; |
28 | $archive = sprintf($archive_html, $url, $path, t('View on archive.org')); | ||
27 | $value['link_plugin'][] = $archive; | 29 | $value['link_plugin'][] = $archive; |
28 | } | 30 | } |
29 | 31 | ||
diff --git a/plugins/isso/isso.php b/plugins/isso/isso.php index 16edd9a6..79e7380b 100644 --- a/plugins/isso/isso.php +++ b/plugins/isso/isso.php | |||
@@ -49,7 +49,7 @@ function hook_isso_render_linklist($data, $conf) | |||
49 | $isso = sprintf($issoHtml, $issoUrl, $issoUrl, $link['id'], $link['id']); | 49 | $isso = sprintf($issoHtml, $issoUrl, $issoUrl, $link['id'], $link['id']); |
50 | $data['plugin_end_zone'][] = $isso; | 50 | $data['plugin_end_zone'][] = $isso; |
51 | } else { | 51 | } else { |
52 | $button = '<span><a href="?%s#isso-thread">'; | 52 | $button = '<span><a href="'. ($data['_BASE_PATH_'] ?? '') . '/shaare/%s#isso-thread">'; |
53 | // For the default theme we use a FontAwesome icon which is better than an image | 53 | // For the default theme we use a FontAwesome icon which is better than an image |
54 | if ($conf->get('resource.theme') === 'default') { | 54 | if ($conf->get('resource.theme') === 'default') { |
55 | $button .= '<i class="linklist-plugin-icon fa fa-comment"></i>'; | 55 | $button .= '<i class="linklist-plugin-icon fa fa-comment"></i>'; |
diff --git a/plugins/qrcode/qrcode.php b/plugins/qrcode/qrcode.php index 56ae47b3..95499e39 100644 --- a/plugins/qrcode/qrcode.php +++ b/plugins/qrcode/qrcode.php | |||
@@ -42,7 +42,7 @@ function hook_qrcode_render_linklist($data) | |||
42 | function hook_qrcode_render_footer($data) | 42 | function hook_qrcode_render_footer($data) |
43 | { | 43 | { |
44 | if ($data['_PAGE_'] == TemplatePage::LINKLIST) { | 44 | if ($data['_PAGE_'] == TemplatePage::LINKLIST) { |
45 | $data['js_files'][] = ($data['_BASE_PATH_'] ?? '') . '/' . PluginManager::$PLUGINS_PATH . '/qrcode/shaarli-qrcode.js'; | 45 | $data['js_files'][] = PluginManager::$PLUGINS_PATH . '/qrcode/shaarli-qrcode.js'; |
46 | } | 46 | } |
47 | 47 | ||
48 | return $data; | 48 | return $data; |
@@ -58,7 +58,7 @@ function hook_qrcode_render_footer($data) | |||
58 | function hook_qrcode_render_includes($data) | 58 | function hook_qrcode_render_includes($data) |
59 | { | 59 | { |
60 | if ($data['_PAGE_'] == TemplatePage::LINKLIST) { | 60 | if ($data['_PAGE_'] == TemplatePage::LINKLIST) { |
61 | $data['css_files'][] = ($data['_BASE_PATH_'] ?? '') . '/' . PluginManager::$PLUGINS_PATH . '/qrcode/qrcode.css'; | 61 | $data['css_files'][] = PluginManager::$PLUGINS_PATH . '/qrcode/qrcode.css'; |
62 | } | 62 | } |
63 | 63 | ||
64 | return $data; | 64 | return $data; |