|
From: Jon O. <jon...@us...> - 2008-10-31 18:54:48
|
Update of /cvsroot/mxbb/core/includes/shared/phpbb2/includes In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv6180 Modified Files: functions.php functions_post.php functions_selects.php functions_validate.php Log Message: http://www.mx-publisher.com/phpBB2/viewtopic.php?p=65197#65197 Massive update. Index: functions_validate.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/shared/phpbb2/includes/functions_validate.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** functions_validate.php 4 Oct 2008 07:04:25 -0000 1.3 --- functions_validate.php 31 Oct 2008 18:54:43 -0000 1.4 *************** *** 32,36 **** // Remove doubled up spaces $username = preg_replace('#\s+#', ' ', trim($username)); ! $username = $phpBB2->phpbb_clean_username($username); $sql = "SELECT username --- 32,36 ---- // Remove doubled up spaces $username = preg_replace('#\s+#', ' ', trim($username)); ! $username = phpBB2::phpbb_clean_username($username); $sql = "SELECT username Index: functions.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/shared/phpbb2/includes/functions.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** functions.php 4 Oct 2008 07:04:25 -0000 1.5 --- functions.php 31 Oct 2008 18:54:43 -0000 1.6 *************** *** 27,39 **** class phpBB2 { ! /** ! * Constructor ! */ ! function __construct() ! { ! return; ! } ! ! function get_db_stat($mode) { global $db; --- 27,31 ---- class phpBB2 { ! public static function get_db_stat($mode) { global $db; *************** *** 89,97 **** // added at phpBB 2.0.11 to properly format the username ! function phpbb_clean_username($username) { $username = substr(htmlspecialchars(str_replace("\'", "'", trim($username))), 0, 25); ! //$username = $this->phpbb_rtrim($username, "\\"); ! $username = phpBB2::phpbb_rtrim($username, "\\"); // php4 $username = str_replace("'", "\'", $username); --- 81,88 ---- // added at phpBB 2.0.11 to properly format the username ! public static function phpbb_clean_username($username) { $username = substr(htmlspecialchars(str_replace("\'", "'", trim($username))), 0, 25); ! $username = self::phpbb_rtrim($username, "\\"); $username = str_replace("'", "\'", $username); *************** *** 103,107 **** * Added in phpBB 2.0.18 */ ! function phpbb_ltrim($str, $charlist = false) { if ($charlist === false) --- 94,98 ---- * Added in phpBB 2.0.18 */ ! public static function phpbb_ltrim($str, $charlist = false) { if ($charlist === false) *************** *** 129,133 **** // added at phpBB 2.0.12 to fix a bug in PHP 4.3.10 (only supporting charlist in php >= 4.1.0) ! function phpbb_rtrim($str, $charlist = false) { if ($charlist === false) --- 120,124 ---- // added at phpBB 2.0.12 to fix a bug in PHP 4.3.10 (only supporting charlist in php >= 4.1.0) ! public static function phpbb_rtrim($str, $charlist = false) { if ($charlist === false) *************** *** 161,165 **** * Added in phpBB 2.0.20 */ ! function dss_rand() { global $db, $board_config, $dss_seeded; --- 152,156 ---- * Added in phpBB 2.0.20 */ ! public static function dss_rand() { global $db, $board_config, $dss_seeded; *************** *** 188,192 **** // Get Userdata, $user can be username or user_id. If force_str is true, the username will be forced. // ! function get_userdata($user, $force_str = false) { global $db; --- 179,183 ---- // Get Userdata, $user can be username or user_id. If force_str is true, the username will be forced. // ! public static function get_userdata($user, $force_str = false) { global $db; *************** *** 194,199 **** if (!is_numeric($user) || $force_str) { ! $user = $this->phpbb_clean_username($user); ! //$user = phpBB2::phpbb_clean_username($user); // php4 } else --- 185,189 ---- if (!is_numeric($user) || $force_str) { ! $user = self::phpbb_clean_username($user); } else *************** *** 214,218 **** } ! function make_jumpbox($action, $match_forum_id = 0) { global $template, $userdata, $lang, $db, $nav_links, $phpEx, $SID; --- 204,208 ---- } ! public static function make_jumpbox($action, $match_forum_id = 0) { global $template, $userdata, $lang, $db, $nav_links, $phpEx, $SID; *************** *** 333,337 **** if ( !empty($userdata['user_lang'])) { ! $default_lang = $this->phpbb_ltrim(basename($this->phpbb_rtrim($userdata['user_lang'])), "'"); } --- 323,327 ---- if ( !empty($userdata['user_lang'])) { ! $default_lang = self::phpbb_ltrim(basename(self::phpbb_rtrim($userdata['user_lang'])), "'"); } *************** *** 348,360 **** else { ! $default_lang = $this->phpbb_ltrim(basename($this->phpbb_rtrim($board_config['default_lang'])), "'"); } ! if ( !file_exists(@$this->phpbb_realpath($phpbb_root_path . 'language/lang_' . $default_lang . '/lang_main.'.$phpEx)) ) { if ( $userdata['user_id'] != ANONYMOUS ) { // For logged in users, try the board default language next ! $default_lang = $this->phpbb_ltrim(basename($this->phpbb_rtrim($board_config['default_lang'])), "'"); } else --- 338,350 ---- else { ! $default_lang = self::phpbb_ltrim(basename(self::phpbb_rtrim($board_config['default_lang'])), "'"); } ! if ( !file_exists(@self::phpbb_realpath($phpbb_root_path . 'language/lang_' . $default_lang . '/lang_main.'.$phpEx)) ) { if ( $userdata['user_id'] != ANONYMOUS ) { // For logged in users, try the board default language next ! $default_lang = self::phpbb_ltrim(basename(self::phpbb_rtrim($board_config['default_lang'])), "'"); } else *************** *** 366,370 **** } ! if ( !file_exists(@$this->phpbb_realpath($phpbb_root_path . 'language/lang_' . $default_lang . '/lang_main.'.$phpEx)) ) { mx_message_die(CRITICAL_ERROR, 'Could not locate valid language pack'); --- 356,360 ---- } ! if ( !file_exists(@self::phpbb_realpath($phpbb_root_path . 'language/lang_' . $default_lang . '/lang_main.'.$phpEx)) ) { mx_message_die(CRITICAL_ERROR, 'Could not locate valid language pack'); *************** *** 405,409 **** if ( defined('IN_ADMIN') ) { ! if( !file_exists(@$this->phpbb_realpath($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_admin.'.$phpEx)) ) { $board_config['default_lang'] = 'english'; --- 395,399 ---- if ( defined('IN_ADMIN') ) { ! if( !file_exists(@self::phpbb_realpath($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_admin.'.$phpEx)) ) { $board_config['default_lang'] = 'english'; *************** *** 522,526 **** } ! $img_lang = ( file_exists(@$this->phpbb_realpath($phpbb_root_path . $current_template_path . '/images/lang_' . $board_config['default_lang'])) ) ? $board_config['default_lang'] : 'english'; while( list($key, $value) = @each($images) ) --- 512,516 ---- } ! $img_lang = ( file_exists(@self::phpbb_realpath($phpbb_root_path . $current_template_path . '/images/lang_' . $board_config['default_lang'])) ) ? $board_config['default_lang'] : 'english'; while( list($key, $value) = @each($images) ) *************** *** 537,541 **** */ ! function encode_ip($dotquad_ip) { $ip_sep = explode('.', $dotquad_ip); --- 527,531 ---- */ ! public static function encode_ip($dotquad_ip) { $ip_sep = explode('.', $dotquad_ip); *************** *** 543,547 **** } ! function decode_ip($int_ip) { $hexipbang = explode('.', chunk_split($int_ip, 2, '.')); --- 533,537 ---- } ! public static function decode_ip($int_ip) { $hexipbang = explode('.', chunk_split($int_ip, 2, '.')); *************** *** 552,556 **** // Create date/time from format and timezone // ! function create_date($format, $gmepoch, $tz) { global $board_config, $lang; --- 542,546 ---- // Create date/time from format and timezone // ! public static function create_date($format, $gmepoch, $tz) { global $board_config, $lang; *************** *** 573,577 **** // page number sequence // ! function generate_pagination($base_url, $num_items, $per_page, $start_item, $add_prevnext_text = TRUE) { global $lang; --- 563,567 ---- // page number sequence // ! public static function generate_pagination($base_url, $num_items, $per_page, $start_item, $add_prevnext_text = TRUE) { global $lang; *************** *** 670,674 **** // If you just need the 1-parameter preg_quote call, then don't bother using this. // ! function phpbb_preg_quote($str, $delimiter) { $text = preg_quote($str); --- 660,664 ---- // If you just need the 1-parameter preg_quote call, then don't bother using this. // ! public static function phpbb_preg_quote($str, $delimiter) { $text = preg_quote($str); *************** *** 683,687 **** // to return both sets of arrays // ! function obtain_word_list(&$orig_word, &$replacement_word) { global $db; --- 673,677 ---- // to return both sets of arrays // ! public static function obtain_word_list(&$orig_word, &$replacement_word) { global $db; *************** *** 923,927 **** // seem to need this, so we'll just return the original value. // dougk_ff7 <October 5, 2002> ! function phpbb_realpath($path) { global $phpbb_root_path, $phpEx; --- 913,917 ---- // seem to need this, so we'll just return the original value. // dougk_ff7 <October 5, 2002> ! public static function phpbb_realpath($path) { global $phpbb_root_path, $phpEx; *************** *** 930,934 **** } ! function redirect($url) { global $db, $board_config; --- 920,924 ---- } ! public static function redirect($url) { global $db, $board_config; Index: functions_selects.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/shared/phpbb2/includes/functions_selects.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** functions_selects.php 4 Oct 2008 07:04:25 -0000 1.3 --- functions_selects.php 31 Oct 2008 18:54:43 -0000 1.4 *************** *** 34,38 **** while ( $file = readdir($dir) ) { ! if (preg_match('#^lang_#i', $file) && !is_file(@$phpBB2->phpbb_realpath($phpbb_root_path . $dirname . '/' . $file)) && !is_link(@$phpBB2->phpbb_realpath($phpbb_root_path . $dirname . '/' . $file))) { $filename = trim(str_replace("lang_", "", $file)); --- 34,38 ---- while ( $file = readdir($dir) ) { ! if (preg_match('#^lang_#i', $file) && !is_file(@phpBB2::phpbb_realpath($phpbb_root_path . $dirname . '/' . $file)) && !is_link(@phpBB2::phpbb_realpath($phpbb_root_path . $dirname . '/' . $file))) { $filename = trim(str_replace("lang_", "", $file)); Index: functions_post.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/shared/phpbb2/includes/functions_post.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** functions_post.php 4 Oct 2008 07:04:25 -0000 1.5 --- functions_post.php 31 Oct 2008 18:54:43 -0000 1.6 *************** *** 633,637 **** $orig_word = array(); $replacement_word = array(); ! $phpBB2->obtain_word_list($orig_word, $replacement_word); $emailer->from($board_config['board_email']); --- 633,637 ---- $orig_word = array(); $replacement_word = array(); ! phpBB2::obtain_word_list($orig_word, $replacement_word); $emailer->from($board_config['board_email']); |