Inject ROOT_PATH in plugin instead of regenerating it everywhere

This commit is contained in:
ArthurHoaro 2020-10-16 13:06:06 +02:00
parent 7f5250421b
commit 3adbdc2a83
7 changed files with 14 additions and 9 deletions
plugins/archiveorg

View file

@ -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/');