[Phpbb-php5mod-cvs-checkins] phpbb-php5/install install.php,1.1,1.2 upgrade.php,1.1,1.2
Brought to you by:
jelly_doughnut
From: geocator <geo...@us...> - 2004-07-30 02:12:48
|
Update of /cvsroot/phpbb-php5mod/phpbb-php5/install In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13115/install Modified Files: install.php upgrade.php Log Message: Say goodbye long array names. Say hello superglobals. Removed code in common.php to try to rename the variables at runtime. No longer needed since we are renaming them. Index: install.php =================================================================== RCS file: /cvsroot/phpbb-php5mod/phpbb-php5/install/install.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** install.php 29 Jul 2004 22:36:20 -0000 1.1 --- install.php 30 Jul 2004 02:12:38 -0000 1.2 *************** *** 140,144 **** function guess_lang() { ! global $phpbb_root_path, $HTTP_SERVER_VARS; // The order here _is_ important, at least for major_minor --- 140,144 ---- function guess_lang() { ! global $phpbb_root_path, $_SERVER; // The order here _is_ important, at least for major_minor *************** *** 196,202 **** ); ! if (isset($HTTP_SERVER_VARS['HTTP_ACCEPT_LANGUAGE'])) { ! $accept_lang_ary = explode(',', $HTTP_SERVER_VARS['HTTP_ACCEPT_LANGUAGE']); for ($i = 0; $i < sizeof($accept_lang_ary); $i++) { --- 196,202 ---- ); ! if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) { ! $accept_lang_ary = explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']); for ($i = 0; $i < sizeof($accept_lang_ary); $i++) { *************** *** 229,290 **** if (!get_magic_quotes_gpc()) { ! if (is_array($HTTP_GET_VARS)) { ! while (list($k, $v) = each($HTTP_GET_VARS)) { ! if (is_array($HTTP_GET_VARS[$k])) { ! while (list($k2, $v2) = each($HTTP_GET_VARS[$k])) { ! $HTTP_GET_VARS[$k][$k2] = addslashes($v2); } ! @reset($HTTP_GET_VARS[$k]); } else { ! $HTTP_GET_VARS[$k] = addslashes($v); } } ! @reset($HTTP_GET_VARS); } ! if (is_array($HTTP_POST_VARS)) { ! while (list($k, $v) = each($HTTP_POST_VARS)) { ! if (is_array($HTTP_POST_VARS[$k])) { ! while (list($k2, $v2) = each($HTTP_POST_VARS[$k])) { ! $HTTP_POST_VARS[$k][$k2] = addslashes($v2); } ! @reset($HTTP_POST_VARS[$k]); } else { ! $HTTP_POST_VARS[$k] = addslashes($v); } } ! @reset($HTTP_POST_VARS); } ! if (is_array($HTTP_COOKIE_VARS)) { ! while (list($k, $v) = each($HTTP_COOKIE_VARS)) { ! if (is_array($HTTP_COOKIE_VARS[$k])) { ! while (list($k2, $v2) = each($HTTP_COOKIE_VARS[$k])) { ! $HTTP_COOKIE_VARS[$k][$k2] = addslashes($v2); } ! @reset($HTTP_COOKIE_VARS[$k]); } else { ! $HTTP_COOKIE_VARS[$k] = addslashes($v); } } ! @reset($HTTP_COOKIE_VARS); } } --- 229,290 ---- if (!get_magic_quotes_gpc()) { ! if (is_array($_GET)) { ! while (list($k, $v) = each($_GET)) { ! if (is_array($_GET[$k])) { ! while (list($k2, $v2) = each($_GET[$k])) { ! $_GET[$k][$k2] = addslashes($v2); } ! @reset($_GET[$k]); } else { ! $_GET[$k] = addslashes($v); } } ! @reset($_GET); } ! if (is_array($_POST)) { ! while (list($k, $v) = each($_POST)) { ! if (is_array($_POST[$k])) { ! while (list($k2, $v2) = each($_POST[$k])) { ! $_POST[$k][$k2] = addslashes($v2); } ! @reset($_POST[$k]); } else { ! $_POST[$k] = addslashes($v); } } ! @reset($_POST); } ! if (is_array($_COOKIE)) { ! while (list($k, $v) = each($_COOKIE)) { ! if (is_array($_COOKIE[$k])) { ! while (list($k2, $v2) = each($_COOKIE[$k])) { ! $_COOKIE[$k][$k2] = addslashes($v2); } ! @reset($_COOKIE[$k]); } else { ! $_COOKIE[$k] = addslashes($v); } } ! @reset($_COOKIE); } } *************** *** 354,363 **** // Obtain various vars ! $confirm = (isset($HTTP_POST_VARS['confirm'])) ? true : false; ! $cancel = (isset($HTTP_POST_VARS['cancel'])) ? true : false; ! if (isset($HTTP_POST_VARS['install_step']) || isset($HTTP_GET_VARS['install_step'])) { ! $install_step = (isset($HTTP_POST_VARS['install_step'])) ? $HTTP_POST_VARS['install_step'] : $HTTP_GET_VARS['install_step']; } else --- 354,363 ---- // Obtain various vars ! $confirm = (isset($_POST['confirm'])) ? true : false; ! $cancel = (isset($_POST['cancel'])) ? true : false; ! if (isset($_POST['install_step']) || isset($_GET['install_step'])) { ! $install_step = (isset($_POST['install_step'])) ? $_POST['install_step'] : $_GET['install_step']; } else *************** *** 366,392 **** } ! $upgrade = (!empty($HTTP_POST_VARS['upgrade'])) ? $HTTP_POST_VARS['upgrade']: ''; ! $upgrade_now = (!empty($HTTP_POST_VARS['upgrade_now'])) ? $HTTP_POST_VARS['upgrade_now']:''; ! $dbms = isset($HTTP_POST_VARS['dbms']) ? $HTTP_POST_VARS['dbms'] : ''; ! $dbhost = (!empty($HTTP_POST_VARS['dbhost'])) ? $HTTP_POST_VARS['dbhost'] : 'localhost'; ! $dbuser = (!empty($HTTP_POST_VARS['dbuser'])) ? $HTTP_POST_VARS['dbuser'] : ''; ! $dbpasswd = (!empty($HTTP_POST_VARS['dbpasswd'])) ? $HTTP_POST_VARS['dbpasswd'] : ''; ! $dbname = (!empty($HTTP_POST_VARS['dbname'])) ? $HTTP_POST_VARS['dbname'] : ''; ! $table_prefix = (!empty($HTTP_POST_VARS['prefix'])) ? $HTTP_POST_VARS['prefix'] : ''; ! $admin_name = (!empty($HTTP_POST_VARS['admin_name'])) ? $HTTP_POST_VARS['admin_name'] : ''; ! $admin_pass1 = (!empty($HTTP_POST_VARS['admin_pass1'])) ? $HTTP_POST_VARS['admin_pass1'] : ''; ! $admin_pass2 = (!empty($HTTP_POST_VARS['admin_pass2'])) ? $HTTP_POST_VARS['admin_pass2'] : ''; ! $ftp_path = (!empty($HTTP_POST_VARS['ftp_path'])) ? $HTTP_POST_VARS['ftp_path'] : ''; ! $ftp_user = (!empty($HTTP_POST_VARS['ftp_user'])) ? $HTTP_POST_VARS['ftp_user'] : ''; ! $ftp_pass = (!empty($HTTP_POST_VARS['ftp_pass'])) ? $HTTP_POST_VARS['ftp_pass'] : ''; ! if (isset($HTTP_POST_VARS['lang']) && preg_match('#^[a-z_]+$#', $HTTP_POST_VARS['lang'])) { ! $language = strip_tags($HTTP_POST_VARS['lang']); } else --- 366,392 ---- } ! $upgrade = (!empty($_POST['upgrade'])) ? $_POST['upgrade']: ''; ! $upgrade_now = (!empty($_POST['upgrade_now'])) ? $_POST['upgrade_now']:''; ! $dbms = isset($_POST['dbms']) ? $_POST['dbms'] : ''; ! $dbhost = (!empty($_POST['dbhost'])) ? $_POST['dbhost'] : 'localhost'; ! $dbuser = (!empty($_POST['dbuser'])) ? $_POST['dbuser'] : ''; ! $dbpasswd = (!empty($_POST['dbpasswd'])) ? $_POST['dbpasswd'] : ''; ! $dbname = (!empty($_POST['dbname'])) ? $_POST['dbname'] : ''; ! $table_prefix = (!empty($_POST['prefix'])) ? $_POST['prefix'] : ''; ! $admin_name = (!empty($_POST['admin_name'])) ? $_POST['admin_name'] : ''; ! $admin_pass1 = (!empty($_POST['admin_pass1'])) ? $_POST['admin_pass1'] : ''; ! $admin_pass2 = (!empty($_POST['admin_pass2'])) ? $_POST['admin_pass2'] : ''; ! $ftp_path = (!empty($_POST['ftp_path'])) ? $_POST['ftp_path'] : ''; ! $ftp_user = (!empty($_POST['ftp_user'])) ? $_POST['ftp_user'] : ''; ! $ftp_pass = (!empty($_POST['ftp_pass'])) ? $_POST['ftp_pass'] : ''; ! if (isset($_POST['lang']) && preg_match('#^[a-z_]+$#', $_POST['lang'])) { ! $language = strip_tags($_POST['lang']); } else *************** *** 395,415 **** } ! $board_email = (!empty($HTTP_POST_VARS['board_email'])) ? $HTTP_POST_VARS['board_email'] : ''; ! $script_path = (!empty($HTTP_POST_VARS['script_path'])) ? $HTTP_POST_VARS['script_path'] : str_replace('install', '', dirname($HTTP_SERVER_VARS['PHP_SELF'])); ! if (!empty($HTTP_POST_VARS['server_name'])) { ! $server_name = $HTTP_POST_VARS['server_name']; } else { // Guess at some basic info used for install.. ! if (!empty($HTTP_SERVER_VARS['SERVER_NAME']) || !empty($HTTP_ENV_VARS['SERVER_NAME'])) { ! $server_name = (!empty($HTTP_SERVER_VARS['SERVER_NAME'])) ? $HTTP_SERVER_VARS['SERVER_NAME'] : $HTTP_ENV_VARS['SERVER_NAME']; } ! else if (!empty($HTTP_SERVER_VARS['HTTP_HOST']) || !empty($HTTP_ENV_VARS['HTTP_HOST'])) { ! $server_name = (!empty($HTTP_SERVER_VARS['HTTP_HOST'])) ? $HTTP_SERVER_VARS['HTTP_HOST'] : $HTTP_ENV_VARS['HTTP_HOST']; } else --- 395,415 ---- } ! $board_email = (!empty($_POST['board_email'])) ? $_POST['board_email'] : ''; ! $script_path = (!empty($_POST['script_path'])) ? $_POST['script_path'] : str_replace('install', '', dirname($_SERVER['PHP_SELF'])); ! if (!empty($_POST['server_name'])) { ! $server_name = $_POST['server_name']; } else { // Guess at some basic info used for install.. ! if (!empty($_SERVER['SERVER_NAME']) || !empty($_ENV['SERVER_NAME'])) { ! $server_name = (!empty($_SERVER['SERVER_NAME'])) ? $_SERVER['SERVER_NAME'] : $_ENV['SERVER_NAME']; } ! else if (!empty($_SERVER['HTTP_HOST']) || !empty($_ENV['HTTP_HOST'])) { ! $server_name = (!empty($_SERVER['HTTP_HOST'])) ? $_SERVER['HTTP_HOST'] : $_ENV['HTTP_HOST']; } else *************** *** 419,431 **** } ! if (!empty($HTTP_POST_VARS['server_port'])) { ! $server_port = $HTTP_POST_VARS['server_port']; } else { ! if (!empty($HTTP_SERVER_VARS['SERVER_PORT']) || !empty($HTTP_ENV_VARS['SERVER_PORT'])) { ! $server_port = (!empty($HTTP_SERVER_VARS['SERVER_PORT'])) ? $HTTP_SERVER_VARS['SERVER_PORT'] : $HTTP_ENV_VARS['SERVER_PORT']; } else --- 419,431 ---- } ! if (!empty($_POST['server_port'])) { ! $server_port = $_POST['server_port']; } else { ! if (!empty($_SERVER['SERVER_PORT']) || !empty($_ENV['SERVER_PORT'])) { ! $server_port = (!empty($_SERVER['SERVER_PORT'])) ? $_SERVER['SERVER_PORT'] : $_ENV['SERVER_PORT']; } else *************** *** 461,465 **** // What do we need to do? ! if (!empty($HTTP_POST_VARS['send_file']) && $HTTP_POST_VARS['send_file'] == 1 && empty($HTTP_POST_VARS['upgrade_now'])) { header('Content-Type: text/x-delimtext; name="config.' . $phpEx . '"'); --- 461,465 ---- // What do we need to do? ! if (!empty($_POST['send_file']) && $_POST['send_file'] == 1 && empty($_POST['upgrade_now'])) { header('Content-Type: text/x-delimtext; name="config.' . $phpEx . '"'); *************** *** 469,479 **** // because we add slashes at the top if its off, and they are added automaticlly // if it is on. ! echo stripslashes($HTTP_POST_VARS['config_data']); exit; } ! else if (!empty($HTTP_POST_VARS['send_file']) && $HTTP_POST_VARS['send_file'] == 2) { ! $s_hidden_fields = '<input type="hidden" name="config_data" value="' . htmlspecialchars(stripslashes($HTTP_POST_VARS['config_data'])) . '" />'; $s_hidden_fields .= '<input type="hidden" name="ftp_file" value="1" />'; --- 469,479 ---- // because we add slashes at the top if its off, and they are added automaticlly // if it is on. ! echo stripslashes($_POST['config_data']); exit; } ! else if (!empty($_POST['send_file']) && $_POST['send_file'] == 2) { ! $s_hidden_fields = '<input type="hidden" name="config_data" value="' . htmlspecialchars(stripslashes($_POST['config_data'])) . '" />'; $s_hidden_fields .= '<input type="hidden" name="ftp_file" value="1" />'; *************** *** 508,512 **** } ! else if (!empty($HTTP_POST_VARS['ftp_file'])) { // Try to connect ... --- 508,512 ---- } ! else if (!empty($_POST['ftp_file'])) { // Try to connect ... *************** *** 519,523 **** // Error couldn't get connected... Go back to option to send file... ! $s_hidden_fields = '<input type="hidden" name="config_data" value="' . htmlspecialchars(stripslashes($HTTP_POST_VARS['config_data'])) . '" />'; $s_hidden_fields .= '<input type="hidden" name="send_file" value="1" />'; --- 519,523 ---- // Error couldn't get connected... Go back to option to send file... ! $s_hidden_fields = '<input type="hidden" name="config_data" value="' . htmlspecialchars(stripslashes($_POST['config_data'])) . '" />'; $s_hidden_fields .= '<input type="hidden" name="send_file" value="1" />'; *************** *** 560,564 **** $fp = @fopen($tmpfname, 'w'); ! @fwrite($fp, stripslashes($HTTP_POST_VARS['config_data'])); @fclose($fp); --- 560,564 ---- $fp = @fopen($tmpfname, 'w'); ! @fwrite($fp, stripslashes($_POST['config_data'])); @fclose($fp); *************** *** 606,611 **** if (!empty($install_step)) { ! if ((($HTTP_POST_VARS['admin_pass1'] != $HTTP_POST_VARS['admin_pass2'])) || ! (empty($HTTP_POST_VARS['admin_pass1']) || empty($dbhost)) && $HTTP_POST_VARS['cur_lang'] == $language) { $error = $lang['Password_mismatch']; --- 606,611 ---- if (!empty($install_step)) { ! if ((($_POST['admin_pass1'] != $_POST['admin_pass2'])) || ! (empty($_POST['admin_pass1']) || empty($dbhost)) && $_POST['cur_lang'] == $language) { $error = $lang['Password_mismatch']; Index: upgrade.php =================================================================== RCS file: /cvsroot/phpbb-php5mod/phpbb-php5/install/upgrade.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** upgrade.php 29 Jul 2004 22:36:20 -0000 1.1 --- upgrade.php 30 Jul 2004 02:12:39 -0000 1.2 *************** *** 398,402 **** // Start at the beginning if the user hasn't specified a specific starting point. // ! $next = ( isset($HTTP_GET_VARS['next']) ) ? $HTTP_GET_VARS['next'] : 'start'; // If debug is set we'll do all steps in one go. --- 398,402 ---- // Start at the beginning if the user hasn't specified a specific starting point. // ! $next = ( isset($_GET['next']) ) ? $_GET['next'] : 'start'; // If debug is set we'll do all steps in one go. *************** *** 1879,1883 **** $per_percent = round(( $totalposts / 500 ) * 10); ! $postcounter = ( !isset($HTTP_GET_VARS['batchstart']) ) ? 0 : $HTTP_GET_VARS['batchstart']; $batchsize = 150; // Process this many posts per loop --- 1879,1883 ---- $per_percent = round(( $totalposts / 500 ) * 10); ! $postcounter = ( !isset($_GET['batchstart']) ) ? 0 : $_GET['batchstart']; $batchsize = 150; // Process this many posts per loop |