File tree Expand file tree Collapse file tree 2 files changed +19
-11
lines changed
Expand file tree Collapse file tree 2 files changed +19
-11
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ This project follows [Semantic Versioning](http://semver.org) guidelines.
77### Fixed
88* Fixes an exception when no token is entered on the 2-Factor enable/disable page and the form is submitted.
99* Fixes an exception when trying to perform actions aganist a User model due to a validator that could not be cast to a string correctly.
10+ * Allow FQDNs in database host creation UI correctly.
1011
1112## v0.7.0 (Derelict Dermodactylus)
1213### Fixed
Original file line number Diff line number Diff line change 11<?php
2- /**
3- * Pterodactyl - Panel
4- * Copyright (c) 2015 - 2017 Dane Everitt <dane@daneeveritt.com>.
5- *
6- * This software is licensed under the terms of the MIT license.
7- * https://opensource.org/licenses/MIT
8- */
92
103namespace Pterodactyl \Http \Requests \Admin ;
114
@@ -18,14 +11,28 @@ class DatabaseHostFormRequest extends AdminFormRequest
1811 */
1912 public function rules ()
2013 {
21- if (! $ this ->filled ('node_id ' )) {
22- $ this ->merge (['node_id ' => null ]);
23- }
24-
2514 if ($ this ->method () !== 'POST ' ) {
2615 return DatabaseHost::getUpdateRulesForId ($ this ->route ()->parameter ('host ' ));
2716 }
2817
2918 return DatabaseHost::getCreateRules ();
3019 }
20+
21+ /**
22+ * Modify submitted data before it is passed off to the validator.
23+ *
24+ * @return \Illuminate\Contracts\Validation\Validator
25+ */
26+ protected function getValidatorInstance ()
27+ {
28+ if (! $ this ->filled ('node_id ' )) {
29+ $ this ->merge (['node_id ' => null ]);
30+ }
31+
32+ $ this ->merge ([
33+ 'host ' => gethostbyname ($ this ->input ('host ' )),
34+ ]);
35+
36+ return parent ::getValidatorInstance ();
37+ }
3138}
You can’t perform that action at this time.
0 commit comments