From a63137f5dc945d3ca9130529ea020748e068a76e Mon Sep 17 00:00:00 2001 From: Marcel Werk Date: Wed, 20 Nov 2024 15:20:32 +0100 Subject: [PATCH] Remove obsolete parameters from `getControllerLink()` The parameters are obsolete as they always result from the given controller class. --- .../files/lib/form/AbstractFormBuilderForm.class.php | 2 +- .../files/lib/system/request/LinkHandler.class.php | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/wcfsetup/install/files/lib/form/AbstractFormBuilderForm.class.php b/wcfsetup/install/files/lib/form/AbstractFormBuilderForm.class.php index 5a708838cc..0448bd2529 100644 --- a/wcfsetup/install/files/lib/form/AbstractFormBuilderForm.class.php +++ b/wcfsetup/install/files/lib/form/AbstractFormBuilderForm.class.php @@ -71,6 +71,7 @@ abstract class AbstractFormBuilderForm extends AbstractForm * name of the application for the link to the edit form * @var string * @since 5.3 + * @deprecated 6.2 No longer in use. */ public $objectEditLinkApplication = 'wcf'; @@ -194,7 +195,6 @@ abstract class AbstractFormBuilderForm extends AbstractForm WCF::getTPL()->assign( 'objectEditLink', LinkHandler::getInstance()->getControllerLink($this->objectEditLinkController, [ - 'application' => $this->objectEditLinkApplication, 'id' => $this->objectAction->getReturnValues()['returnValues']->getObjectID(), ]) ); diff --git a/wcfsetup/install/files/lib/system/request/LinkHandler.class.php b/wcfsetup/install/files/lib/system/request/LinkHandler.class.php index bf111a0c44..c2fd3bfd4f 100644 --- a/wcfsetup/install/files/lib/system/request/LinkHandler.class.php +++ b/wcfsetup/install/files/lib/system/request/LinkHandler.class.php @@ -83,10 +83,10 @@ final class LinkHandler extends SingletonFactory $matches = $this->controllerRegex->getMatches(); - // important: matches cannot overwrite explicitly set parameters - $parameters['application'] = $parameters['application'] ?? $matches['application']; - $parameters['isACP'] = $parameters['isACP'] ?? $matches['isAcp']; - $parameters['forceFrontend'] = $parameters['forceFrontend'] ?? !$matches['isAcp']; + // Overwrite legacy parameters, as these always result from the given controller class. + $parameters['application'] = $matches['application']; + $parameters['isACP'] = $matches['isAcp']; + $parameters['forceFrontend'] = !$matches['isAcp']; return $this->getLink($matches['controller'], $parameters, $url); } -- 2.20.1