From 660a647f8abb7477db1fed03e01951622b57b19d Mon Sep 17 00:00:00 2001 From: pdontthink Date: Mon, 25 Apr 2022 21:28:55 +0000 Subject: [PATCH] Cause message subject to show in page title when message view is loaded in its own window/tab git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@14949 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- functions/page_header.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/functions/page_header.php b/functions/page_header.php index 25638faa..339035ea 100644 --- a/functions/page_header.php +++ b/functions/page_header.php @@ -181,6 +181,13 @@ function displayHtmlHeader( $title = 'SquirrelMail', $xtra = '', $do_hook = TRUE if (!empty($output)) trigger_error('A plugin on the "generic_header" hook has attempted to output directly to the browser', E_USER_ERROR); } + // Add message subject to page title (should only have an effect when loaded in its own browser window/tab) + // TODO: For search page, could add " - Search: $what" or something like that + global $message; + if (!empty($message) && !empty($message->rfc822_header) && !empty($message->rfc822_header->subject)) + // decodeHeader() should already encode the output, so no sm_encode_html_special_chars() + $title .= ' - ' . decodeHeader($message->rfc822_header->subject); + $header_tags .= $xtra; $oTemplate->assign('page_title', $title); -- 2.25.1