diff --git a/contrib/pm/theme.php b/contrib/pm/theme.php
index aa041e6c..bfbb7334 100644
--- a/contrib/pm/theme.php
+++ b/contrib/pm/theme.php
@@ -6,7 +6,7 @@ class PMTheme extends Themelet {
$html .= "
Subject | From | Date | Action |
";
foreach($pms as $pm) {
$h_subject = html_escape($pm["subject"]);
- if(strlen($h_subject) == 0) $h_subject = "(No subject)";
+ if(strlen(trim($h_subject)) == 0) $h_subject = "(No subject)";
$h_from = html_escape($pm["from_name"]);
$from_url = make_link("user/".url_escape($pm["from_name"]));
$pm_url = make_link("pm/read/".$pm["id"]);