From 76fe68d924d424283d0a1784c5f5e7582dda3a00 Mon Sep 17 00:00:00 2001 From: ArthurHoaro Date: Tue, 22 Sep 2020 12:44:08 +0200 Subject: 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 --- plugins/archiveorg/archiveorg.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'plugins/archiveorg') 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) $path = ($data['_BASE_PATH_'] ?? '') . '/' . PluginManager::$PLUGINS_PATH; foreach ($data['links'] as &$value) { - if ($value['private'] && preg_match('/^\?[a-zA-Z0-9-_@]{6}($|&|#)/', $value['real_url'])) { + $isNote = startsWith($value['real_url'], '/shaare/'); + if ($value['private'] && $isNote) { continue; } - $archive = sprintf($archive_html, $value['url'], $path, t('View on archive.org')); + $url = $isNote ? rtrim(index_url($_SERVER), '/') . $value['real_url'] : $value['real_url']; + $archive = sprintf($archive_html, $url, $path, t('View on archive.org')); $value['link_plugin'][] = $archive; } -- cgit v1.2.3