break; } else { $gl_path = substr($gl_path, 0, -strlen($remains)); } } $_CONF['path'] = $gl_path; } else { // TODO: Remove all references to $gl_path and use $_CONF['path'] for consistency. $gl_path = $_CONF['path']; } $dbconfig_path = isset($_POST['dbconfig_path']) ? $_POST['dbconfig_path'] : (isset($_GET['dbconfig_path']) ? $_GET['dbconfig_path'] : $gl_path . '/db-config.php'); $dbconfig_path = INST_sanitizePath($dbconfig_path); $step = isset($_GET['step']) ? $_GET['step'] : (isset($_POST['step']) ? $_POST['step'] : 1); $backup_dir = $_CONF['path'] . 'backups/'; // $display holds all the outputted HTML and content $display = INST_getHeader($LANG_MIGRATE[17]); // Grab the beginning HTML for the installer theme. // Make sure the version of PHP is supported. if (INST_phpOutOfDate()) { // If their version of PHP is not supported, print an error: $display .= '<h1>' . sprintf($LANG_INSTALL[4], SUPPORTED_PHP_VER) . '</h1>' . LB; $display .= '<p>' . sprintf($LANG_INSTALL[5], SUPPORTED_PHP_VER) . $phpv[0] . '.' . $phpv[1] . '.' . (int) $phpv[2] . $LANG_INSTALL[6] . '</p>' . LB; } else { // Ok, the user's version of PHP is supported. Let's move on switch ($step) { /** * Page 1 - Form for user to enter their database and path information * and to select a database backup file from the backups directory * or upload a backup from their computer. */ case 1:
echo $output; die(1); } // this is not ideal but will stop PHP 5.3.0ff from complaining ... $system_timezone = @date_default_timezone_get(); date_default_timezone_set($system_timezone); $_REQUEST = array_merge($_GET, $_POST); // Before we begin, check if an uploaded file exceeds PHP's post_max_size if (isset($_SERVER['CONTENT_LENGTH'])) { // This code is thanks to v3 AT sonic-world DOT ru via PHP.net $POST_MAX_SIZE = ini_get('post_max_size'); $mul = substr($POST_MAX_SIZE, -1); $mul = $mul == 'M' ? 1048576 : ($mul == 'K' ? 1024 : ($mul == 'G' ? 1073741824 : 1)); if ($_SERVER['CONTENT_LENGTH'] > $mul * (int) $POST_MAX_SIZE && $POST_MAX_SIZE) { // If it does, display an error message $display = INST_getHeader($LANG_ERROR[8]) . INST_getAlertMsg($LANG_ERROR[7]) . INST_getFooter(); die($display); } } // +---------------------------------------------------------------------------+ // | Functions | // +---------------------------------------------------------------------------+ /** * Returns the beginning HTML for the installer theme. * * @param $mHeading Heading * @return string Header HTML code * */ function INST_getHeader($mHeading) {
$db_connection_charset = preg_replace('/[^a-z0-9\\-_]/', '', $_REQUEST['db_connection_charset']); } // ******************************************************************************************* // If not familiar with PHP please don't change anything below this line // ******************************************************************************************* //define ('VERSION','0.29b'); define('DATA_CHUNK_LENGTH', 16384); // How many chars are read per time define('MAX_QUERY_LINES', 300); // How many lines may be considered to be one query (except text lines) define('TESTMODE', false); // Set to true to process the file without actually accessing the database @ini_set('auto_detect_line_endings', true); @set_time_limit(0); header('Content-Type: text/html; charset=' . $LANG_CHARSET); echo INST_getHeader($LANG_MIGRATE[17]); $error = false; $file = false; // Get the current directory if (isset($_SERVER["CGIA"])) { $upload_dir = dirname($_SERVER["CGIA"]); } else { if (isset($_SERVER["ORIG_PATH_TRANSLATED"])) { $upload_dir = dirname($_SERVER["ORIG_PATH_TRANSLATED"]); } else { if (isset($_SERVER["ORIG_SCRIPT_FILENAME"])) { $upload_dir = dirname($_SERVER["ORIG_SCRIPT_FILENAME"]); } else { if (isset($_SERVER["PATH_TRANSLATED"])) { $upload_dir = dirname($_SERVER["PATH_TRANSLATED"]); } else {
if ($remains === false) { break; } else { $gl_path = substr($gl_path, 0, -strlen($remains)); } } $_CONF['path'] = $gl_path; } else { // TODO: Remove all references to $gl_path and use $_CONF['path'] for consistency. $gl_path = $_CONF['path']; } $dbconfig_path = isset($_POST['dbconfig_path']) ? $_POST['dbconfig_path'] : (isset($_GET['dbconfig_path']) ? $_GET['dbconfig_path'] : $gl_path . '/db-config.php'); $dbconfig_path = INST_sanitizePath($dbconfig_path); $step = isset($_GET['step']) ? $_GET['step'] : (isset($_POST['step']) ? $_POST['step'] : 1); // $display holds all the outputted HTML and content $display = INST_getHeader($LANG_PLUGINS[2] . ' 3 - ' . $LANG_PLUGINS[1]); // Grab the beginning HTML for the installer theme. // Make sure the version of PHP is supported. if (INST_phpOutOfDate()) { // If their version of PHP is not supported, print an error: $display .= '<h1>' . sprintf($LANG_INSTALL[4], SUPPORTED_PHP_VER) . '</h1>' . LB; $display .= '<p>' . sprintf($LANG_INSTALL[5], SUPPORTED_PHP_VER) . $phpv[0] . '.' . $phpv[1] . '.' . (int) $phpv[2] . $LANG_INSTALL[6] . '</p>' . LB; } else { // Ok, the user's version of PHP is supported. Let's move on switch ($step) { /** * Step 1 - Display the upload form and allow * the user to select which plugins to install */ case 1: // If 'file_uploads' is enabled in php.ini and the plugin directories are writable by the web server.