Skip to content

EspoCRM – Open Source CRM Application

Export extension extra validation

Yurii66ab04e9a971
diff --git a/application/Espo/Tools/ExportCustom/Data.php b/application/Espo/Tools/ExportCustom/Data.php
index cab2d18242..23575e68ab 100644
--- a/application/Espo/Tools/ExportCustom/Data.php
+++ b/application/Espo/Tools/ExportCustom/Data.php
@@ -29,6 +29,8 @@
namespace Espo\Tools\ExportCustom;
+use RuntimeException;
+
class Data
{
/**
@@ -38,7 +40,12 @@ class Data
public string $folder,
public array $customEntityTypeList,
private string $module
- ) {}
+ ) {
+
+ if (!preg_match('/^[A-Za-z0-9.\-]+$/', $folder)) {
+ throw new RuntimeException("Bad folder.");
+ }
+ }
public function getDir(): string
{