|
From: OryNider <ory...@us...> - 2008-02-01 01:15:25
|
Update of /cvsroot/mxbb/core/includes In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv22908/includes Modified Files: Tag: core28x mx_functions_phpbb.php Log Message: mx_message_die() fixed with security check for unitialized classes etc plus language file loaging. the other admin files just have an @ before define() so don't give a errror in left pane. Index: mx_functions_phpbb.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/mx_functions_phpbb.php,v retrieving revision 1.32.2.7 retrieving revision 1.32.2.8 diff -C2 -d -r1.32.2.7 -r1.32.2.8 *** mx_functions_phpbb.php 18 Jan 2008 10:25:13 -0000 1.32.2.7 --- mx_functions_phpbb.php 1 Feb 2008 01:15:21 -0000 1.32.2.8 *************** *** 120,123 **** --- 120,135 ---- 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']; *************** *** 204,207 **** --- 216,224 ---- } + //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)) *************** *** 236,240 **** } //$default_lang = $board_config['default_lang']; ! $default_lang = $mx_user->lang['default_lang']; // // If the header hasn't been output then do it --- 253,271 ---- } //$default_lang = $board_config['default_lang']; ! $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 *************** *** 244,256 **** 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); } } --- 275,292 ---- 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.'); ! } } } *************** *** 318,330 **** // 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 } --- 354,371 ---- // 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.'); ! } } |