当前位置: 首页>>代码示例>>PHP>>正文


PHP DupUtil::unset_safe_path方法代码示例

本文整理汇总了PHP中DupUtil::unset_safe_path方法的典型用法代码示例。如果您正苦于以下问题:PHP DupUtil::unset_safe_path方法的具体用法?PHP DupUtil::unset_safe_path怎么用?PHP DupUtil::unset_safe_path使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DupUtil的用法示例。


在下文中一共展示了DupUtil::unset_safe_path方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: isset

DupUtil::log($msg);
DupUtil::log("--------------------------------------");
DupUtil::log("KEEP PLUGINS ACTIVE");
DupUtil::log("--------------------------------------");
$msg = isset($_POST['plugins']) && count($_POST['plugins'] > 0) ? print_r($_POST['plugins'], true) : 'No plugins selected for activation';
DupUtil::log($msg);
//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 = '{$_POST['url_new']}'  WHERE option_name = 'home' ");
mysqli_query($dbh, "UPDATE `{$GLOBALS['FW_TABLEPREFIX']}options` SET option_value = '{$_POST['siteurl']}'  WHERE option_name = 'siteurl' ");
mysqli_query($dbh, "UPDATE `{$GLOBALS['FW_TABLEPREFIX']}options` SET option_value = '{$serial_plugin_list}'  WHERE option_name = 'active_plugins' ");
DupUtil::log("--------------------------------------");
DupUtil::log("GLOBAL DB-REPLACE");
DupUtil::log("--------------------------------------");
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' => rtrim(DupUtil::unset_safe_path($_POST['path_old']), '\\'), 'replace' => rtrim($_POST['path_new'], '/')));
@mysqli_autocommit($dbh, false);
$report = DupDBTextSwap::load($dbh, $GLOBALS['REPLACE_LIST'], $_POST['tables'], $GLOBALS['TABLES_SKIP_COLS']);
@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;
$JSON['step2']['warnlist'] = array();
DupDBTextSwap::log_stats($report);
DupDBTextSwap::log_errors($report);
//Reset the postguid data
if ($_POST['postguid']) {
    mysqli_query($dbh, "UPDATE `{$GLOBALS['FW_TABLEPREFIX']}posts` SET guid = REPLACE(guid, '{$_POST['url_new']}', '{$_POST['url_old']}')");
开发者ID:batruji,项目名称:metareading,代码行数:31,代码来源:ajax.step2.php

示例2: str_replace

$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' => $url_old_json,	  'replace' => $url_new_json), 
		array('search' => $_POST['path_old'], 'replace' => $_POST['path_new']), 
		array('search' => $path_old_json,	  'replace' => $path_new_json), 		
		array('search' => rtrim(DupUtil::unset_safe_path($_POST['path_old']), '\\'), 'replace' => rtrim($_POST['path_new'], '/'))
);

@mysqli_autocommit($dbh, false);
$report = DUPX_Serializer::load($dbh, $GLOBALS['REPLACE_LIST'], $_POST['tables'], $GLOBALS['TABLES_SKIP_COLS'], $_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;
$JSON['step2']['warnlist'] = array();
开发者ID:johnmanlove,项目名称:JMMC_Corp-Site,代码行数:30,代码来源:JMMC_5669f34bd4d9b2909151210214859_installer.php


注:本文中的DupUtil::unset_safe_path方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。