1212use DateTimeZone ;
1313use Illuminate \Console \Command ;
1414use Illuminate \Contracts \Console \Kernel ;
15+ use Illuminate \Validation \Factory as ValidatorFactory ;
1516use Pterodactyl \Traits \Commands \EnvironmentWriterTrait ;
1617use Illuminate \Contracts \Config \Repository as ConfigRepository ;
1718
@@ -78,12 +79,13 @@ class AppSettingsCommand extends Command
7879 /**
7980 * AppSettingsCommand constructor.
8081 */
81- public function __construct (ConfigRepository $ config , Kernel $ command )
82+ public function __construct (ConfigRepository $ config , Kernel $ command, ValidatorFactory $ validator )
8283 {
8384 parent ::__construct ();
8485
85- $ this ->command = $ command ;
8686 $ this ->config = $ config ;
87+ $ this ->command = $ command ;
88+ $ this ->validator = $ validator ;
8789 }
8890
8991 /**
@@ -103,6 +105,18 @@ public function handle()
103105 $ this ->config ->get ('pterodactyl.service.author ' , 'unknown@unknown.com ' )
104106 );
105107
108+ $ validator = $ this ->validator ->make (
109+ ['email ' => $ this ->variables ['APP_SERVICE_AUTHOR ' ]],
110+ ['email ' => 'email ' ]
111+ );
112+
113+ if ($ validator ->fails ()) {
114+ foreach ($ validator ->errors ()->all () as $ error ) {
115+ $ this ->output ->error ($ error );
116+ }
117+ return 1 ;
118+ }
119+
106120 $ this ->output ->comment (trans ('command/messages.environment.app.app_url_help ' ));
107121 $ this ->variables ['APP_URL ' ] = $ this ->option ('url ' ) ?? $ this ->ask (
108122 trans ('command/messages.environment.app.app_url ' ),
0 commit comments