aboutsummaryrefslogtreecommitdiffhomepage
path: root/plugins/archiveorg/archiveorg.php
diff options
context:
space:
mode:
authorArthurHoaro <arthur@hoa.ro>2020-09-25 10:59:40 +0200
committerGitHub <noreply@github.com>2020-09-25 10:59:40 +0200
commit85b972baf67c61ebabf1ce332358e4dfd2456a4e (patch)
tree6f890cf93ac6cd30da509fa9c39ec7d061f25709 /plugins/archiveorg/archiveorg.php
parent71eb87353ca09a1476c3f94e51ccfbfb45a91170 (diff)
parent76fe68d924d424283d0a1784c5f5e7582dda3a00 (diff)
downloadShaarli-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/archiveorg/archiveorg.php')
-rw-r--r--plugins/archiveorg/archiveorg.php6
1 files changed, 4 insertions, 2 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