From 654a4c4abc3678fdfa4b7c627b33c76f99409bbc Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Sun, 24 Feb 2019 14:25:51 +0100 Subject: [PATCH] Use LinkHandler::getControllerLink() in AbstractFormBuilderForm See #2509 --- .../files/lib/form/AbstractFormBuilderForm.class.php | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/wcfsetup/install/files/lib/form/AbstractFormBuilderForm.class.php b/wcfsetup/install/files/lib/form/AbstractFormBuilderForm.class.php index f088c81418..bc51930f04 100644 --- a/wcfsetup/install/files/lib/form/AbstractFormBuilderForm.class.php +++ b/wcfsetup/install/files/lib/form/AbstractFormBuilderForm.class.php @@ -181,11 +181,7 @@ abstract class AbstractFormBuilderForm extends AbstractForm { * Sets the action of the form. */ protected function setFormAction() { - $classNamePieces = explode('\\', get_class($this)); - $application = $classNamePieces[0]; - $controller = preg_replace('~Form$~', '', end($classNamePieces)); - - $parameters = ['application' => $application]; + $parameters = []; if ($this->formObject !== null) { if ($this->formObject instanceof IRouteController) { $parameters['object'] = $this->formObject; @@ -197,7 +193,7 @@ abstract class AbstractFormBuilderForm extends AbstractForm { } } - $this->form->action(LinkHandler::getInstance()->getLink($controller, $parameters)); + $this->form->action(LinkHandler::getInstance()->getControllerLink(static::class, $parameters)); } /** -- 2.20.1