diff options
author | ArthurHoaro <arthur@hoa.ro> | 2020-09-22 12:44:08 +0200 |
---|---|---|
committer | ArthurHoaro <arthur@hoa.ro> | 2020-09-22 13:50:19 +0200 |
commit | 76fe68d924d424283d0a1784c5f5e7582dda3a00 (patch) | |
tree | 51d1d7f27a4ad12c67467932aba70049da8c4234 /plugins/archiveorg/archiveorg.php | |
parent | 0d930454a2892715e691f9c7713e26a3bb4ee96c (diff) | |
download | Shaarli-76fe68d924d424283d0a1784c5f5e7582dda3a00.tar.gz Shaarli-76fe68d924d424283d0a1784c5f5e7582dda3a00.tar.zst Shaarli-76fe68d924d424283d0a1784c5f5e7582dda3a00.zip |
Fix plugin base path in core plugins
Also fix note check in archiveorg plugin, and regression on vintage template.
Documentation regarding relative path has been added.
Fixes #1548
Diffstat (limited to 'plugins/archiveorg/archiveorg.php')
-rw-r--r-- | plugins/archiveorg/archiveorg.php | 6 |
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 | ||