diff --git a/core/modules/user/tests/src/Functional/UserPasswordResetTest.php b/core/modules/user/tests/src/Functional/UserPasswordResetTest.php
index ba676ef2f9cca4bf97e560c897a7f9235d79d794..5aab73fd94bb61ca8ed9b723c9af4050fd2eb829 100644
--- a/core/modules/user/tests/src/Functional/UserPasswordResetTest.php
+++ b/core/modules/user/tests/src/Functional/UserPasswordResetTest.php
@@ -336,7 +336,7 @@ public function checkBodyText(): bool {
// Assume the most recent email.
$_emails = $this->drupalGetMails();
$email = end($_emails);
- if (strip_tags($email['body']) === $email['body']) {
+ if (htmlspecialchars_decode($email['body']) === $email['body']) {
return TRUE;
}
return FALSE;