Language: PHP
Label: vulnerable
CWE: CWE-79 \u2014 Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.

Code:
function User_view_worklog(Worklog $worklog, $admin_user_worklog_privilege)
{
    $actions = '';
    if ($admin_user_worklog_privilege) {
        $actions = table_buttons([
            button(
                url('/admin/user/' . $worklog->user->id . '/worklog/' . $worklog->id),
                icon('pencil') . __('edit'),
                'btn-sm'
            ),
            button(
                url('/admin/user/' . $worklog->user->id . '/worklog/' . $worklog->id . '/delete'),
                icon('trash') . __('delete'),
                'btn-sm'
            ),
        ]);
    }

    return [
        'date'       => icon('calendar-event') . date(__('Y-m-d'), $worklog->worked_at->timestamp),
        'duration'   => sprintf('%.2f', $worklog->hours) . ' h',
        'room'       => '',
        'shift_info' => __('Work log entry'),
        'comment'    => $worklog->comment . '<br>'
            . sprintf(
                __('Added by %s at %s'),
                User_Nick_render($worklog->creator),
                $worklog->created_at->format(__('Y-m-d H:i'))
            ),
        'actions'    => $actions,
    ];
}