Problem/Motivation
The comments module displays deprecated warnings when empty comments are "submitted" on an environment with PHP 8.1.
Steps to reproduce
With an environment running PHP 8.1, enable comments and errors display. Attempt to add an empty comment on a node. This deprecation warning will be shown:
Deprecated function: strip_tags(): Passing null to parameter #1 ($string) of type string is deprecated in Drupal\comment\CommentForm->buildEntity() (line 323 of core/modules/comment/src/CommentForm.php).
Proposed resolution
Strip_tags parámeter (the comment body) should be cast to string.