diff --git a/lib/jabber.php b/lib/jabber.php
index d109e40c46..74e51d71a7 100644
--- a/lib/jabber.php
+++ b/lib/jabber.php
@@ -105,8 +105,8 @@ function jabber_format_entry($profile, $notice) {
$entry .= "" . $profile->nickname . "\n";
$entry .= "" . common_profile_avatar_url($profile, AVATAR_PROFILE_SIZE) . "\n";
$entry .= "\n";
- $entry .= "
" . $msg . "\n";
- $entry .= "" . $msg . "\n";
+ $entry .= "" . htmlspecialchars($msg) . "\n";
+ $entry .= "" . htmlspecialchars($msg) . "\n";
$entry .= "\n";
$entry .= "". $notice->uri . "\n";
$entry .= "".common_date_w3dtf($notice->created)."\n";