From 5a0508827eab1c7ecbb2f726a15fe4d55eb694a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Harold=20Ju=C3=A1rez?= Date: Fri, 10 May 2019 15:59:20 -0600 Subject: [PATCH] [generate:module] Fixed dependencies validation (#4030) --- src/Utils/Validator.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Utils/Validator.php b/src/Utils/Validator.php index 7eba0a7bb..50f86cf8e 100644 --- a/src/Utils/Validator.php +++ b/src/Utils/Validator.php @@ -16,6 +16,7 @@ class Validator const REGEX_COMMAND_CLASS_NAME = '/^[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]+Command$/'; const REGEX_CONTROLLER_CLASS_NAME = '/^[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]+Controller$/'; const REGEX_MACHINE_NAME = '/^[a-z0-9_]+$/'; + const REGEX_DEPENDENCY_NAME = '/^[a-z0-9_:]+$/'; // This REGEX remove spaces between words const REGEX_REMOVE_SPACES = '/[\\s+]/'; // Max length to 32 @@ -177,7 +178,7 @@ public function validateMachineNameList($list) $list = explode(',', $this->removeSpaces($list)); foreach ($list as $key => $module) { if (!empty($module)) { - if (preg_match(self::REGEX_MACHINE_NAME, $module)) { + if (preg_match(self::REGEX_DEPENDENCY_NAME, $module)) { $list_checked['success'][] = $module; } else { $list_checked['fail'][] = $module;