From 3adbdc2a83e6b77a4ca62094c5d857524e39d211 Mon Sep 17 00:00:00 2001 From: ArthurHoaro Date: Fri, 16 Oct 2020 13:06:06 +0200 Subject: Inject ROOT_PATH in plugin instead of regenerating it everywhere --- plugins/archiveorg/archiveorg.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'plugins/archiveorg') diff --git a/plugins/archiveorg/archiveorg.php b/plugins/archiveorg/archiveorg.php index a7b595e1..ed271532 100644 --- a/plugins/archiveorg/archiveorg.php +++ b/plugins/archiveorg/archiveorg.php @@ -17,8 +17,7 @@ use Shaarli\Plugin\PluginManager; function hook_archiveorg_render_linklist($data) { $archive_html = file_get_contents(PluginManager::$PLUGINS_PATH . '/archiveorg/archiveorg.html'); - $rootPath = preg_replace('#/index\.php$#', '', $data['_BASE_PATH_'] ?? ''); - $path = $rootPath . '/' . PluginManager::$PLUGINS_PATH; + $path = ($data['_ROOT_PATH_'] ?? '') . '/' . PluginManager::$PLUGINS_PATH; foreach ($data['links'] as &$value) { $isNote = startsWith($value['real_url'], '/shaare/'); -- cgit v1.2.3