Commit 7251aae7 authored by Thomas Löffler's avatar Thomas Löffler
Browse files

Better handling for wrong or no extension key given

parent b8aae07c
Pipeline #2298 passed with stages
in 1 minute and 39 seconds
...@@ -180,18 +180,13 @@ class ExtensionController extends \T3o\TerFe2\Controller\AbstractController ...@@ -180,18 +180,13 @@ class ExtensionController extends \T3o\TerFe2\Controller\AbstractController
* Action that displays a single extension * Action that displays a single extension
* *
* @param \T3o\TerFe2\Domain\Model\Extension $extension The extension to display * @param \T3o\TerFe2\Domain\Model\Extension $extension The extension to display
* @param string $extensionKey Extension key
* @return void
*
* @ignorevalidation $extension * @ignorevalidation $extension
* @return void
*/ */
public function showAction(\T3o\TerFe2\Domain\Model\Extension $extension = null, $extensionKey = null) public function showAction(\T3o\TerFe2\Domain\Model\Extension $extension = null)
{ {
if (!empty($extensionKey)) { if ($extension === null || !$extension instanceof \T3o\TerFe2\Domain\Model\Extension) {
if (!is_string($extensionKey)) { $GLOBALS['TSFE']->pageNotFoundAndExit('Extension not found!');
throw new \Exception('No valid extension key given');
}
$extension = $this->extensionRepository->findOneByExtKey($extensionKey);
} }
$owner = array(); $owner = array();
if ($extension instanceof \T3o\TerFe2\Domain\Model\Extension and $extension->getFrontendUser()) { if ($extension instanceof \T3o\TerFe2\Domain\Model\Extension and $extension->getFrontendUser()) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment