|
From: OryNider <ory...@us...> - 2008-02-01 01:32:04
|
Update of /cvsroot/mxbb/core/includes In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv30464 Modified Files: mx_functions_phpbb.php Log Message: mx_message_die() fixes plus security check if main classses are loaded. prosilver nav menu template files replaced. Index: mx_functions_phpbb.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/mx_functions_phpbb.php,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** mx_functions_phpbb.php 18 Jan 2008 10:28:37 -0000 1.40 --- mx_functions_phpbb.php 1 Feb 2008 01:31:59 -0000 1.41 *************** *** 317,322 **** static $msg_history; //$default_lang = $mx_user->get_old_lang($board_config['default_lang']); ! $default_lang = $mx_user->lang['default_lang']; if( !isset($msg_history) ) --- 317,334 ---- static $msg_history; + if ( !defined('PORTAL_BACKEND') ) + { + if ( @file_exists($phpbb_root_path . "modcp.$phpEx") ) + { + define('PORTAL_BACKEND', 'phpbb2'); + } + else if ( @file_exists($phpbb_root_path . "mcp.$phpEx") ) + { + define('PORTAL_BACKEND', 'phpbb3'); + } + } + //$default_lang = $mx_user->get_old_lang($board_config['default_lang']); ! $default_lang = ($mx_user->lang['default_lang']) ? $mx_user->lang['default_lang'] : $board_config['default_lang']; if( !isset($msg_history) ) *************** *** 401,404 **** --- 413,421 ---- } + //Security check + if( !is_object($mx_user) && !is_object($mx_page) && !is_object($mx_request_vars)) + { + die('Hacking attempt, or couldn\'t initalize the main classes required to call mx_message_die().'); + } if( !is_object($mx_user)) *************** *** 432,436 **** //$theme = $mx_user->_setup_style($board_config['default_style']); } ! $default_lang = $mx_user->lang['default_lang']; // // If the header hasn't been output then do it --- 449,468 ---- //$theme = $mx_user->_setup_style($board_config['default_style']); } ! ! $default_lang = ($mx_user->lang['default_lang']) ? $mx_user->lang['default_lang'] : $board_config['default_lang']; ! ! switch (PORTAL_BACKEND) ! { ! case 'internal': ! case 'phpbb3': ! $lang_path = $mx_root_path . 'includes/shared/phpbb2/language/'; ! break; ! case 'phpbb2': ! $lang_path = $phpbb_root_path . 'language/'; ! break; ! default: ! $lang_path = $phpbb_root_path . 'language/'; ! } ! // // If the header hasn't been output then do it *************** *** 440,452 **** if ( empty($lang) || empty($lang['Board_disable']) ) { ! if ( !empty($default_lang) && file_exists(@phpBB2::phpbb_realpath($mx_root_path . 'includes/shared/phpbb2/language/lang_' . $default_lang . '/lang_main.'.$phpEx)) ) { ! include($mx_root_path . 'language/lang_' . $default_lang . '/lang_main.'.$phpEx); ! include($mx_root_path . 'includes/shared/phpbb2/language/lang_' . $default_lang . '/lang_main.' . $phpEx); // Also include phpBB lang keys } ! else { ! include($mx_root_path . 'language/lang_english/lang_main.'.$phpEx); ! include($mx_root_path . 'includes/shared/phpbb2/language/lang_english/lang_main.'.$phpEx); } } --- 472,489 ---- if ( empty($lang) || empty($lang['Board_disable']) ) { ! if ((@include $lang_path . "lang_" . $default_lang . "/lang_main.$phpEx") === false) { ! if ((@include $lang_path . "lang_english/lang_main.$phpEx") === false) ! { ! die('Language file ' . $lang_path . "lang_" . $default_lang . "/lang_main.$phpEx" . ' couldn\'t be opened.'); ! } } ! ! if ((@include $mx_root_path . "language/lang_" . $default_lang . "/lang_main.$phpEx") === false) { ! if ((@include $mx_root_path . "language/lang_english/lang_main.$phpEx") === false) ! { ! die('Language file ' . $mx_root_path . "language/lang_" . $default_lang . "/lang_main.$phpEx" . ' couldn\'t be opened.'); ! } } } *************** *** 514,526 **** // available so we're going to dump out a simple echo'd statement // ! @include($mx_root_path . 'language/lang_english/lang_main.'.$phpEx); ! ! if (file_exists($phpbb_root_path . 'language/lang_' .$default_lang . '/lang_main.' . $phpEx)) { ! include($phpbb_root_path . 'language/lang_' . $default_lang . '/lang_main.' . $phpEx); // Also include phpBB lang keys } ! else { ! include($mx_root_path . 'includes/shared/phpbb2/language/lang_' . $default_lang . '/lang_main.' . $phpEx); // Also include phpBB lang keys } --- 551,568 ---- // available so we're going to dump out a simple echo'd statement // ! if ((@include $lang_path . "lang_" . $default_lang . "/lang_main.$phpEx") === false) { ! if ((@include $lang_path . "lang_english/lang_main.$phpEx") === false) ! { ! die('Language file ' . $lang_path . "lang_" . $default_lang . "/lang_main.$phpEx" . ' couldn\'t be opened.'); ! } } ! ! if ((@include $mx_root_path . "language/lang_" . $default_lang . "/lang_main.$phpEx") === false) { ! if ((@include $mx_root_path . "language/lang_english/lang_main.$phpEx") === false) ! { ! die('Language file ' . $mx_root_path . "language/lang_" . $default_lang . "/lang_main.$phpEx" . ' couldn\'t be opened.'); ! } } |