From 73fb00658bef1a8ee7793d599e672df7bbb043ee Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Wed, 4 Nov 2020 11:18:15 +0100 Subject: [locationinfo] Fix: api.php access in redirect mode not working Also get rid of slx-admin prefix / {{dirprefix}}. We now have only one variable to be filled in the template, namely {{api}}, which should also make sure that accessing other module's API is not possible. Matching rewrite rules should land in setup-scripts soon. --- modules-available/locationinfo/page.inc.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'modules-available/locationinfo/page.inc.php') diff --git a/modules-available/locationinfo/page.inc.php b/modules-available/locationinfo/page.inc.php index df5b3632..e350d407 100644 --- a/modules-available/locationinfo/page.inc.php +++ b/modules-available/locationinfo/page.inc.php @@ -1047,7 +1047,11 @@ class Page_LocationInfo extends Page preg_match('#^/(.*)/#', $_SERVER['PHP_SELF'], $script); preg_match('#^/([^?]+)/#', $_SERVER['REQUEST_URI'], $request); if ($script[1] !== $request[1]) { - $data['dirprefix'] = $script[1] . '/'; + // Working with server-side redirects + $data['api'] = 'api/'; + } else { + // 1:1 + $data['api'] = 'api.php?do=locationinfo&'; } if ($type === 'DEFAULT') { -- cgit v1.2.3-55-g7522