From ec5417cab8b5b6227670a13d6a58e6e392fb7971 Mon Sep 17 00:00:00 2001 From: Mischa POSLAWSKY Date: Thu, 21 Nov 2019 00:19:01 +0100 Subject: [PATCH] auth: append login to formatted user names --- auth.inc.php | 6 +++++- issue/index.php | 2 +- widget/login/list.php | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/auth.inc.php b/auth.inc.php index aceb2de..3901609 100644 --- a/auth.inc.php +++ b/auth.inc.php @@ -29,7 +29,11 @@ class User function html() { - return $this->name ?: $this->login; + $name = htmlspecialchars($this->login); + if ($this->name and $this->name != $name) { + $name = "{$this->name} @$name"; + } + return $name; } function email() diff --git a/issue/index.php b/issue/index.php index 388db5d..bb556f2 100644 --- a/issue/index.php +++ b/issue/index.php @@ -16,7 +16,7 @@ if ($id and ctype_digit($id)) { $author = $Issue->author ? new User('profile/'.$Issue->author, FALSE) : NULL; printf('

%s%s %s

'."\n", 'Geplaatst', - $author ? " door {$author->name}" : '', + $author ? " door {$author->html}" : '', showdate(preg_split('/\D/', $Issue->created)) ); if ($Issue->assign) { diff --git a/widget/login/list.php b/widget/login/list.php index da4acd2..17dbaac 100644 --- a/widget/login/list.php +++ b/widget/login/list.php @@ -37,7 +37,7 @@ elseif (count($users) > 5) { print ">\n"; foreach ($users as $user) { - $name = $user->name ?: $user->login; + $name = $user->html; if ($GLOBALS['User'] and $GLOBALS['User']->admin('user')) { $link = '/login/edit/'.$user->login; $name = sprintf('%s', $link, $name); -- 2.30.0