Check Name & Mail

Create issue
Issue #36 new
Former user created an issue

How can I check the name and the E-Mail-Adress whether they are filled?

Comments (3)

  1. Paolo M

    You added validation, thanks.

    But:

    if (Settings::get('require_name_email', false) && $this->userId === 0) {
        $rules['name'] = 'required';
        $rules['email'] = 'required|email';
        $messages['name'] = 'xeor.comments::lang.messages.name';
        $messages['email'] = 'xeor.comments::lang.messages.email';
    }
    

    should be after

    $this->userId = $this->page['userId'] = Helper::getUserId();
    

    otherwise $this->userId === 0 return false.

    am I right?

  2. Paolo M

    and in the same file components/Comments.php

    'mail' => post('mail', null),
    

    should be

    'email' => post('mail', null),
    
  3. Log in to comment