From f5b5adb6f7a6f00c87854ca919c35df4dae26349 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jens=20Wittmann=20=E2=80=93=20Gestaltung=20=26=20Entwicklu?= =?UTF-8?q?ng?= Date: Thu, 19 Jan 2023 21:15:39 +0100 Subject: [PATCH] use strlen() from $pathRoot for custom api path longer then 4 characters --- core/components/quickapi/elements/plugins/QuickApiRoute.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/components/quickapi/elements/plugins/QuickApiRoute.php b/core/components/quickapi/elements/plugins/QuickApiRoute.php index 9c2a59d..a173c15 100644 --- a/core/components/quickapi/elements/plugins/QuickApiRoute.php +++ b/core/components/quickapi/elements/plugins/QuickApiRoute.php @@ -18,9 +18,9 @@ $pathRoot = $modx->getOption('quickapi.path_root', null, 'api/'); // If the identifier starts with the path root - if (substr($identifier, 0, 4) === $pathRoot) { + if (substr($identifier, 0, strlen($pathRoot)) === $pathRoot) { // Override the request alias $_REQUEST[$rAlias] = "quickapi-process"; $_REQUEST['_quickapi'] = str_replace('api/', '', $identifier); } -} \ No newline at end of file +}