From dfe5861f3327eb3611f68099bffe6f6eb2adb624 Mon Sep 17 00:00:00 2001 From: trendschau Date: Tue, 12 Mar 2024 20:09:50 +0100 Subject: [PATCH] v2.3.0 block content with the slug tm ticket 448 --- .../typemill/Controllers/ControllerApiAuthorArticle.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/system/typemill/Controllers/ControllerApiAuthorArticle.php b/system/typemill/Controllers/ControllerApiAuthorArticle.php index b7759af..9412c1d 100644 --- a/system/typemill/Controllers/ControllerApiAuthorArticle.php +++ b/system/typemill/Controllers/ControllerApiAuthorArticle.php @@ -444,6 +444,15 @@ class ControllerApiAuthorArticle extends Controller $draftNavigation = $navigation->getDraftNavigation($urlinfo, $langattr); if($params['folder_id'] == 'root') { + if($params['item_name'] == 'tm') + { + $response->getBody()->write(json_encode([ + 'message' => Translations::translate('You cannot create an item with the slug /tm in the root folder because this is the system path.') + ])); + + return $response->withHeader('Content-Type', 'application/json')->withStatus(402); + } + $folderContent = $draftNavigation; } else