From: Mischa POSLAWSKY Date: Tue, 12 Jan 2021 04:46:17 +0000 (+0100) Subject: issue/activity: ignore missing author X-Git-Tag: v5.3~26 X-Git-Url: http://git.shiar.nl/minimedit.git/commitdiff_plain/0be29a130e7eba18671353565336cbe63296b723 issue/activity: ignore missing author Silence PHP warnings for system (eg p2000) notifications. --- diff --git a/auth.inc.php b/auth.inc.php index b22ed5b..34c83db 100644 --- a/auth.inc.php +++ b/auth.inc.php @@ -14,7 +14,7 @@ class User throw new Exception("Gebruiker niet gevonden in $dir"); } $this->dir = $dir; - $this->login = basename($dir); + $this->login = preg_replace('{.*/}', '', $dir); } function __get($col) diff --git a/widget/issue/activity.php b/widget/issue/activity.php index cd99e48..f986a53 100644 --- a/widget/issue/activity.php +++ b/widget/issue/activity.php @@ -14,7 +14,6 @@ print '
'; $group = NULL; while ($row = $query->fetch()) { - $rowuser = new User("profile/{$row->author}"); if ($group !== $row->issue) { $group = $row->issue; print '
'; @@ -25,8 +24,11 @@ while ($row = $query->fetch()) { print '
'; } print '
'; - printf('%s %s', - $rowuser->html, showdate(preg_split('/\D/', $row->created)) + if ($row->author and $rowuser = new User("profile/{$row->author}")) { + printf('%s ', $rowuser->html); + } + printf('%s', + showdate(preg_split('/\D/', $row->created)) ); printf("\n\t
%s
", $row->message); print "
\n";