From 43fdb2a474b990b8b7db21bfb05b30a70ac768a0 Mon Sep 17 00:00:00 2001 From: teepe Date: Sat, 19 Jan 2002 13:49:36 +0000 Subject: [PATCH] some more fixes to solve the vhost problem (icy cold here in the freeze) git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@2176 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- functions/mailbox_display.php | 2 ++ functions/mime.php | 2 +- functions/page_header.php | 4 +++- functions/strings.php | 16 ++++++++++++++++ src/addrbook_search_html.php | 1 + src/addressbook.php | 1 + src/options.php | 1 + src/options_highlight.php | 1 + src/search.php | 3 ++- src/signout.php | 1 + themes/darkness.php | 3 +++ 11 files changed, 32 insertions(+), 3 deletions(-) diff --git a/functions/mailbox_display.php b/functions/mailbox_display.php index 8fb83291..fadc5684 100644 --- a/functions/mailbox_display.php +++ b/functions/mailbox_display.php @@ -12,6 +12,8 @@ * $Id$ */ +include_once('../functions/strings.php'); + define('PG_SEL_MAX', 10); /* Default value for page_selector_max. */ function printMessageInfo($imapConnection, $t, $i, $key, $mailbox, $sort, $start_msg, $where, $what) { diff --git a/functions/mime.php b/functions/mime.php index 278e5673..4cc1ccaa 100644 --- a/functions/mime.php +++ b/functions/mime.php @@ -836,7 +836,7 @@ function encodeHeader ($string) { */ function MagicHTML( $body, $id ) { - global $message, $PHP_SELF, $HTTP_SERVER_VARS, + global $message, $HTTP_SERVER_VARS, $attachment_common_show_images; $attachment_common_show_images = diff --git a/functions/page_header.php b/functions/page_header.php index 7463dc9f..637ba7f4 100644 --- a/functions/page_header.php +++ b/functions/page_header.php @@ -11,6 +11,8 @@ * $Id$ */ +include_once('../functions/strings.php'); + // Always set up the language before calling these functions function displayHtmlHeader( $title = 'SquirrelMail', $xtra = '', $do_hook = TRUE ) { @@ -134,4 +136,4 @@ function checkForm() { "\n\n"; } -?> \ No newline at end of file +?> diff --git a/functions/strings.php b/functions/strings.php index d39df3e5..d4b5802a 100644 --- a/functions/strings.php +++ b/functions/strings.php @@ -261,6 +261,20 @@ function find_mailbox_name ($mailbox) { } +function php_self () { + global $PHP_SELF, $HTTP_SERVER_VARS; + + if (isset($PHP_SELF) && !empty($PHP_SELF)) { + return $PHP_SELF; + } else if (isset($HTTP_SERVER_VARS['PHP_SELF']) && + !empty($HTTP_SERVER_VARS['PHP_SELF'])) { + return $HTTP_SERVER_VARS['PHP_SELF']; + } else { + return ''; + } +} + + /** * This determines the location to forward to relative to your server. * If this doesnt work correctly for you (although it should), you can @@ -589,4 +603,6 @@ function RemoveSlashes(&$array) { } } +$PHP_SELF = php_self(); + ?> diff --git a/src/addrbook_search_html.php b/src/addrbook_search_html.php index 51d2b538..585680dc 100644 --- a/src/addrbook_search_html.php +++ b/src/addrbook_search_html.php @@ -23,6 +23,7 @@ require_once('../functions/smtp.php'); require_once('../functions/display_messages.php'); require_once('../functions/addressbook.php'); require_once('../functions/plugin.php'); +include_once('../functions/strings.php'); /* Insert hidden data */ function addr_insert_hidden() { diff --git a/src/addressbook.php b/src/addressbook.php index 18edc261..f32b85ab 100644 --- a/src/addressbook.php +++ b/src/addressbook.php @@ -15,6 +15,7 @@ require_once('../src/validate.php'); require_once('../functions/array.php'); require_once('../functions/display_messages.php'); require_once('../functions/addressbook.php'); +include_once('../functions/strings.php'); /* Make an input field */ function adressbook_inp_field($label, $field, $name, $size, $values, $add) { diff --git a/src/options.php b/src/options.php index b89cf21f..fe7a68af 100644 --- a/src/options.php +++ b/src/options.php @@ -17,6 +17,7 @@ require_once('../functions/display_messages.php'); require_once('../functions/imap.php'); require_once('../functions/array.php'); require_once('../functions/options.php'); +include_once('../functions/strings.php'); /* Set the base uri. */ ereg ("(^.*/)[^/]+/[^/]+$", $PHP_SELF, $regs); diff --git a/src/options_highlight.php b/src/options_highlight.php index 0775e2e8..edb6acd6 100644 --- a/src/options_highlight.php +++ b/src/options_highlight.php @@ -16,6 +16,7 @@ require_once('../functions/display_messages.php'); require_once('../functions/imap.php'); require_once('../functions/array.php'); require_once('../functions/plugin.php'); +include_once('../functions/strings.php'); function oh_opt( $val, $sel, $tit ) { echo "