From 7f5250421be4832b9679d8140bc4a71c8005dfa3 Mon Sep 17 00:00:00 2001 From: ArthurHoaro Date: Fri, 16 Oct 2020 12:47:11 +0200 Subject: Support using Shaarli without URL rewriting MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Shaarli can be fully used by prefixing any URL with /index.php/ - {$base_path} used in templates already works with this configuration - Assets path (outside of theme's assets) must be prefixed with {$root_url}/ - Documentation section in « Server configuration » Fixes #1590 --- plugins/qrcode/qrcode.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'plugins/qrcode') diff --git a/plugins/qrcode/qrcode.php b/plugins/qrcode/qrcode.php index 95499e39..45712859 100644 --- a/plugins/qrcode/qrcode.php +++ b/plugins/qrcode/qrcode.php @@ -19,7 +19,8 @@ function hook_qrcode_render_linklist($data) { $qrcode_html = file_get_contents(PluginManager::$PLUGINS_PATH . '/qrcode/qrcode.html'); - $path = ($data['_BASE_PATH_'] ?? '') . '/' . PluginManager::$PLUGINS_PATH; + $rootPath = preg_replace('#/index\.php$#', '', $data['_BASE_PATH_'] ?? ''); + $path = $rootPath . '/' . PluginManager::$PLUGINS_PATH; foreach ($data['links'] as &$value) { $qrcode = sprintf( $qrcode_html, -- cgit v1.2.3 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') 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