diff --git a/Rocksolid_Light/rocksolid/lib/message.inc.php b/Rocksolid_Light/rocksolid/lib/message.inc.php index f026e38..265ec2e 100644 --- a/Rocksolid_Light/rocksolid/lib/message.inc.php +++ b/Rocksolid_Light/rocksolid/lib/message.inc.php @@ -453,7 +453,7 @@ function show_header($head, $group, $local_poster = false) echo ''; } if ($head->name != "") { - echo create_name_link($head->name, $head->from); + echo create_name_link($head->name, $head->from, false); } else { if (isset($CONFIG['hide_email']) && $CONFIG['hide_email'] == true) { echo truncate_email($head->from); @@ -568,10 +568,13 @@ function show_header_short($head, $group, $local_poster = false) global $file_attachment, $CONFIG, $config_name, $sitelink; global $OVERRIDES; + // If Subject: is longer than this, place From: below Subject: in short short_header + $maxsubjectlength = 70; + echo '
'; if ($head->name != "") { - $displayname = create_name_link($head->name, $head->from); + $displayname = create_name_link($head->name, $head->from, false); } else { if (isset($CONFIG['hide_email']) && $CONFIG['hide_email'] == true) { $displayname = truncate_email($head->from); @@ -581,7 +584,7 @@ function show_header_short($head, $group, $local_poster = false) } // Where to show From in short_headers - if (isset($OVERRIDES['short_header_show_from_in_subject']) && $OVERRIDES['short_header_show_from_in_subject'] == true) { + if (isset($OVERRIDES['short_header_show_from_in_subject']) && $OVERRIDES['short_header_show_from_in_subject'] == true && strlen($head->subject) < $maxsubjectlength) { echo ''; echo htmlspecialchars($head->subject); echo ''; diff --git a/Rocksolid_Light/rocksolid/newsportal.php b/Rocksolid_Light/rocksolid/newsportal.php index 0d26731..0e50187 100644 --- a/Rocksolid_Light/rocksolid/newsportal.php +++ b/Rocksolid_Light/rocksolid/newsportal.php @@ -1741,20 +1741,27 @@ function format_log_date() return date('M d H:i:s'); } -function create_name_link($name, $data = null) +function create_name_link($name, $data = null, $truncate = true) { global $CONFIG; $name = preg_replace('/\"/', '', $name); + + if ($truncate) { + $trimlength = 20; + } else { + $trimlength = null; + } + if ($data) { $data = urlencode(base64_encode($data)); } if ((strpos($name, '...@') !== false && (isset($CONFIG['hide_email']) && $CONFIG['hide_email'] == true)) && ! $data) { - $return = '' . substr(htmlspecialchars($name), 0, 20) . ''; + $return = '' . substr(htmlspecialchars($name), 0, $trimlength) . ''; } else { if (isset($_COOKIE['mail_name'])) { - $return = '' . substr(htmlspecialchars($name), 0, 20) . ''; + $return = '' . substr(htmlspecialchars($name), 0, $trimlength) . ''; } else { - $return = '' . substr(htmlspecialchars($name), 0, 20) . ''; + $return = '' . substr(htmlspecialchars($name), 0, $trimlength) . ''; } } return ($return);