diff --git a/app/controllers/studip_controller.php b/app/controllers/studip_controller.php index 9e7b08eafb6ba60138710dbcb3cd77cdbd5293f6..7fbad9c406bfede9ac3d073e8acb68e7400cf3c3 100644 --- a/app/controllers/studip_controller.php +++ b/app/controllers/studip_controller.php @@ -740,10 +740,7 @@ abstract class StudipController extends Trails_Controller */ public function action_link($action) { - $arguments = func_get_args(); - array_unshift($arguments, $this->controller_path()); - - return $this->link_for(...$arguments); + return htmlReady($this->action_url(...func_get_args())); } /** diff --git a/tests/unit/lib/classes/StudipControllerTest.php b/tests/unit/lib/classes/StudipControllerTest.php index a7009fe2aa504c4a8f23e662203e3ccd71f11d81..532116677ae115810f20a2a15750318d1a9eaafe 100644 --- a/tests/unit/lib/classes/StudipControllerTest.php +++ b/tests/unit/lib/classes/StudipControllerTest.php @@ -76,6 +76,12 @@ final class StudipControllerTest extends Codeception\Test\Unit $expected, $this->getRelativeURL($url) ); + + $link = $this->getController()->action_link(...$args); + $this->assertEquals( + htmlspecialchars($expected), + $this->getRelativeURL($link) + ); } /**