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/qrcode/qrcode.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'plugins/qrcode/qrcode.php') diff --git a/plugins/qrcode/qrcode.php b/plugins/qrcode/qrcode.php index 45712859..24fd18ba 100644 --- a/plugins/qrcode/qrcode.php +++ b/plugins/qrcode/qrcode.php @@ -19,8 +19,7 @@ function hook_qrcode_render_linklist($data) { $qrcode_html = file_get_contents(PluginManager::$PLUGINS_PATH . '/qrcode/qrcode.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) { $qrcode = sprintf( $qrcode_html, -- cgit v1.2.3