File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed
Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change 44
55use App \UI \BasePresenter ;
66use Nette \Application \UI \Form ;
7- use Nette \Utils \ArrayHash ;
87use Nette \Utils \DateTime ;
98use Nette \Utils \Html ;
109use Nette \Utils \Strings ;
@@ -53,11 +52,11 @@ protected function createComponentUserForm(): Form
5352
5453 $ form ->onValidate [] = function (Form $ form ): void {
5554 $ values = $ form ->getUntrustedValues ();
56- assert ($ values instanceof ArrayHash );
55+ $ email = is_object ($ values) ? ( $ values -> email ?? null ) : ( $ values [ ' email ' ] ?? null );
5756
5857 // Validate e-mail duplicities (against DB?)
59- if (str_ends_with ($ values -> email , '@nette.org ' )) {
60- $ form ->addError (sprintf ('E-mail "%s" is already picked ' , $ values -> email ));
58+ if (is_string ( $ email ) && str_ends_with ($ email , '@nette.org ' )) {
59+ $ form ->addError (sprintf ('E-mail "%s" is already picked ' , $ email ));
6160 }
6261 };
6362
You can’t perform that action at this time.
0 commit comments