1
0
mirror of https://github.com/typemill/typemill.git synced 2025-08-05 21:57:31 +02:00

V2.1.2 Fix fullname in user model and logic to add author in meta

This commit is contained in:
trendschau
2024-01-25 15:05:13 +01:00
parent 7b0cd592ae
commit 49301c1722
2 changed files with 21 additions and 3 deletions

View File

@@ -78,7 +78,11 @@ class Meta
$user = new User();
if($user->setUser($username))
{
$author = $user->getFullName();
$fullname = $user->getFullName();
if($fullname)
{
$author = $fullname;
}
}
$meta = [];
@@ -127,7 +131,11 @@ class Meta
$user = new User();
if($user->setUser($currentuser))
{
$author = $user->getFullName();
$fullname = $user->getFullName();
if($fullname)
{
$author = $fullname;
}
}
}

View File

@@ -71,7 +71,17 @@ class User
public function getFullName()
{
return trim($this->user['firstname'] . ' ' . $this->user['lastname']);
$firstname = $this->user['firstname'] ?? '';
$lastname = $this->user['lastname'] ?? '';
$fullname = trim($firstname . ' ' . $lastname);
if($fullname != '')
{
return $fullname;
}
return false;
}
public function getError()