Added check for user object to form submission. (#30)
This commit is contained in:
parent
6d10e0c054
commit
e3510fbf26
10
comments.php
10
comments.php
|
@ -174,10 +174,12 @@ class CommentsPlugin extends Plugin
|
|||
$email = filter_var(urldecode($post['email']), FILTER_SANITIZE_STRING);
|
||||
$title = filter_var(urldecode($post['title']), FILTER_SANITIZE_STRING);
|
||||
|
||||
$user = $this->grav['user'];
|
||||
if ($user->authenticated) {
|
||||
$name = $user->fullname;
|
||||
$email = $user->email;
|
||||
if (isset($this->grav['user'])) {
|
||||
$user = $this->grav['user'];
|
||||
if ($user->authenticated) {
|
||||
$name = $user->fullname;
|
||||
$email = $user->email;
|
||||
}
|
||||
}
|
||||
|
||||
/** @var Language $language */
|
||||
|
|
Loading…
Reference in New Issue