widget/reply: ignore missing user object
[minimedit.git] / 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 = [