From d32c84c72d72aff3db74ff5f1f71db407e762b95 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Joshua=20R=C3=BCsweg?= Date: Thu, 1 Feb 2018 12:38:35 +0100 Subject: [PATCH] Add forceFrontend parameter to force controller transformations for the frontend --- .../files/lib/system/request/ControllerMap.class.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/wcfsetup/install/files/lib/system/request/ControllerMap.class.php b/wcfsetup/install/files/lib/system/request/ControllerMap.class.php index 60da31ff56..066c24d02e 100644 --- a/wcfsetup/install/files/lib/system/request/ControllerMap.class.php +++ b/wcfsetup/install/files/lib/system/request/ControllerMap.class.php @@ -156,16 +156,21 @@ class ControllerMap extends SingletonFactory { * * @param string $application application identifier * @param string $controller controller class, e.g. 'MembersList' + * @param boolean $forceFrontend force transformation for frontend * @return string url representation of controller, e.g. 'members-list' */ - public function lookup($application, $controller) { + public function lookup($application, $controller, $forceFrontend = null) { $lookupKey = $application . '-' . $controller; if (isset($this->lookupCache[$lookupKey])) { return $this->lookupCache[$lookupKey]; } - if (!class_exists(WCFACP::class, false) && isset($this->customUrls['reverse'][$application]) && isset($this->customUrls['reverse'][$application][$controller])) { + if ($forceFrontend === null) { + $forceFrontend = !class_exists(WCFACP::class, false); + } + + if ($forceFrontend && isset($this->customUrls['reverse'][$application]) && isset($this->customUrls['reverse'][$application][$controller])) { $urlController = $this->customUrls['reverse'][$application][$controller]; } else { -- 2.20.1