예제 #1
0
//UPDATE SETTINGS
$serial_plugin_list = isset($_POST['plugins']) && count($_POST['plugins'] > 0) ? @serialize($_POST['plugins']) : '';
mysqli_query($dbh, "UPDATE `{$GLOBALS['FW_TABLEPREFIX']}options` SET option_value = '{$_POST['blogname']}' WHERE option_name = 'blogname' ");
mysqli_query($dbh, "UPDATE `{$GLOBALS['FW_TABLEPREFIX']}options` SET option_value = '{$serial_plugin_list}'  WHERE option_name = 'active_plugins' ");
$log = "--------------------------------------\n";
$log .= "SERIALIZER ENGINE\n";
$log .= "[*] scan every column\n";
$log .= "[~] scan only text columns\n";
$log .= "[^] no searchable columns\n";
$log .= "--------------------------------------";
DUPX_Log::Info($log);
$url_old_json = str_replace('"', "", json_encode($_POST['url_old']));
$url_new_json = str_replace('"', "", json_encode($_POST['url_new']));
$path_old_json = str_replace('"', "", json_encode($_POST['path_old']));
$path_new_json = str_replace('"', "", json_encode($_POST['path_new']));
array_push($GLOBALS['REPLACE_LIST'], array('search' => $_POST['url_old'], 'replace' => $_POST['url_new']), array('search' => $_POST['path_old'], 'replace' => $_POST['path_new']), array('search' => $url_old_json, 'replace' => $url_new_json), array('search' => $path_old_json, 'replace' => $path_new_json), array('search' => urlencode($_POST['path_old']), 'replace' => urlencode($_POST['path_new'])), array('search' => urlencode($_POST['url_old']), 'replace' => urlencode($_POST['url_new'])), array('search' => rtrim(DUPX_Util::unset_safe_path($_POST['path_old']), '\\'), 'replace' => rtrim($_POST['path_new'], '/')));
//Remove trailing slashes
function _dupx_array_rtrim(&$value)
{
    $value = rtrim($value, '\\/');
}
array_walk_recursive($GLOBALS['REPLACE_LIST'], _dupx_array_rtrim);
@mysqli_autocommit($dbh, false);
$report = DUPX_UpdateEngine::load($dbh, $GLOBALS['REPLACE_LIST'], $_POST['tables'], $_POST['fullsearch']);
@mysqli_commit($dbh);
@mysqli_autocommit($dbh, true);
//BUILD JSON RESPONSE
$JSON = array();
$JSON['step1'] = json_decode(urldecode($_POST['json']));
$JSON['step2'] = $report;
$JSON['step2']['warn_all'] = 0;