widget/reply: ignore missing user object
authorMischa POSLAWSKY <perl@shiar.org>
Sat, 15 May 2021 21:53:15 +0000 (23:53 +0200)
committerMischa POSLAWSKY <perl@shiar.org>
Mon, 17 May 2021 18:53:38 +0000 (20:53 +0200)
Fix include without site setup for testing.

upload.inc.php

index b4a056d2c091dccce553d148cb9a76a59db7f44f..e270b76328c97968149f1962f0488247d66378c4 100644 (file)
@@ -48,7 +48,7 @@ function messagehtml($input)
        if (empty($input)) {
                return;
        }
-       if ($User->admin and preg_match('/\A<[a-z][^>]*>/', $input)) {
+       if ($User and $User->admin and preg_match('/\A<[a-z][^>]*>/', $input)) {
                return $input;  # allow html input as is if privileged
        }
        $markup = [