diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 1456a01755..ff0bfd0dcd 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -586,7 +586,7 @@ function obtain_word_list(&$orig_word, &$replacement_word) // failures, etc. // -> ERROR : Use for any error, a simple page will be output // -function message_die($msg_code, $msg_text = '', $msg_title = '', $display_header = false) +function message_die($msg_code, $msg_text = '', $msg_title = '') { global $db, $session, $acl, $template, $board_config, $theme, $lang, $userdata, $user_ip; global $phpEx, $phpbb_root_path, $nav_links, $starttime; @@ -594,31 +594,42 @@ function message_die($msg_code, $msg_text = '', $msg_title = '', $display_header switch ( $msg_code ) { case MESSAGE: - if ( !$userdata ) + if ( empty($lang) && !empty($board_config['default_lang']) ) { - $userdata = $session->start(); - $acl = new auth('admin', $userdata); - $session->configure($userdata); - } + if ( !file_exists($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_main.' . $phpEx) ) + { + $board_config['default_lang'] = 'english'; + } - if ( !defined('HEADER_INC') ) - { - if ( !defined('IN_ADMIN') ) - { - include($phpbb_root_path . 'includes/page_header.' . $phpEx); - } - else - { - page_header('', '', false); - } + include($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_main.' . $phpEx); } $msg_title = ( $msg_title == '' ) ? $lang['Information'] : $msg_title; $msg_text = ( !empty($lang[$msg_text]) ) ? $lang[$msg_text] : $msg_text; + if ( !defined('HEADER_INC') ) + { + if ( empty($userdata) ) + { + echo '' . $msg_title . '' . "\n"; + echo '
' . $msg_title . '
' . $msg_text . '
'; + $db->sql_close(); + exit; + } + else if ( defined('IN_ADMIN') ) + { + page_header('', '', false); + } + else + { + include($phpbb_root_path . 'includes/page_header.' . $phpEx); + } + } + if ( defined('IN_ADMIN') ) { page_message($msg_title, $msg_text, $display_header); + page_footer(); } else { @@ -630,21 +641,15 @@ function message_die($msg_code, $msg_text = '', $msg_title = '', $display_header 'MESSAGE_TITLE' => $msg_title, 'MESSAGE_TEXT' => $msg_text) ); - } - if ( !defined('IN_ADMIN') ) - { include($phpbb_root_path . 'includes/page_tail.' . $phpEx); } - else - { - page_footer(); - } + break; case ERROR: echo 'phpBB 2 :: General Error' . "\n"; - echo '

phpBB2 :: General Error


' . $msg_text . '


Contact the site administrator to report this failure

'; + echo '

phpBB2 :: General Error


' . $msg_text . '


Contact the site administrator to report this failure

'; $db->sql_close(); break; }