From 5328c92edf2fabbfa71ed2c3eadfe66f12efab8d Mon Sep 17 00:00:00 2001 From: Sama34 Date: Thu, 13 Jun 2024 00:14:42 -0700 Subject: [PATCH 01/11] Fix several PHP8 deprecated issues --- boards/bbpress.php | 2 +- boards/ipb3/polls.php | 2 +- boards/vbulletin3/privatemessages.php | 6 ++++-- boards/vbulletin4/privatemessages.php | 6 ++++-- boards/vbulletin5/privatemessages.php | 6 ++++-- loginconvert.php | 12 ++++++++++-- resources/functions.php | 12 ++++++++---- 7 files changed, 32 insertions(+), 14 deletions(-) diff --git a/boards/bbpress.php b/boards/bbpress.php index 8fc9de3..56cbcdf 100644 --- a/boards/bbpress.php +++ b/boards/bbpress.php @@ -97,7 +97,7 @@ class BBPRESS_Converter extends Converter * @param string $gids A serialized list of original roles * @return string group id(s) */ - function get_group_id($gids) + function get_group_id($gids, $remove=array()) { // bbPress saves roles as ["name" => true] $roles = array_keys(unserialize($gids)); diff --git a/boards/ipb3/polls.php b/boards/ipb3/polls.php index 633d8f7..7c81e39 100644 --- a/boards/ipb3/polls.php +++ b/boards/ipb3/polls.php @@ -44,7 +44,7 @@ function convert_data($data) $insert_data['import_tid'] = $data['tid']; $insert_data['import_pid'] = $data['pid']; $insert_data['tid'] = $this->get_import->tid($data['tid']); - $choices = unserialize(utf8_decode($data['choices'])); + $choices = unserialize(mb_convert_encoding($data['choices'], 'ISO-8859-1', 'UTF-8')); $choices = $choices[1]; $seperator = ''; diff --git a/boards/vbulletin3/privatemessages.php b/boards/vbulletin3/privatemessages.php index fad704c..ff897f6 100644 --- a/boards/vbulletin3/privatemessages.php +++ b/boards/vbulletin3/privatemessages.php @@ -60,8 +60,10 @@ function convert_data($data) // However afterwards we need to properly encode all elements again, otherwise we'd get other issues again if(!is_array($touserarray)) { - $touserarray = unserialize(utf8_decode($data['touserarray'])); - array_walk_recursive($touserarray, create_function('&$value, $key', '$value = utf8_encode($value);')); + $touserarray = unserialize(mb_convert_encoding($data['touserarray'], 'ISO-8859-1', 'UTF-8')); + array_walk_recursive($touserarray, function (&$value, &$key) { + $value = mb_convert_encoding($value, 'UTF-8', 'ISO-8859-1'); + }); } // This is the original check in vB diff --git a/boards/vbulletin4/privatemessages.php b/boards/vbulletin4/privatemessages.php index c48e90b..2ff214d 100644 --- a/boards/vbulletin4/privatemessages.php +++ b/boards/vbulletin4/privatemessages.php @@ -60,8 +60,10 @@ function convert_data($data) // However afterwards we need to properly encode all elements again, otherwise we'd get other issues again if(!is_array($touserarray)) { - $touserarray = unserialize(utf8_decode($data['touserarray'])); - array_walk_recursive($touserarray, create_function('&$value, $key', '$value = utf8_encode($value);')); + $touserarray = unserialize(mb_convert_encoding($data['touserarray'], 'ISO-8859-1', 'UTF-8')); + array_walk_recursive($touserarray, function (&$value, &$key) { + $value = mb_convert_encoding($value, 'UTF-8', 'ISO-8859-1'); + }); } // This is the original check in vB diff --git a/boards/vbulletin5/privatemessages.php b/boards/vbulletin5/privatemessages.php index 6757aa5..5a22ddb 100644 --- a/boards/vbulletin5/privatemessages.php +++ b/boards/vbulletin5/privatemessages.php @@ -60,8 +60,10 @@ function convert_data($data) // However afterwards we need to properly encode all elements again, otherwise we'd get other issues again if(!is_array($touserarray)) { - $touserarray = unserialize(utf8_decode($data['touserarray'])); - array_walk_recursive($touserarray, create_function('&$value, $key', '$value = utf8_encode($value);')); + $touserarray = unserialize(mb_convert_encoding($data['touserarray'], 'ISO-8859-1', 'UTF-8')); + array_walk_recursive($touserarray, function (&$value, &$key) { + $value = mb_convert_encoding($value, 'UTF-8', 'ISO-8859-1'); + }); } // This is the original check in vB diff --git a/loginconvert.php b/loginconvert.php index aa58bdb..40994e8 100644 --- a/loginconvert.php +++ b/loginconvert.php @@ -160,9 +160,12 @@ function loginconvert_convert(&$login) $check = $function($login->data['password'], $user); // If the password was wrong, an utf8 password and we want to check utf8 passwords we call the function again - if(!$check && in_array($login_type, $utf8_recheck) && utf8_decode($login->data['password']) != $login->data['password']) + if(!$check && in_array($login_type, $utf8_recheck) && mb_convert_encoding( + $login->data['password'], + 'ISO-8859-1', + 'UTF-8') !== $login->data['password']) { - $check = $function(utf8_decode($login->data['password']), $user); + $check = $function(mb_convert_encoding($login->data['password'], 'ISO-8859-1', 'UTF-8'), $user); } if(!$check) @@ -331,6 +334,11 @@ function check_punbb($password, $user) { return true; } + elseif(function_exists('hash') && $is_sha1 && (hash('sha1', $password) === $user['passwordconvert'] || hash('sha1', $user['passwordconvertsalt'].hash('sha1', $password)) === $user['passwordconvert'])) + { + return true; + } + // mhash() is deprecated as of PHP8.1 elseif(function_exists('mhash') && $is_sha1 && (bin2hex(mhash(MHASH_SHA1, $password)) == $user['passwordconvert'] || bin2hex(mhash(MHASH_SHA1, $user['passwordconvertsalt'].bin2hex(mhash(MHASH_SHA1, $password)))) == $user['passwordconvert'])) { return true; diff --git a/resources/functions.php b/resources/functions.php index 6a3a83c..a7b805e 100644 --- a/resources/functions.php +++ b/resources/functions.php @@ -459,12 +459,12 @@ function encode_to_utf8($text, $old_table_name, $new_table_name) { if(!function_exists('iconv')) { - if(fetch_iconv_encoding($import_session['table_charset_old'][$old_table_name]) != 'iso-8859-1' || !function_exists("utf8_encode")) + if(fetch_iconv_encoding($import_session['table_charset_old'][$old_table_name]) != 'iso-8859-1' || !function_exists("mb_convert_encoding")) { return $text; } - return utf8_encode($text); + return mb_convert_encoding($text, 'UTF-8', 'ISO-8859-1'); } $converted_str = iconv(fetch_iconv_encoding($import_session['table_charset_old'][$old_table_name]), fetch_iconv_encoding($import_session['table_charset_new'][$new_table_name]).'//TRANSLIT', $text); @@ -781,8 +781,12 @@ function htmlspecialchars_decode($text) function utf8_unhtmlentities($string) { // Replace numeric entities - $string = preg_replace_callback('~&#x([0-9a-f]+);~i', create_function('$matches', 'return unichr(hexdec($matches[1]));'), $string); - $string = preg_replace_callback('~&#([0-9]+);~', create_function('$matches', 'return unichr($matches[1]);'), $string); + $string = preg_replace_callback('~&#x([0-9a-f]+);~i', function($matches) { + return unichr(hexdec($matches[1])); + }, $string); + $string = preg_replace_callback('~&#([0-9]+);~', function($matches) { + return unichr($matches[1]); + }, $string); // Replace literal entities $trans_tbl = get_html_translation_table(HTML_ENTITIES); From b5665650d760251c1bf0ab62793a4303d7977cd8 Mon Sep 17 00:00:00 2001 From: Sama34 Date: Mon, 12 Aug 2024 17:15:31 -0700 Subject: [PATCH 02/11] Fix undefined array key for inputs --- boards/wbb3.php | 2 +- boards/wbb4.php | 2 +- index.php | 58 +++++++++++++++---------------- resources/class_converter.php | 30 ++++++++-------- resources/modules/attachments.php | 8 ++--- resources/modules/avatars.php | 8 ++--- resources/output.php | 18 +++++----- 7 files changed, 63 insertions(+), 63 deletions(-) diff --git a/boards/wbb3.php b/boards/wbb3.php index d2ec81a..a4e459d 100644 --- a/boards/wbb3.php +++ b/boards/wbb3.php @@ -151,7 +151,7 @@ function db_extra() - input['installationnumber'])."\" /> + get_input('installationnumber'))."\" /> "; diff --git a/boards/wbb4.php b/boards/wbb4.php index 2920cf6..d5bb2ff 100644 --- a/boards/wbb4.php +++ b/boards/wbb4.php @@ -151,7 +151,7 @@ function db_extra() - input['installationnumber'])."\" /> + get_input('installationnumber'))."\" /> "; diff --git a/index.php b/index.php index 2f9922b..96ef28c 100644 --- a/index.php +++ b/index.php @@ -188,20 +188,20 @@ $start_timer = microtime(true); // Get the import session cache if exists -$import_session = $cache->read("import_cache", 1); +$import_session = $cache->read("import_cache", true); // Setup our arrays if they don't exist yet -if(!$import_session['resume_module']) +if(empty($import_session['resume_module'])) { $import_session['resume_module'] = array(); } -if(!$import_session['disabled']) +if(empty($import_session['disabled'])) { $import_session['disabled'] = array(); } -if(!$import_session['resume_module']) +if(empty($import_session['resume_module'])) { $import_session['resume_module'] = array(); } @@ -278,10 +278,10 @@ $year = gmdate("Y"); - $debug->log->trace2("Generating report in {$mybb->input['reportgen']} format"); + $debug->log->trace2("Generating report in {$mybb->get_input('reportgen')} format"); // Did we request it in plain txt format? - if($mybb->input['reportgen'] == "txt") + if($mybb->get_input('reportgen') == "txt") { $ext = "txt"; $mime = "text/plain"; @@ -386,7 +386,7 @@ } // Ah, our users requests our pretty html format! - if($mybb->input['reportgen'] == "html") + if($mybb->get_input('reportgen') == "html") { $ext = "html"; $mime = "text/html"; @@ -502,7 +502,7 @@ // The Report Generations are run right above this piece of code which we "exit;" before we reach this code so we don't clear out // our statistics we've got saved. This will only run the next time someone visits the merge system script after we visit the // 'finished' page and we're not downloading a report for the last merge. -if($import_session['finished_convert'] == '1') +if(!empty($import_session['finished_convert'])) { $debug->log->event("Running import session cleanup"); @@ -511,23 +511,23 @@ update_import_session(); } -if($mybb->input['board']) +if($mybb->get_input('board')) { - $debug->log->event("Setting up board merge classes: {$mybb->input['board']}"); + $debug->log->event("Setting up board merge classes: {$mybb->get_input('board')}"); // Sanatize and check if it exists. - $mybb->input['board'] = str_replace(".", "", $mybb->input['board']); + $mybb->input['board'] = str_replace(".", "", $mybb->get_input('board')); - $debug->log->trace1("Loading board module {$mybb->input['board']}"); + $debug->log->trace1("Loading board module {$mybb->get_input('board')}"); - if(!file_exists(MERGE_ROOT."boards/".$mybb->input['board'].".php")) + if(!file_exists(MERGE_ROOT."boards/".$mybb->get_input('board').".php")) { $output->print_error($lang->error_invalid_board); } // Get the converter up. - require_once MERGE_ROOT."boards/{$mybb->input['board']}.php"; - $class_name = strtoupper($mybb->input['board'])."_Converter"; + require_once MERGE_ROOT."boards/{$mybb->get_input('board')}.php"; + $class_name = strtoupper($mybb->get_input('board'))."_Converter"; $board = new $class_name; @@ -556,7 +556,7 @@ echo $lang->loginconvert_message; - echo " input['board'])."\" />"; + echo " get_input('board'))."\" />"; $output->print_footer(); } @@ -573,13 +573,13 @@ } // Save it to the import session so we don't have to carry it around in the url/source. - $import_session['board'] = $mybb->input['board']; + $import_session['board'] = $mybb->get_input('board'); } // Did we just start running a specific module (user import, thread import, post import, etc) -if($mybb->input['module']) +if($mybb->get_input('module')) { - $debug->log->event("Setting up board module specific classes: {$mybb->input['module']}"); + $debug->log->event("Setting up board module specific classes: {$mybb->get_input('module')}"); // Set our $resume_module variable to the last module we were working on (if there is one) // incase we come back to it at a later time. @@ -591,11 +591,11 @@ } // Save our new module we're working on to the import session - $import_session['module'] = $mybb->input['module']; + $import_session['module'] = $mybb->get_input('module'); } // Otherwise show them the agreement and ask them to agree to it to continue. -if(!$import_session['first_page'] && !$mybb->input['first_page']) +if(!$import_session['first_page'] && empty($mybb->input['first_page'])) { $debug->log->event("Showing first agreement/welcome page"); @@ -622,7 +622,7 @@ // Did we just pass the requirements check? -if($mybb->input['requirements_check'] == 1 && $import_session['requirements_pass'] == 1 && $mybb->request_method == "post") +if(isset($mybb->input['requirements_check']) && $import_session['requirements_pass'] == 1 && $mybb->request_method == "post") { $debug->log->event("Passed requirements check"); @@ -632,15 +632,15 @@ update_import_session(); } // Otherwise show our requirements check to our user -else if(!$import_session['requirements_check'] || ($mybb->input['first_page'] == 1 && $mybb->request_method == "post") || !$import_session['requirements_pass']) +else if(!$import_session['requirements_check'] || (!empty($mybb->input['first_page']) && $mybb->request_method == "post") || !$import_session['requirements_pass']) { $debug->log->event("Showing requirements check page"); - $import_session['allow_anonymous_info'] = intval($mybb->input['allow_anonymous_info']); + $import_session['allow_anonymous_info'] = $mybb->get_input('allow_anonymous_info', \MyBB::INPUT_INT); $import_session['first_page'] = 1; // We should close the board - which shouldn't be necessary if they would do the merge locally... - if((int)$mybb->input['close_board'] == 1) + if($mybb->get_input('close_board', \MyBB::INPUT_INT) == 1) { $db->update_query("settings", array("value" => 1), "name='boardclosed'"); rebuild_settings(); @@ -747,7 +747,7 @@ $output->board_list(); } // Show the completion page -elseif(isset($mybb->input['action']) && $mybb->input['action'] == 'completed') +elseif($mybb->get_input('action') == 'completed') { $debug->log->event("Show the merge competion page"); @@ -758,7 +758,7 @@ $output->finish_conversion(); } // Perhaps we have selected to stop converting or we are actually finished -elseif(isset($mybb->input['action']) && $mybb->input['action'] == 'finish') +elseif($mybb->get_input('action') == 'finish') { $debug->log->event("Show the merge cleanup page"); @@ -912,7 +912,7 @@ exit; } // Otherwise that means we've selected a module to run or we're in one -elseif($import_session['module'] && $mybb->input['action'] != 'module_list') +elseif($import_session['module'] && $mybb->get_input('action') != 'module_list') { $debug->log->event("Running a specific module"); @@ -968,7 +968,7 @@ // Get number of posts per screen from the form if it was just submitted if(isset($mybb->input[$module_name.'_per_screen'])) { - $import_session[$module_name.'_per_screen'] = intval($mybb->input[$module_name.'_per_screen']); + $import_session[$module_name.'_per_screen'] = $mybb->get_input($module_name.'_per_screen', \MyBB::INPUT_INT); // This needs to be here so if we "Pause" (aka terminate script execution) our "per screen" amount will still be saved update_import_session(); diff --git a/resources/class_converter.php b/resources/class_converter.php index 340c031..bd5e033 100644 --- a/resources/class_converter.php +++ b/resources/class_converter.php @@ -192,24 +192,24 @@ function db_configuration() global $mybb, $output, $import_session, $tableprefix, $lang; // Just posted back to this form? - if($mybb->input['dbengine']) + if($mybb->get_input('dbengine')) { - $config_data = $mybb->input['config'][$mybb->input['dbengine']]; + $config_data = $mybb->input['config'][$mybb->get_input('dbengine')]; - if(strstr($mybb->input['dbengine'], "sqlite") !== false && (strstr($config_data['dbname'], "./") !== false || strstr($config_data['dbname'], "../") !== false)) + if(strstr($mybb->get_input('dbengine'), "sqlite") !== false && (strstr($config_data['dbname'], "./") !== false || strstr($config_data['dbname'], "../") !== false)) { $errors[] = $lang->error_database_relative; } - else if(!file_exists(MYBB_ROOT."inc/db_{$mybb->input['dbengine']}.php")) + else if(!file_exists(MYBB_ROOT."inc/db_{$mybb->get_input('dbengine')}.php")) { $errors[] = $lang->error_database_invalid_engine; } else { // Attempt to connect to the db - require_once MYBB_ROOT."inc/db_{$mybb->input['dbengine']}.php"; + require_once MYBB_ROOT."inc/db_{$mybb->get_input('dbengine')}.php"; - switch($mybb->input['dbengine']) + switch($mybb->get_input('dbengine')) { case "sqlite": $this->old_db = new DB_SQLite; @@ -231,7 +231,7 @@ function db_configuration() } $this->old_db->error_reporting = 0; - $connect_config['type'] = $mybb->input['dbengine']; + $connect_config['type'] = $mybb->get_input('dbengine'); $connect_config['database'] = $config_data['dbname']; $connect_config['table_prefix'] = $config_data['tableprefix']; $connect_config['hostname'] = $config_data['dbhost']; @@ -266,14 +266,14 @@ function db_configuration() echo "
\n{$lang->database_check_success}

\n"; flush(); - $import_session['old_db_engine'] = $mybb->input['dbengine']; + $import_session['old_db_engine'] = $mybb->get_input('dbengine'); $import_session['old_db_host'] = $config_data['dbhost']; $import_session['old_db_user'] = $config_data['dbuser']; $import_session['old_db_pass'] = $config_data['dbpass']; $import_session['old_db_name'] = $config_data['dbname']; $import_session['old_tbl_prefix'] = $config_data['tableprefix']; $import_session['connect_config'] = serialize($connect_config); - $import_session['encode_to_utf8'] = intval($mybb->input['encode_to_utf8']); + $import_session['encode_to_utf8'] = $mybb->get_input('encode_to_utf8', \MyBB::INPUT_INT); // Create temporary import data fields create_import_fields(); @@ -316,11 +316,11 @@ function db_configuration() if($import_session['old_db_host']) { - $mybb->input['config'][$mybb->input['dbengine']]['dbhost'] = $import_session['old_db_host']; + $mybb->input['config'][$mybb->get_input('dbengine')]['dbhost'] = $import_session['old_db_host']; } else { - $mybb->input['config'][$mybb->input['dbengine']]['dbhost'] = 'localhost'; + $mybb->input['config'][$mybb->get_input('dbengine')]['dbhost'] = 'localhost'; } if($import_session['old_tbl_prefix']) @@ -343,20 +343,20 @@ function db_configuration() if($import_session['old_db_user']) { - $mybb->input['config'][$mybb->input['dbengine']]['dbuser'] = $import_session['old_db_user']; + $mybb->input['config'][$mybb->get_input('dbengine')]['dbuser'] = $import_session['old_db_user']; } else { - $mybb->input['config'][$mybb->input['dbengine']]['dbuser'] = ''; + $mybb->input['config'][$mybb->get_input('dbengine')]['dbuser'] = ''; } if($import_session['old_db_name']) { - $mybb->input['config'][$mybb->input['dbengine']]['dbname'] = $import_session['old_db_name']; + $mybb->input['config'][$mybb->get_input('dbengine')]['dbname'] = $import_session['old_db_name']; } else { - $mybb->input['config'][$mybb->input['dbengine']]['dbname'] = ''; + $mybb->input['config'][$mybb->get_input('dbengine')]['dbname'] = ''; } } diff --git a/resources/modules/attachments.php b/resources/modules/attachments.php index 2aad870..ba90c7c 100644 --- a/resources/modules/attachments.php +++ b/resources/modules/attachments.php @@ -183,22 +183,22 @@ public function test_readability() $this->debug->log->trace0("Checking readability of attachments from specified path"); - if($mybb->input['uploadspath']) + if($mybb->get_input('uploadspath')) { - $import_session['uploadspath'] = $mybb->input['uploadspath']; + $import_session['uploadspath'] = $mybb->get_input('uploadspath'); if(!empty($import_session['uploadspath']) && my_substr($import_session['uploadspath'], -1) != '/') { $import_session['uploadspath'] .= '/'; } } - if(strpos($mybb->input['uploadspath'], "localhost") !== false) + if(strpos($mybb->get_input('uploadspath'), "localhost") !== false) { $this->errors[] = "

{$lang->attmodule_ipadress}

"; $import_session['uploads_test'] = 0; } - if(strpos($mybb->input['uploadspath'], "127.0.0.1") !== false) + if(strpos($mybb->get_input('uploadspath'), "127.0.0.1") !== false) { $this->errors[] = "

{$lang->attmodule_ipadress2}

"; $import_session['uploads_test'] = 0; diff --git a/resources/modules/avatars.php b/resources/modules/avatars.php index 088c1ab..bb2f81d 100644 --- a/resources/modules/avatars.php +++ b/resources/modules/avatars.php @@ -148,22 +148,22 @@ public function test_readability() $this->debug->log->trace0("Checking readability of avatars from specified path"); - if($mybb->input['avatarspath']) + if($mybb->get_input('avatarspath')) { - $import_session['avatarspath'] = $mybb->input['avatarspath']; + $import_session['avatarspath'] = $mybb->get_input('avatarspath'); if(!empty($import_session['avatarspath']) && my_substr($import_session['avatarspath'], -1) != '/') { $import_session['avatarspath'] .= '/'; } } - if(strpos($mybb->input['avatarspath'], "localhost") !== false) + if(strpos($mybb->get_input('avatarspath'), "localhost") !== false) { $this->errors[] = "

{$lang->attmodule_ipadress}

"; $import_session['uploads_avatars_test'] = 0; } - if(strpos($mybb->input['avatarspath'], "127.0.0.1") !== false) + if(strpos($mybb->get_input('avatarspath'), "127.0.0.1") !== false) { $this->errors[] = "

{$lang->attmodule_ipadress2}

"; $import_session['uploads_avatars_test'] = 0; diff --git a/resources/output.php b/resources/output.php index 67e70f4..b542c86 100644 --- a/resources/output.php +++ b/resources/output.php @@ -485,7 +485,7 @@ function print_database_details_table($name, $extra="") // Loop through database engines foreach($dboptions as $dbfile => $dbtype) { - if($mybb->input['dbengine'] == $dbfile) + if($mybb->get_input('dbengine') == $dbfile) { $dbengines .= ""; } @@ -532,7 +532,7 @@ function updateDBSettings() $db = new $dbtype['class']; $encodings = $db->fetch_db_charsets(); - if(!$mybb->input['config'][$dbfile]['dbhost']) + if(!isset($mybb->input['config'][$dbfile]['dbhost'])) { $mybb->input['config'][$dbfile]['dbhost'] = "localhost"; } @@ -540,18 +540,18 @@ function updateDBSettings() { $mybb->input['config'][$dbfile]['tableprefix'] = "mybb_"; } - if(!$mybb->input['config'][$dbfile]['encoding']) + if(!isset($mybb->input['config'][$dbfile]['encoding'])) { $mybb->input['config'][$dbfile]['encoding'] = "utf8"; } $class = ''; - if(!isset($first) && !$mybb->input['dbengine']) + if(!isset($first) && !$mybb->get_input('dbengine')) { $mybb->input['dbengine'] = $dbfile; $first = true; } - if($dbfile == $mybb->input['dbengine']) + if($dbfile == $mybb->get_input('dbengine')) { $class = "_selected"; } @@ -643,7 +643,7 @@ function updateDBSettings() } $dbconfig = implode("", $db_info); - if($mybb->input['encode_to_utf8'] === 0) + if($mybb->get_input('encode_to_utf8', \MyBB::INPUT_INT) === 0) { $encoding_checked_no = "checked=\"checked\""; $encoding_checked_yes = ""; @@ -763,9 +763,9 @@ function print_footer($next_action="", $name="", $do_session=1, $override_form=f if($this->opened_form && $override_form != true) { - if($mybb->input['autorefresh'] == "yes" || $mybb->input['autorefresh'] == "no") + if($mybb->get_input('autorefresh') == "yes" || $mybb->get_input('autorefresh') == "no") { - $import_session['autorefresh'] = $mybb->input['autorefresh']; + $import_session['autorefresh'] = $mybb->get_input('autorefresh'); } if(defined("IN_MODULE") && IN_MODULE == 1) @@ -929,7 +929,7 @@ function print_per_screen_page($per_screen=10) '; $import_session['autorefresh'] = ""; - $mybb->input['autorefresh'] = "no"; + $mybb->get_input('autorefresh') = "no"; $print_screen_func = "print_{$module_name}_per_screen_page"; From b08e92a228f62c3db28a9d9f582acef769c347c8 Mon Sep 17 00:00:00 2001 From: Sama34 Date: Tue, 13 Aug 2024 03:20:22 -0700 Subject: [PATCH 03/11] Fix several PHP8 warnings --- index.php | 27 ++++++++++------ language/global.lang.php | 2 ++ resources/class_converter.php | 18 ++++++----- resources/class_debug.php | 18 +++++++++-- resources/class_error.php | 13 ++++++-- resources/functions.php | 34 +++++++++++++++++--- resources/modules/users.php | 4 ++- resources/output.php | 58 ++++++++++++++++++++++------------- 8 files changed, 124 insertions(+), 50 deletions(-) diff --git a/index.php b/index.php index 96ef28c..ff3b0e5 100644 --- a/index.php +++ b/index.php @@ -288,6 +288,7 @@ // Generate the list of all the modules we ran (Threads, Posts, Users, etc) $module_list = ""; + foreach($board->modules as $key => $module) { if(in_array($key, $import_session['completed'])) @@ -356,6 +357,8 @@ } } + $import_totals = ""; + // Generate the list of stats we have (Amount of threads imported, amount of posts imported, etc) foreach($import_stats as $key => $title) { @@ -391,6 +394,8 @@ $ext = "html"; $mime = "text/html"; + $module_list = ""; + // Generate the list of all the modules we ran (Threads, Posts, Users, etc) foreach($board->modules as $key => $module) { @@ -405,6 +410,8 @@ $module_list = "
  • {$lang->none}
  • \n"; } + $import_totals = ""; + // Generate the list of stats we have (Amount of threads imported, amount of posts imported, etc) foreach($import_stats as $key => $title) { @@ -562,7 +569,7 @@ } $plugins_cache = $cache->read("plugins", true); - $active_plugins = $plugins_cache['active']; + $active_plugins = isset($plugins_cache['active']) ? $plugins_cache['active'] : []; $active_plugins['loginconvert'] = "loginconvert"; @@ -583,9 +590,9 @@ // Set our $resume_module variable to the last module we were working on (if there is one) // incase we come back to it at a later time. - $resume_module = $import_session['module']; + $resume_module = isset($import_session['module']) ? $import_session['module'] : ''; - if(!array_search($import_session['module'], $import_session['resume_module'])) + if(isset($import_session['module']) && !array_search($import_session['module'], $import_session['resume_module'])) { $import_session['resume_module'][] = $resume_module; } @@ -595,7 +602,7 @@ } // Otherwise show them the agreement and ask them to agree to it to continue. -if(!$import_session['first_page'] && empty($mybb->input['first_page'])) +if(empty($import_session['first_page']) && empty($mybb->input['first_page'])) { $debug->log->event("Showing first agreement/welcome page"); @@ -632,7 +639,7 @@ update_import_session(); } // Otherwise show our requirements check to our user -else if(!$import_session['requirements_check'] || (!empty($mybb->input['first_page']) && $mybb->request_method == "post") || !$import_session['requirements_pass']) +else if(empty($import_session['requirements_check']) || (!empty($mybb->get_input('first_page')) && $mybb->request_method == "post") || !$import_session['requirements_pass']) { $debug->log->event("Showing requirements check page"); @@ -672,7 +679,7 @@ } } - // Uh oh, problemos mi amigo? + // Uh oh, problemas mi amigo? if(!$contents || !$latest_code) { $checks['version_check_status'] = ''.$lang->requirementspage_unabletocheck.''; @@ -741,7 +748,7 @@ } // If no board is selected then we show the main page where users can select a board -if(!$import_session['board']) +if(empty($import_session['board'])) { $debug->log->event("Show the board listing page"); $output->board_list(); @@ -912,7 +919,7 @@ exit; } // Otherwise that means we've selected a module to run or we're in one -elseif($import_session['module'] && $mybb->get_input('action') != 'module_list') +elseif(!empty($import_session['module']) && $mybb->get_input('action') != 'module_list') { $debug->log->event("Running a specific module"); @@ -981,7 +988,7 @@ update_import_session(); // Have we set our "per screen" amount yet? - if($import_session[$module_name.'_per_screen'] <= 0 || $module->is_errors) + if(isset($import_session[$module_name.'_per_screen']) && $import_session[$module_name.'_per_screen'] <= 0 || $module->is_errors) { // Print our header $output->print_header($module->board->modules[$import_session['module']]['name']); @@ -1072,7 +1079,7 @@ $debug->log->event("Show the module selection list page."); // Set the start date for the end report. - if(!$import_session['start_date']) + if(empty($import_session['start_date'])) { $import_session['start_date'] = time(); } diff --git a/language/global.lang.php b/language/global.lang.php index 89f6881..84444e9 100644 --- a/language/global.lang.php +++ b/language/global.lang.php @@ -29,6 +29,7 @@ $l['found_error'] = "Error Encountered"; $l['loading_data'] = "Loading data from database..."; $l['done'] = "Done"; +$l['size_mb'] = "MB"; // Modules, english names are hardcoded. Uncomment this for your language // Descriptions are added as "module_{key}_desc, however the current ones doesn't have a description @@ -246,6 +247,7 @@ $l['error_column_length_table'] = 'In the {1} table the following columns contain data that will be stripped'; $l['error_column_length'] = '- {1} (Maximum length: {2})'; +$l['loginconvert_header'] = "MyBB Merge System - Setup Password Conversion"; $l['loginconvert_title'] = "MyBB Merge System - Setup Password Conversion"; $l['loginconvert_message'] = "
    \n

    Error

    diff --git a/resources/class_converter.php b/resources/class_converter.php index bd5e033..e1d4c39 100644 --- a/resources/class_converter.php +++ b/resources/class_converter.php @@ -305,7 +305,7 @@ function db_configuration() else { echo "

    ".$lang->sprintf($lang->database_details, $this->plain_bbname)."

    "; - if($import_session['old_db_engine']) + if(!empty($import_session['old_db_engine'])) { $mybb->input['dbengine'] = $import_session['old_db_engine']; } @@ -314,7 +314,7 @@ function db_configuration() $mybb->input['dbengine'] = $mybb->config['database']['type']; } - if($import_session['old_db_host']) + if(!empty($import_session['old_db_host'])) { $mybb->input['config'][$mybb->get_input('dbengine')]['dbhost'] = $import_session['old_db_host']; } @@ -323,7 +323,7 @@ function db_configuration() $mybb->input['config'][$mybb->get_input('dbengine')]['dbhost'] = 'localhost'; } - if($import_session['old_tbl_prefix']) + if(!empty($import_session['old_tbl_prefix'])) { $tableprefix = $import_session['old_tbl_prefix']; } @@ -331,17 +331,19 @@ function db_configuration() { $tableprefix = $this->prefix_suggestion; } + // This looks probably odd, but we want that the table prefix is shown everywhere correctly foreach($this->supported_databases as $dbs) { $mybb->input['config'][$dbs]['tableprefix'] = $tableprefix; } + // Handling mysqli, mysql_pdo and pgsql_pdo separately. $mybb->input['config']["mysqli"]['tableprefix'] = $tableprefix; $mybb->input['config']["mysql_pdo"]['tableprefix'] = $tableprefix; $mybb->input['config']["pgsql_pdo"]['tableprefix'] = $tableprefix; - if($import_session['old_db_user']) + if(!empty($import_session['old_db_user'])) { $mybb->input['config'][$mybb->get_input('dbengine')]['dbuser'] = $import_session['old_db_user']; } @@ -350,7 +352,7 @@ function db_configuration() $mybb->input['config'][$mybb->get_input('dbengine')]['dbuser'] = ''; } - if($import_session['old_db_name']) + if(!empty($import_session['old_db_name'])) { $mybb->input['config'][$mybb->get_input('dbengine')]['dbname'] = $import_session['old_db_name']; } @@ -506,10 +508,12 @@ function check_if_done() $module_name = str_replace(array("import_", ".", ".."), "", $import_session['module']); - $this->debug->log->datatrace("total_{$module_name}, start_{$module_name}", array($import_session['total_'.$module_name], $this->trackers['start_'.$module_name])); + $start_module = isset($this->trackers['start_'.$module_name]) ? $this->trackers['start_'.$module_name] : 0; + + $this->debug->log->datatrace("total_{$module_name}, start_{$module_name}", array($import_session['total_'.$module_name], $start_module)); // If there are more work to do, continue, or else, move onto next module - if($import_session['total_'.$module_name] - $this->trackers['start_'.$module_name] <= 0 || $import_session['total_'.$module_name] == 0) + if($import_session['total_'.$module_name] - $start_module <= 0 || $import_session['total_'.$module_name] == 0) { $import_session['disabled'][] = 'import_'.$module_name; $import_session['flash_message'] = $lang->sprintf($lang->import_successfully, $this->settings['friendly_name']); diff --git a/resources/class_debug.php b/resources/class_debug.php index ec75fb4..b2e874f 100644 --- a/resources/class_debug.php +++ b/resources/class_debug.php @@ -276,9 +276,21 @@ function generate_plain_backtrace($shift=1) foreach($trace as $call) { - if(!$call['file']) $call['file'] = "[PHP]"; - if(!$call['line']) $call['line'] = " "; - if($call['class']) $call['function'] = $call['class'].$call['type'].$call['function']; + if(empty($call['file'])) + { + $call['file'] = "[PHP]"; + } + + if(empty($call['line'])) + { + $call['line'] = " "; + } + + if(isset($call['class'])) + { + $call['function'] = $call['class'].$call['type'].$call['function']; + } + $call['file'] = str_replace(substr(MYBB_ROOT, 0, -1), "", $call['file']); $backtrace .= "File: {$call['file']} Line: {$call['line']} Function: {$call['function']} -> \r\n"; } diff --git a/resources/class_error.php b/resources/class_error.php index bf9d0d5..43329c0 100644 --- a/resources/class_error.php +++ b/resources/class_error.php @@ -46,15 +46,24 @@ function error($type, $message, $file=null, $line=0, $allow_output=true) $file = str_replace(MYBB_ROOT, "", $file); + if(is_array($message)) + { + $message_string = "[SQL] [{$message['error_no']}]{$message['error']}
    {$message['query']}"; + } + else + { + $message_string = $message; + } + // Do we have a PHP error? if(my_strpos(my_strtolower($this->error_types[$type]), 'warning') === false) { - $this->debug->log->error("\$type: {$type} \$message: {$message} \$file: {$file} \$line: {$line}"); + $this->debug->log->error("\$type: {$type} \$message: {$message_string} \$file: {$file} \$line: {$line}"); } // PHP Warning else { - $this->debug->log->warning("\$type: {$type} \$message: {$message} \$file: {$file} \$line: {$line}"); + $this->debug->log->warning("\$type: {$type} \$message: {$message_string} \$file: {$file} \$line: {$line}"); } return parent::error($type, $message, $file, $line, $allow_output); diff --git a/resources/functions.php b/resources/functions.php index a7b805e..bb7cd71 100644 --- a/resources/functions.php +++ b/resources/functions.php @@ -21,11 +21,12 @@ function update_import_session() { global $import_session, $cache, $board, $db; - if(!$import_session['completed']) + if(empty($import_session['completed'])) { $import_session['completed'] = array(); } - if(!$import_session['disabled']) + + if(empty($import_session['disabled'])) { $import_session['disabled'] = array(); } @@ -33,10 +34,33 @@ function update_import_session() // Stats if(!empty($board->old_db->query_count)) { - $import_session['olddb_query_count'] += $board->old_db->query_count; + if(empty($import_session['olddb_query_count'])) + { + $import_session['olddb_query_count'] = $board->old_db->query_count; + } + else + { + $import_session['olddb_query_count'] += $board->old_db->query_count; + } + } + + if(empty($import_session['newdb_query_count'])) + { + $import_session['newdb_query_count'] = $db->query_count; + } + else + { + $import_session['newdb_query_count'] += $db->query_count; + } + + if(empty($import_session['total_query_time'])) + { + $import_session['total_query_time'] = $db->query_time; + } + else + { + $import_session['total_query_time'] += $db->query_time; } - $import_session['newdb_query_count'] += $db->query_count; - $import_session['total_query_time'] += $db->query_time; $import_session['completed'] = array_unique($import_session['completed']); $import_session['disabled'] = array_unique($import_session['disabled']); diff --git a/resources/modules/users.php b/resources/modules/users.php index cb6b167..2438383 100644 --- a/resources/modules/users.php +++ b/resources/modules/users.php @@ -245,7 +245,9 @@ public function check_for_duplicates(&$user) // Using strtolower and my_strtolower to check, instead of in the query, is exponentially faster // If we used LOWER() function in the query the index wouldn't be used by MySQL - if(strtolower($duplicate_user['username']) == strtolower($username) || my_strtolower($duplicate_user['username']) == strtolower($encoded_username)) + if(is_array($duplicate_user) && ( + strtolower($duplicate_user['username']) == strtolower($username) || my_strtolower($duplicate_user['username']) == strtolower($encoded_username) + )) { if($user[$this->settings['email_column']] == $duplicate_user['email']) { diff --git a/resources/output.php b/resources/output.php index b542c86..71d0f2d 100644 --- a/resources/output.php +++ b/resources/output.php @@ -84,6 +84,7 @@ class converterOutput var $_progress_bar_constructed = 0; var $_last_left = 0; + private $trackers = array(); /** * Method to print the converter header @@ -280,7 +281,7 @@ function module_list() $this->print_header($lang->module_selection, "", 0); - if($import_session['flash_message']) + if(!empty($import_session['flash_message'])) { echo "

    {$import_session['flash_message']}

    \n"; $import_session['flash_message'] = null; @@ -349,7 +350,7 @@ function module_list() echo "\n"; echo "
    ".$module['name']."
    \n"; - if($module['description']) + if(!empty($module['description'])) { echo "
    ".$module['description']."
    \n"; } @@ -369,7 +370,7 @@ function module_list() echo "\n"; echo "
    script}\">\n"; - if($import_session['module'] == $key || in_array($key, $import_session['resume_module'])) + if(isset($import_session['module']) && $import_session['module'] == $key || in_array($key, $import_session['resume_module'])) { echo "resume} »\" />\n"; } @@ -519,9 +520,16 @@ function updateDBSettings() }); "; + $config = $mybb->get_input('config', \MyBB::INPUT_ARRAY); + $db_info = array(); foreach($dboptions as $dbfile => $dbtype) { + if(!isset($config[$dbfile])) + { + $config[$dbfile] = []; + } + require_once MYBB_ROOT."inc/db_{$dbfile}.php"; if(!class_exists($dbtype['class'])) { @@ -532,17 +540,17 @@ function updateDBSettings() $db = new $dbtype['class']; $encodings = $db->fetch_db_charsets(); - if(!isset($mybb->input['config'][$dbfile]['dbhost'])) + if(!isset($config[$dbfile]['dbhost'])) { - $mybb->input['config'][$dbfile]['dbhost'] = "localhost"; + $config[$dbfile]['dbhost'] = "localhost"; } - if(!isset($mybb->input['config'][$dbfile]['tableprefix'])) + if(!isset($config[$dbfile]['tableprefix'])) { - $mybb->input['config'][$dbfile]['tableprefix'] = "mybb_"; + $config[$dbfile]['tableprefix'] = "mybb_"; } - if(!isset($mybb->input['config'][$dbfile]['encoding'])) + if(!isset($config[$dbfile]['encoding'])) { - $mybb->input['config'][$dbfile]['encoding'] = "utf8"; + $config[$dbfile]['encoding'] = "utf8"; } $class = ''; @@ -568,7 +576,7 @@ function updateDBSettings() $db_info[$dbfile] .= " - input['config'][$dbfile]['dbname'])."\" /> + "; } // Others get db host, username, password etc @@ -577,19 +585,19 @@ function updateDBSettings() $db_info[$dbfile] .= " - input['config'][$dbfile]['dbhost'])."\" /> + - input['config'][$dbfile]['dbuser'])."\" /> + - input['config'][$dbfile]['dbpass'])."\" /> + - input['config'][$dbfile]['dbname'])."\" /> + "; } @@ -606,14 +614,14 @@ function updateDBSettings() $db_info[$dbfile] .= " - input['config'][$dbfile]['tableprefix'])."\" /> + "; } else { $db_info[$dbfile] .= " - input['config'][$dbfile]['tableprefix'])."\" /> + "; } @@ -623,7 +631,7 @@ function updateDBSettings() $select_options = ""; foreach($encodings as $encoding => $title) { - if($mybb->input['config'][$dbfile]['encoding'] == $encoding) + if($config[$dbfile]['encoding'] == $encoding) { $select_options .= ""; } @@ -774,9 +782,9 @@ function print_footer($next_action="", $name="", $do_session=1, $override_form=f echo "\n script."\">\n"; } - if($import_session['autorefresh'] == "yes" && !$conf_global_not_found) + if(isset($import_session['autorefresh']) && $import_session['autorefresh'] == "yes" && !$conf_global_not_found) { - echo "\n "; + echo "\n "; echo "\n
    redirecting} »\" alt=\"{$lang->dont_wait}\" {$button_extra} />
    "; } else @@ -788,7 +796,7 @@ function print_footer($next_action="", $name="", $do_session=1, $override_form=f echo "\n
    \n"; // Only if we're in a module - if($import_session['module'] && (!defined('BACK_BUTTON') || BACK_BUTTON != false)) + if(isset($import_session['module']) && (!defined('BACK_BUTTON') || BACK_BUTTON != false)) { echo "\n
    script."\">\n"; if($import_session['module'] == 'db_configuration') @@ -890,7 +898,7 @@ function print_per_screen_page($per_screen=10) // TODO: $this->trackers is never defined and will always be 0 therefore $replacements = array( - "count" => (int) $this->trackers['start_'.$module_name], + "count" => isset($this->trackers['start_'.$module_name]) ? (int) $this->trackers['start_'.$module_name] : 0, "type" => $db->escape_string($module_name) ); $db->replace_query("trackers", $replacements); @@ -929,7 +937,7 @@ function print_per_screen_page($per_screen=10) '; $import_session['autorefresh'] = ""; - $mybb->get_input('autorefresh') = "no"; + $mybb->input['autorefresh'] = "no"; $print_screen_func = "print_{$module_name}_per_screen_page"; @@ -949,6 +957,12 @@ function calculate_stats($in_progress_stats=true) $module_name = str_replace(array("import_", ".", ".."), "", $import_session['module']); + $import_session['total_'.$module_name] = isset($import_session['total_'.$module_name]) ? $import_session['total_'.$module_name] : 0; + + $module->trackers['start_'.$module_name] = isset($module->trackers['start_'.$module_name]) ? $module->trackers['start_'.$module_name] : 0; + + $import_session[$module_name.'_per_screen'] = isset($import_session[$module_name.'_per_screen']) ? $import_session[$module_name.'_per_screen'] : 0; + $left = $import_session['total_'.$module_name]-$module->trackers['start_'.$module_name]-$import_session[$module_name.'_per_screen']; if($import_session[$module_name.'_per_screen'] <= 0) From d599fd91597f156a842b5d1bd8a97fae4836d311 Mon Sep 17 00:00:00 2001 From: Sama34 Date: Tue, 13 Aug 2024 08:14:48 -0700 Subject: [PATCH 04/11] Fix several PHP warnings for vB4 module --- boards/vbulletin4/moderators.php | 15 ++++++++++++++- boards/vbulletin4/polls.php | 9 +++++---- boards/vbulletin4/posts.php | Bin 3923 -> 4046 bytes boards/vbulletin4/privatemessages.php | 10 ++++++++-- boards/vbulletin4/settings.php | 2 +- boards/vbulletin4/users.php | 2 +- 6 files changed, 29 insertions(+), 9 deletions(-) diff --git a/boards/vbulletin4/moderators.php b/boards/vbulletin4/moderators.php index 38920c1..38f4d65 100644 --- a/boards/vbulletin4/moderators.php +++ b/boards/vbulletin4/moderators.php @@ -25,7 +25,20 @@ function import() { global $import_session; - $query = $this->old_db->simple_select("moderator", "*", "forumid != '-1'", array('limit_start' => $this->trackers['start_mods'], 'limit' => $import_session['mods_per_screen'])); + $query_options = array(); + + if(isset($this->trackers['start_mods'])) + { + $query_options['limit_start'] = $this->trackers['start_mods']; + } + + if(isset($import_session['mods_per_screen'])) + { + $query_options['limit'] = $import_session['mods_per_screen']; + } + + $query = $this->old_db->simple_select("moderator", "*", "forumid != '-1'", $query_options); + while($moderator = $this->old_db->fetch_array($query)) { $this->insert($moderator); diff --git a/boards/vbulletin4/polls.php b/boards/vbulletin4/polls.php index b60a367..98b0b8c 100644 --- a/boards/vbulletin4/polls.php +++ b/boards/vbulletin4/polls.php @@ -34,7 +34,8 @@ function import() // Restore connections $thread = $this->get_import_tid_poll($poll['pollid']); - $db->update_query("threads", array('poll' => $pid), "import_tid = '".$thread['import_tid']."'"); + + $db->update_query("threads", array('poll' => $pid), "import_tid = '".(isset($thread['import_tid']) ? $thread['import_tid'] : 0)."'"); } } @@ -47,8 +48,8 @@ function convert_data($data) $votes = @explode('|||', $data['votes']); $insert_data['import_pid'] = $data['pollid']; - $insert_data['import_tid'] = $thread['import_tid']; - $insert_data['tid'] = $thread['tid']; + $insert_data['import_tid'] = isset($thread['import_tid']) ? $thread['import_tid'] : 0; + $insert_data['tid'] = isset($thread['tid']) ? $thread['tid'] : 0; $insert_data['question'] = $data['question']; $insert_data['dateline'] = $data['dateline']; $insert_data['options'] = str_replace('|||', '||~|~||', $data['options']); @@ -76,7 +77,7 @@ function get_import_tid_poll($import_pid) $db->free_result($query); } - return $this->cache_tid_polls[$import_pid]; + return isset($this->cache_tid_polls[$import_pid]) ? $this->cache_tid_polls[$import_pid] : 0; } function fetch_total() diff --git a/boards/vbulletin4/posts.php b/boards/vbulletin4/posts.php index 01a35ddc8c27c8a6b2e4e1f9f9a7bf21b77df7c0..a5643b2020cbe5704d21c1d82a9076047b9f4043 100644 GIT binary patch literal 4046 zcmb_fd3Y7o6~E`s%zFuIP!<>5@MVF7j>*e&j4>G?d4|W3$}kzykkVAK7@9(q7DE7K zw)oym3_{r2e*LGmUl+A?VNpw$w0~7JV%gEUi%VVlSKF_4J?CvnD1v_V{qg3^z4x4Z ze&?QZ?r$z-|KD#v<7orHz@E&R0*)Jkgrdu)GH?rk>3D^_QLA05CTin~|F4i_e6dy0 zJN$o#`BKF+aoGP)0dG;7n&YSvFmc>Mxk(9tGZpM2fS5f6xM5$!Ssd((MbIkcxIL9K z4FX;Ov1Nv$*H;^Xz?lyAGy&v<>1`K8wCfEDptUyJ)45n*9f%+r-j4CoVp%uUsM<`M zNq-R{Wx)Nv3XuwY{Ef3#unrVJJg%T)z^x~Xz%;c)i)=Jh=?ba<_pT`@T-F@R$g^bg z!7P5p+}~pitla?IeFj*>Jp=&O9^l-4mP2uw^=%F%W$trfsM1;!CaxNu1ogEEO;=)7 zaanD`k>@AE&5Ev?i#0W28aQwmSh4?oG~_=BtYm8hrLD!l%KRVD*bh0Y2ls`EFxJW+ zIJ+6#BNJeZsiTS!)zxNG)exDxVVbl=iK)60HAm3JaH6+xO0|Oc6?)lNI3azedvQz)Jl$NP3f? zyhYL(V6*+VNqPs^9RFRC-XnM^_bhlRkKm>H#==Y8r(neVheU{KF~vC}NXzuN|1jo{ z|A+*&an-2vF5~PL@GcjiRgQZz!(45X`Z+Wy&i#^LG|N%NKU!GOsI@D4 zR5lddqhMkP^e*7?T)+6I2c0<_zvzzNU^ zV4C|F2FG5;vC0N?tT4Nk^41yPn77VWfF}Q>z$+Eqc_1ul>GL+6Z6e2Hi2A3(JU6sm z;%%C#7|x)o=$yGI4{%oOE^?k+B#z& zGa+C9mjQ_O8D_^G3pJzg+1<4%3G_e6L~`Yce~OKrs4$3dy__H$-}eI=e`ynoLGJV_<0%JFEO ztQ!NJ9L#3>Ds<61P#&omC=Cg*-qOlQ)ISswl-}|=6?0Or3!(BkbKEZ#uz6(>xwpI| z>fFjhl_kz?f>cwiI7fJBw&Ko|glKPhWbOtbR2-{tXW?9FssF4HDvMP3&q-;s#r|;C zYDMY|vRdJ`No+xBO-*mF#O|P{yIh2_NTk<)9;Awm5?h@fY|jjClGxWHIJsG3Yv_4T zh^;M)l=hamUk0iC-Vp1iw~8$wRk|xciu#8ob|+c0EQ#GkmMlBW)|Ex(_SVRj6K3Dc ziY{X&gX{%jeTVwrcd`DRqg4MdPz_@*ssi^|2s?4Q=N(VCtP^L|w0kn$vQCYyY4@~y z_`Dsi&a{3vRGhoN&QX8oE2xo5`kxvSq3P`UIal2b(9VU~?Ikvif@p2cx$`NX7w6ac zrzw6909$8m!_ZmV^E2lYX6GlZLDJvBSp?k20V3`b*n6F|Xv*p4Y%cgO;$7swlwY3_ zhAzqtSUX977oMNHm+r59q&wpnT#?R4!tqM{YI+u&kIo#6~_yP=fcDn-bE>{$IPiJ=! zfY256bJhjH{Sw^1ik1xk`$mB68v;y$?toGt*v{D|2nGRG26(Q+klei4G ztxIlaRyKZgc6+JzPIGo0So`p-E$m=t6PjGG^3S1c0+aqzoK=GJV)hPw37BF%jc!=K z5TOQXigi$cxYq7n3rx3uNfW=yo53i6^=oSV)^7xe)+yEyXN$mDFTk>eEzaH4?XBO2 zp}9j>YpHH?njItYBmU$(Ll_QG|M)xZ;D1c~;U6UZlX4_Nj+FeYl95{T|qDTxDnWJ zu!&|imkcY~3%IBN$R`A@t3%2xy<*@*b(jpR@6`{zQRE*W6y zPZKmSoubGP1=usFe(XyC8d7hD`1NKJ67AGmNXdvq*_Q$s-jB#F@5gC2_LH>Yg!F$} z|9t#w4C%@e8=^2n6G!x~23BofgE6pYVQqL%0;}wquQjJRWf#iYT1;7>!d>ZTr+~ou(&8gOoJ+kBh}Ut z&i8`p>A0z3sMKY>19;!<5=51Rq1f{zKtsTT8RNygIefju`G`%)xSz&G$1=`x||?g@l$m89%l9R(>)rGBPP=sqbqP q!}-Xe`&Ok@7Ub|Z2!!9c55!f@`;-9A2LQFshoosu&gheFBmXbwE_9y& literal 3923 zcmd5<-*4MC5Pntw{|}sDKu+Mq$2rKR+<;{io!XzKAgDYw09c@*nP`u9+?ers1O2@JbF|u!?^Y%(h0b=z~Eg`aKyR z{xCZDLQlyRN7%nzet7fd=l8E~o@6g|eJ6|)CcD-}t3>uzTL3NocA_pU+jEWB5&a!E zY+{9TvR+zt&bTprJ;gA_$$Go}LC1`AX!UGRGH)*{z#_6K{cD3|D1a=N?X3HQKl-a8C&MWU2Im zD>ez|nME)_Jt!rUzgl6|c+rHidwii)krj*M3kzwuvqGT;rek{1c*e#@^nt(d{#40I zy39ImoPSs};tbC}31e?lf0YG1KF(NB2%_8J+y>BwAbdQemnF&l3MDt4kdd$BEQQNg zSqLY*g$gbSFHd4T5^VuQyoq2F6_WTW*}#^E^2iGA_;f;_J%Z?pyUSK7f%LN{?2fBe zpx%>Y5-fY2+cdtYL1sTvq+}z!i%$GowiR3_8L(dpmjxTg7q|*R+@@}Y4l77B#EwVN z!3GP`3uk*(w&E=JyT#Qs+P_WFJalrm$$%YpNk)4mQT4x9ryykS>SsX~jVituQv^AA7 zohZHRRLI@FWRYl}sU6T$%1P!n?GhNhZsAH2PJ+CB27~;gxXLqbJcfGzR@hQq?)G=^#^4TzRdXDEjnJ&tJ+*p3E6+YmIF9~;xy!geze zyf!HZk|(Fs>5}Lw{X7f_#71fTlCl>!S1h(euf9V(ig5 zm>#n8b9Oo$1pS!XG28+V(IdvafBN!h)X{%3@hX1AdCo^HVJ4MQD3qUfyk$9*VB*6r zG43;T4Ca3n9o}wZ9r~`Hy+$-@?R3C-69mBxhys52r$=ft^8AXLU`Kr=uxMfT^5dj5 zy2AegqmCiPe1TmHr9s;#$^Hb6;1xsBviCvZ^;NuyCF+MTE=9EHZ?RQwM(l7<0o=YE zCjn{L#%RT;z*S(gK5LIIC!0AEC)Ugl8K1&9I|Cdr3^;lO{r2MVJBzEvB&32iyhxDU zKD1-c2qA7qwmYA|pzq`8VbjA8vO)C2K!5Dp^Fgi6-crNvPf2HXcT(uqQ!XrRvJ%Ru z%L-lnm#jpal!ZXPvyM~gh>Cf;O8;kR>DTFyd8Zvpv&W_*(8x*KJ2l9ZI;(E0g)sE% z#&<3i0sTUf7QZ8~4EQa*+r~kLw|3ZXYXb5?z`p$D!_E8Y(IMj&{N2{BC#pw1 h?yLB17E8UwwBx96sr@95s=fgp4I{RNpKhare*s{g*x3L8 diff --git a/boards/vbulletin4/privatemessages.php b/boards/vbulletin4/privatemessages.php index 2ff214d..cd22a55 100644 --- a/boards/vbulletin4/privatemessages.php +++ b/boards/vbulletin4/privatemessages.php @@ -61,7 +61,13 @@ function convert_data($data) if(!is_array($touserarray)) { $touserarray = unserialize(mb_convert_encoding($data['touserarray'], 'ISO-8859-1', 'UTF-8')); - array_walk_recursive($touserarray, function (&$value, &$key) { + + if(!is_array($touserarray)) + { + $touserarray = array(); + } + + array_walk_recursive($touserarray, function (&$value, $key) { $value = mb_convert_encoding($value, 'UTF-8', 'ISO-8859-1'); }); } @@ -97,7 +103,7 @@ function convert_data($data) // Inserting a pm for one of the recipients so the toid is our id $insert_data['toid'] = $insert_data['uid']; } - elseif(count($recipients['to']) == 1) + elseif(isset($recipients['to']) && count($recipients['to']) == 1) { // Inserting a pm for the sender with only one recipient so we can set the toid $insert_data['toid'] = $recipients['to'][0]; diff --git a/boards/vbulletin4/settings.php b/boards/vbulletin4/settings.php index 3e3c41e..e582403 100644 --- a/boards/vbulletin4/settings.php +++ b/boards/vbulletin4/settings.php @@ -135,7 +135,7 @@ function import() if($setting['varname'] == "moderatenewmembers") { - if($setting['config_value'] == 1) + if(isset($setting['config_value']) && $setting['config_value'] == 1) { $value = "admin"; } diff --git a/boards/vbulletin4/users.php b/boards/vbulletin4/users.php index c10dc59..07cb1bc 100644 --- a/boards/vbulletin4/users.php +++ b/boards/vbulletin4/users.php @@ -73,7 +73,7 @@ function convert_data($data) } $insert_data['icq'] = $data['icq']; $insert_data['skype'] = $data['skype']; - $insert_data['timezone'] = str_replace(array('.0', '.00'), array('', ''), $insert_data['timezone']); + $insert_data['timezone'] = isset($insert_data['timezone']) ? str_replace(array('.0', '.00'), array('', ''), $insert_data['timezone']) : ''; $insert_data['style'] = 0; $insert_data['referrer'] = $data['referrerid']; $insert_data['regip'] = my_inet_pton($data['ipaddress']); From f122271061b504c8756385802c8bef5f0fd12b7e Mon Sep 17 00:00:00 2001 From: Sama34 Date: Tue, 13 Aug 2024 08:19:02 -0700 Subject: [PATCH 05/11] Fix PHP warnings & fatal errors --- resources/class_cache_handler.php | 4 ++-- resources/functions.php | 19 +------------------ 2 files changed, 3 insertions(+), 20 deletions(-) diff --git a/resources/class_cache_handler.php b/resources/class_cache_handler.php index 3a4bde2..898d9a3 100644 --- a/resources/class_cache_handler.php +++ b/resources/class_cache_handler.php @@ -337,7 +337,7 @@ function fid($old_fid) $this->cache_forums(); } - return $this->cache_fids[$old_fid]; + return isset($this->cache_fids[$old_fid]) ? $this->cache_fids[$old_fid] : 0; } /** @@ -448,7 +448,7 @@ function tid($old_tid) $this->cache_threads(); } - return $this->cache_tids[$old_tid]; + return isset($this->cache_tids[$old_tid]) ? $this->cache_tids[$old_tid] : 0; } /** diff --git a/resources/functions.php b/resources/functions.php index bb7cd71..980fff6 100644 --- a/resources/functions.php +++ b/resources/functions.php @@ -255,28 +255,11 @@ function delete_import_fields($text=true) $progress += $increment; } - $columns_to_drop = array(); foreach($columns as $column) { if($db->field_exists($column, $table)) { - $columns_to_drop[] = $column; - } - } - if(!empty($columns_to_drop)) - { - if($db->type == "sqlite") - { - // Can be achieved in a transaction if we'd finally support it. - foreach($columns_to_drop as $column) - { - $db->write_query("ALTER TABLE ".TABLE_PREFIX.$table." DROP {$column}"); - } - } - else - { - $columns_sql = implode(", DROP ", $columns_to_drop); - $db->write_query("ALTER TABLE ".TABLE_PREFIX.$table." DROP {$columns_sql}"); + $db->drop_column($table, $column); } } } From de1ddc32224c964a2713e14118a02252d9fd5ac3 Mon Sep 17 00:00:00 2001 From: Sama34 Date: Mon, 26 Aug 2024 00:20:18 -0700 Subject: [PATCH 06/11] Update output.php --- resources/output.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/output.php b/resources/output.php index 71d0f2d..ef4b929 100644 --- a/resources/output.php +++ b/resources/output.php @@ -527,7 +527,7 @@ function updateDBSettings() { if(!isset($config[$dbfile])) { - $config[$dbfile] = []; + $config[$dbfile] = array(); } require_once MYBB_ROOT."inc/db_{$dbfile}.php"; From dfad62291221ba6d076ffcfbdf7ba675307cded0 Mon Sep 17 00:00:00 2001 From: Sama34 Date: Mon, 26 Aug 2024 00:23:40 -0700 Subject: [PATCH 07/11] Update index.php --- index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.php b/index.php index ff3b0e5..b96f582 100644 --- a/index.php +++ b/index.php @@ -569,7 +569,7 @@ } $plugins_cache = $cache->read("plugins", true); - $active_plugins = isset($plugins_cache['active']) ? $plugins_cache['active'] : []; + $active_plugins = isset($plugins_cache['active']) ? $plugins_cache['active'] : array(); $active_plugins['loginconvert'] = "loginconvert"; From 15ed0f0e31fd2ca9225d525605d108cda3db4fac Mon Sep 17 00:00:00 2001 From: Sama34 Date: Mon, 26 Aug 2024 00:25:28 -0700 Subject: [PATCH 08/11] Update index.php --- index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.php b/index.php index b96f582..5426315 100644 --- a/index.php +++ b/index.php @@ -639,7 +639,7 @@ update_import_session(); } // Otherwise show our requirements check to our user -else if(empty($import_session['requirements_check']) || (!empty($mybb->get_input('first_page')) && $mybb->request_method == "post") || !$import_session['requirements_pass']) +else if(empty($import_session['requirements_check']) || (!empty($mybb->input['first_page']) && $mybb->request_method == "post") || !$import_session['requirements_pass']) { $debug->log->event("Showing requirements check page"); From 1366cd00bafb55f9ea588e04f97a864c773aeaea Mon Sep 17 00:00:00 2001 From: Sama34 Date: Tue, 3 Sep 2024 08:57:34 -0700 Subject: [PATCH 09/11] Remove ICQ import --- boards/fluxbb/users.php | 2 +- boards/ipb3/users.php | 2 +- boards/mybb.php | 2 +- boards/punbb/users.php | 2 +- boards/smf/users.php | 2 +- boards/smf2/users.php | 2 +- boards/vbulletin3.php | 2 +- boards/vbulletin3/users.php | 2 +- boards/vbulletin4.php | 2 +- boards/vbulletin4/users.php | 2 +- boards/vbulletin5.php | 2 +- boards/vbulletin5/users.php | 2 +- boards/wbb4/users.php | 4 ++-- resources/modules/users.php | 2 +- 14 files changed, 15 insertions(+), 15 deletions(-) diff --git a/boards/fluxbb/users.php b/boards/fluxbb/users.php index 0506b21..6b8c894 100644 --- a/boards/fluxbb/users.php +++ b/boards/fluxbb/users.php @@ -57,7 +57,7 @@ function convert_data($data) $insert_data['timezone'] = str_replace(array('.0', '.00'), array('', ''), $data['timezone']); $insert_data['lastpost'] = (int)$data['last_post']; - $insert_data['icq'] = $data['icq']; + //$insert_data['icq'] = $data['icq']; $insert_data['hideemail'] = $data['email_setting']; $insert_data['allownotices'] = $data['notify_with_post']; $insert_data['regip'] = my_inet_pton($data['registration_ip']); diff --git a/boards/ipb3/users.php b/boards/ipb3/users.php index 5d08869..2a53d38 100644 --- a/boards/ipb3/users.php +++ b/boards/ipb3/users.php @@ -67,7 +67,7 @@ function convert_data($data) { $insert_data['birthday'] = $data['bday_day'].'-'.$data['bday_month'].'-'.$data['bday_year']; } - $insert_data['icq'] = $data['field_4']; + //$insert_data['icq'] = $data['field_4']; $insert_data['skype'] = $data['field_10']; $insert_data['timezone'] = str_replace(array('.0', '.00'), array('', ''), $data['time_offset']); $insert_data['timezone'] = ((!strstr($insert_data['timezone'], '+') && !strstr($insert_data['timezone'], '-')) ? '+'.$insert_data['timezone'] : $insert_data['timezone']); diff --git a/boards/mybb.php b/boards/mybb.php index eee6e0d..44b704b 100644 --- a/boards/mybb.php +++ b/boards/mybb.php @@ -92,7 +92,7 @@ class MYBB_Converter extends Converter var $column_length_to_check = array( 'users' => array( 'users' => array( - 'icq' => 'icq' + //'icq' => 'icq' ) ) ); diff --git a/boards/punbb/users.php b/boards/punbb/users.php index cad1873..93b6cb5 100644 --- a/boards/punbb/users.php +++ b/boards/punbb/users.php @@ -76,7 +76,7 @@ function convert_data($data) $insert_data['timezone'] = str_replace(array('.0', '.00'), array('', ''), $data['timezone']); $insert_data['lastpost'] = $data['last_post']; - $insert_data['icq'] = $data['icq']; + //$insert_data['icq'] = $data['icq']; $insert_data['hideemail'] = $data['email_setting']; $insert_data['allownotices'] = $data['notify_with_post']; $insert_data['regip'] = my_inet_pton($data['registration_ip']); diff --git a/boards/smf/users.php b/boards/smf/users.php index a4b87cf..7653b40 100644 --- a/boards/smf/users.php +++ b/boards/smf/users.php @@ -70,7 +70,7 @@ function convert_data($data) { $insert_data['birthday'] = date("j-n-Y", strtotime($data['birthdate'])); } - $insert_data['icq'] = $data['ICQ']; + //$insert_data['icq'] = $data['ICQ']; $insert_data['hideemail'] = $data['hideEmail']; $insert_data['invisible'] = int_to_01($data['showOnline']); $insert_data['pmnotify'] = $data['pm_email_notify']; diff --git a/boards/smf2/users.php b/boards/smf2/users.php index 59891bc..9a393d7 100644 --- a/boards/smf2/users.php +++ b/boards/smf2/users.php @@ -70,7 +70,7 @@ function convert_data($data) { $insert_data['birthday'] = date("j-n-Y", strtotime($data['birthdate'])); } - $insert_data['icq'] = $data['icq']; + //$insert_data['icq'] = $data['icq']; $insert_data['hideemail'] = $data['hide_email']; $insert_data['invisible'] = int_to_01($data['show_online']); $insert_data['pmnotify'] = $data['pm_email_notify']; diff --git a/boards/vbulletin3.php b/boards/vbulletin3.php index 0a1cc16..bf320f5 100644 --- a/boards/vbulletin3.php +++ b/boards/vbulletin3.php @@ -115,7 +115,7 @@ class VBULLETIN3_Converter extends Converter ), 'user' => array( 'users' => array( - 'icq' => 'icq' + //'icq' => 'icq' ) ) ); diff --git a/boards/vbulletin3/users.php b/boards/vbulletin3/users.php index 969811e..405fded 100644 --- a/boards/vbulletin3/users.php +++ b/boards/vbulletin3/users.php @@ -88,7 +88,7 @@ function convert_data($data) { $insert_data['birthday'] = $data['birthday']; } - $insert_data['icq'] = $data['icq']; + //$insert_data['icq'] = $data['icq']; $insert_data['timezone'] = str_replace(array('.0', '.00'), array('', ''), $insert_data['timezone']); $insert_data['style'] = 0; $insert_data['referrer'] = $data['referrerid']; diff --git a/boards/vbulletin4.php b/boards/vbulletin4.php index 4d8329e..614ab04 100644 --- a/boards/vbulletin4.php +++ b/boards/vbulletin4.php @@ -103,7 +103,7 @@ class VBULLETIN4_Converter extends Converter ), 'user' => array( 'users' => array( - 'icq' => 'icq' + //'icq' => 'icq' ) ) ); diff --git a/boards/vbulletin4/users.php b/boards/vbulletin4/users.php index 07cb1bc..afb8e68 100644 --- a/boards/vbulletin4/users.php +++ b/boards/vbulletin4/users.php @@ -71,7 +71,7 @@ function convert_data($data) list($bmonth, $bday, $byear) = explode("-", $data['birthday']); $insert_data['birthday'] = $bday."-".$bmonth."-".$byear; } - $insert_data['icq'] = $data['icq']; + //$insert_data['icq'] = $data['icq']; $insert_data['skype'] = $data['skype']; $insert_data['timezone'] = isset($insert_data['timezone']) ? str_replace(array('.0', '.00'), array('', ''), $insert_data['timezone']) : ''; $insert_data['style'] = 0; diff --git a/boards/vbulletin5.php b/boards/vbulletin5.php index 927c018..2b1d751 100644 --- a/boards/vbulletin5.php +++ b/boards/vbulletin5.php @@ -103,7 +103,7 @@ class VBULLETIN5_Converter extends Converter ), 'user' => array( 'users' => array( - 'icq' => 'icq' + //'icq' => 'icq' ) ) ); diff --git a/boards/vbulletin5/users.php b/boards/vbulletin5/users.php index c562afe..077be33 100644 --- a/boards/vbulletin5/users.php +++ b/boards/vbulletin5/users.php @@ -71,7 +71,7 @@ function convert_data($data) list($bmonth, $bday, $byear) = explode("-", $data['birthday']); $insert_data['birthday'] = $bday."-".$bmonth."-".$byear; } - $insert_data['icq'] = $data['icq']; + //$insert_data['icq'] = $data['icq']; $insert_data['skype'] = $data['skype']; $insert_data['timezone'] = str_replace(array('.0', '.00'), array('', ''), $insert_data['timezoneoffset']); $insert_data['style'] = 0; diff --git a/boards/wbb4/users.php b/boards/wbb4/users.php index 7a19718..6e9ce75 100644 --- a/boards/wbb4/users.php +++ b/boards/wbb4/users.php @@ -29,7 +29,7 @@ class WBB4_Converter_Module_Users extends Converter_Module_Users { "homepage", "birthday", "timezone", - "icq", + //"icq", "skype", "googlePlus", ); @@ -150,7 +150,7 @@ function convert_data($data) } $insert_data['birthday'] = $birthday; - $insert_data['icq'] = $data['icq']; + //$insert_data['icq'] = $data['icq']; $insert_data['skype'] = $data['skype']; $insert_data['google'] = $data['googlePlus']; diff --git a/resources/modules/users.php b/resources/modules/users.php index 2438383..251184e 100644 --- a/resources/modules/users.php +++ b/resources/modules/users.php @@ -34,7 +34,7 @@ abstract class Converter_Module_Users extends Converter_Module 'lastvisit' => TIME_NOW, 'lastpost' => 0, 'website' => '', - 'icq' => '', + //'icq' => '', 'skype' => '', 'google' => '', 'birthday' => '', From e5060c92a57b925f1bf489f92e94455b02260d42 Mon Sep 17 00:00:00 2001 From: Sama34 Date: Tue, 3 Sep 2024 08:58:19 -0700 Subject: [PATCH 10/11] Remove ICQ import --- boards/phpbb3/users.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/boards/phpbb3/users.php b/boards/phpbb3/users.php index e9bbd00..8b336c2 100644 --- a/boards/phpbb3/users.php +++ b/boards/phpbb3/users.php @@ -96,7 +96,7 @@ function convert_data($data) } $insert_data['birthday'] = $birthday; - $insert_data['icq'] = $data['user_icq']; + //$insert_data['icq'] = $data['user_icq'] ?? ''; $insert_data['hideemail'] = $data['user_allow_viewemail']; $insert_data['invisible'] = int_to_01($data['user_allow_viewonline']); $insert_data['allownotices'] = $data['user_notify']; From aea42b55fe56ef75794371a23c1157e9644492fc Mon Sep 17 00:00:00 2001 From: Sama34 Date: Tue, 3 Sep 2024 08:58:30 -0700 Subject: [PATCH 11/11] Fix phpBB3 warnings --- boards/phpbb3/threads.php | 2 +- boards/phpbb3/users.php | 4 ++-- resources/class_converter_module.php | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/boards/phpbb3/threads.php b/boards/phpbb3/threads.php index 81dc980..bc13a6a 100644 --- a/boards/phpbb3/threads.php +++ b/boards/phpbb3/threads.php @@ -87,7 +87,7 @@ function get_poll_pid($tid) $results = $this->old_db->fetch_field($query, "poll_option_id"); $this->old_db->free_result($query); - $this->get_poll_pid_cache[$tid] = $results; + $this->get_poll_pid_cache[$tid] = (int)$results; return $results; } diff --git a/boards/phpbb3/users.php b/boards/phpbb3/users.php index 8b336c2..b4653ba 100644 --- a/boards/phpbb3/users.php +++ b/boards/phpbb3/users.php @@ -71,7 +71,7 @@ function convert_data($data) $insert_data['regdate'] = $data['user_regdate']; $insert_data['lastactive'] = $data['user_lastvisit']; $insert_data['lastvisit'] = $data['user_lastvisit']; - $insert_data['website'] = $data['user_website']; + $insert_data['website'] = $data['user_website'] ?? ''; $insert_data['lastpost'] = $data['user_lastpost_time']; $birthday = ''; @@ -125,7 +125,7 @@ function convert_data($data) // phpBB 3.1 $insert_data['timezone'] = get_timezone($data['user_timezone']); } - $insert_data['dst'] = $data['user_dst']; + $insert_data['dst'] = $data['user_dst'] ?? 0; $insert_data['signature'] = encode_to_utf8($this->bbcode_parser->convert($data['user_sig'], $data['user_sig_bbcode_uid']), "users", "users"); $insert_data['regip'] = my_inet_pton($data['user_ip']); $insert_data['lastip'] = my_inet_pton($data['user_ip']); diff --git a/resources/class_converter_module.php b/resources/class_converter_module.php index 9602040..ba552dc 100644 --- a/resources/class_converter_module.php +++ b/resources/class_converter_module.php @@ -412,8 +412,8 @@ public function prepare_insert_array($values, $table='') { $this->board->set_column_warning_in_progress( 'entry', $table, $key, - $lang->sprintf($lang->warning_prepare_data_mismatched_column, $import_session['module'], TABLE_PREFIX.$table, $key, $column['def_type'], 'STRING'), - $lang->sprintf($lang->warning_prepare_data_mismatched_column, $import_session['module'], TABLE_PREFIX.$table, $key, $column['def_type'], 'STRING') + $lang->sprintf($lang->warning_prepare_data_mismatched_column, $import_session['module'], TABLE_PREFIX.$table, $key, $column['def_type'] ?? '', 'STRING'), + $lang->sprintf($lang->warning_prepare_data_mismatched_column, $import_session['module'], TABLE_PREFIX.$table, $key, $column['def_type'] ?? '', 'STRING') ); }