diff --git a/application/Espo/Core/Portal/Utils/Layout.php b/application/Espo/Core/Portal/Utils/Layout.php index 2de536cf16..a1bc8c745f 100644 --- a/application/Espo/Core/Portal/Utils/Layout.php +++ b/application/Espo/Core/Portal/Utils/Layout.php @@ -29,9 +29,9 @@ namespace Espo\Core\Portal\Utils; -use Espo\Core\Exceptions\Error; use Espo\Core\Utils\Layout as LayoutBase; use Espo\Core\Utils\Resource\FileReader\Params as FileReaderParams; +use RuntimeException; class Layout extends LayoutBase { @@ -41,7 +41,7 @@ class Layout extends LayoutBase $this->sanitizeInput($scope) !== $scope || $this->sanitizeInput($name) !== $name ) { - throw new Error("Bad parameters."); + throw new RuntimeException("Bad parameters."); } $path = 'layouts/' . $scope . '/portal/' . $name . '.json'; diff --git a/application/Espo/Core/Utils/Layout.php b/application/Espo/Core/Utils/Layout.php index eb4074d20e..1caa840de3 100644 --- a/application/Espo/Core/Utils/Layout.php +++ b/application/Espo/Core/Utils/Layout.php @@ -84,7 +84,7 @@ class Layout $defaultImpl = $this->injectableFactory->create($defaultImplClassName); if (!method_exists($defaultImpl, 'get')) { - throw new RuntimeException("No 'get' method in '{$defaultImplClassName}'."); + throw new RuntimeException("No 'get' method in '$defaultImplClassName'."); } $data = $defaultImpl->get($scope); @@ -104,6 +104,6 @@ class Layout protected function sanitizeInput(string $name): string { /** @var string */ - return preg_replace("([\.]{2,})", '', $name); + return preg_replace("([.]{2,})", '', $name); } }