aboutsummaryrefslogtreecommitdiffhomepage
path: root/plugins
diff options
context:
space:
mode:
authorArthurHoaro <arthur@hoa.ro>2020-10-16 12:47:11 +0200
committerArthurHoaro <arthur@hoa.ro>2020-10-16 12:47:11 +0200
commit7f5250421be4832b9679d8140bc4a71c8005dfa3 (patch)
treea47e846cef666dbd1c2c7d05a01fd32aa8311d4f /plugins
parentec457491879893c8cfcc9dd6542d1593aa5c91f5 (diff)
downloadShaarli-7f5250421be4832b9679d8140bc4a71c8005dfa3.tar.gz
Shaarli-7f5250421be4832b9679d8140bc4a71c8005dfa3.tar.zst
Shaarli-7f5250421be4832b9679d8140bc4a71c8005dfa3.zip
Support using Shaarli without URL rewriting
- 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
Diffstat (limited to 'plugins')
-rw-r--r--plugins/archiveorg/archiveorg.php3
-rw-r--r--plugins/qrcode/qrcode.php3
2 files changed, 4 insertions, 2 deletions
diff --git a/plugins/archiveorg/archiveorg.php b/plugins/archiveorg/archiveorg.php
index 922b5966..a7b595e1 100644
--- a/plugins/archiveorg/archiveorg.php
+++ b/plugins/archiveorg/archiveorg.php
@@ -17,7 +17,8 @@ use Shaarli\Plugin\PluginManager;
17function hook_archiveorg_render_linklist($data) 17function hook_archiveorg_render_linklist($data)
18{ 18{
19 $archive_html = file_get_contents(PluginManager::$PLUGINS_PATH . '/archiveorg/archiveorg.html'); 19 $archive_html = file_get_contents(PluginManager::$PLUGINS_PATH . '/archiveorg/archiveorg.html');
20 $path = ($data['_BASE_PATH_'] ?? '') . '/' . PluginManager::$PLUGINS_PATH; 20 $rootPath = preg_replace('#/index\.php$#', '', $data['_BASE_PATH_'] ?? '');
21 $path = $rootPath . '/' . PluginManager::$PLUGINS_PATH;
21 22
22 foreach ($data['links'] as &$value) { 23 foreach ($data['links'] as &$value) {
23 $isNote = startsWith($value['real_url'], '/shaare/'); 24 $isNote = startsWith($value['real_url'], '/shaare/');
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)
19{ 19{
20 $qrcode_html = file_get_contents(PluginManager::$PLUGINS_PATH . '/qrcode/qrcode.html'); 20 $qrcode_html = file_get_contents(PluginManager::$PLUGINS_PATH . '/qrcode/qrcode.html');
21 21
22 $path = ($data['_BASE_PATH_'] ?? '') . '/' . PluginManager::$PLUGINS_PATH; 22 $rootPath = preg_replace('#/index\.php$#', '', $data['_BASE_PATH_'] ?? '');
23 $path = $rootPath . '/' . PluginManager::$PLUGINS_PATH;
23 foreach ($data['links'] as &$value) { 24 foreach ($data['links'] as &$value) {
24 $qrcode = sprintf( 25 $qrcode = sprintf(
25 $qrcode_html, 26 $qrcode_html,