if(!API_UPDATEBADWORDS) {
return API_RETURN_FORBIDDEN;
}
$data = array();
if(is_array($post)) {
foreach($post as $k => $v) {
//dz uc-key修改开始
if(substr($v['findpattern'], 0, 1) != '/' || substr($v['findpattern'], -3) != '/is') {
$v['findpattern'] = '/' . preg_quote($v['findpattern'], '/') . '/is';
}
//end 修改结束
$data['findpattern'][$k] = $v['findpattern'];
$data['replace'][$k] = $v['replacement'];
}
}
function updateapps($get, $post) {
global $_G;
if(!API_UPDATEAPPS) {
return API_RETURN_FORBIDDEN;
}
//$UC_API = $post['UC_API'];
//dz uc-key修改开始
$UC_API = '';
if($post['UC_API']) {
$UC_API = str_replace(array('\'', '"', '\\', "\0", "\n", "\r"), '', $post['UC_API']);
unset($post['UC_API']);
}
//end修改结束
$cachefile = DISCUZ_ROOT.'./uc_client/data/cache/apps.php';
$configfile = preg_replace
$configfile = preg_replace("/define\('UC_API',\s*'.*?'\);/i", "define('UC_API', '".addslashes($UC_API)."');", $configfile);
如对本文有疑问,请提交到交流论坛,广大热心网友会为你解答!! 点击进入论坛