From: Mischa POSLAWSKY Date: Wed, 20 Nov 2019 23:19:01 +0000 (+0100) Subject: auth: append login to formatted user names X-Git-Tag: v4.2~9 X-Git-Url: http://git.shiar.net/minimedit.git/commitdiff_plain/ec5417cab8b5b6227670a13d6a58e6e392fb7971 auth: append login to formatted user names --- 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);