本文整理汇总了PHP中checksecurity函数的典型用法代码示例。如果您正苦于以下问题:PHP checksecurity函数的具体用法?PHP checksecurity怎么用?PHP checksecurity使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了checksecurity函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
}
$mp3list[] = array('mp3url' => $value, 'mp3name' => $mp3name[$key], 'cdbj' => $cdbj[$key]);
}
}
$blockdata['parameters']['music']['mp3list'] = $mp3list;
}
if (empty($blockdata['parameters']['music']['config'])) {
$blockdata['parameters']['music']['config'] = array('showmod' => 'default', 'autorun' => 'true', 'shuffle' => 'true', 'crontabcolor' => '#D2FF8C', 'buttoncolor' => '#1F43FF', 'fontcolor' => '#1F43FF');
}
$setarr['blockposition'] = daddslashes(serialize($blockdata));
DB::update('common_member_field_home', $setarr, "uid = {$space['uid']}");
showmessage('do_success', 'home.php?mod=spacecp&ac=index&op=getblock&blockname=' . $blockname, array('blockname' => $blockname));
}
if (submitcheck('diysubmit')) {
$blockdata = array();
checksecurity($_POST['spacecss']);
$spacecss = dstripslashes($_POST['spacecss']);
$spacecss = preg_replace("/(\\<|\\>)/is", '', $spacecss);
$currentlayout = getstr($_POST['currentlayout'], 5, 1, 1);
$style = empty($_POST['style']) ? '' : preg_replace("/[^0-9a-z]/i", '', $_POST['style']);
$layoutdata = dstripslashes(getgpc('layoutdata', 'P'));
require_once libfile('class/xml');
$layoutdata = xml2array($layoutdata);
if (empty($layoutdata)) {
showmessage('space_data_format_invalid');
}
$layoutdata = $layoutdata['diypage'];
if ($style && $style != 'uchomedefault') {
$cssfile = DISCUZ_ROOT . './static/space/' . $style . '/style.css';
if (!file_exists($cssfile)) {
showmessage('theme_does_not_exist');
示例2: save_diy_data
function save_diy_data($primaltplname, $targettplname, $data, $database = false, $optype = '')
{
global $_G;
if (empty($data) || !is_array($data)) {
return false;
}
checksecurity($data['spacecss']);
$file = ($_G['cache']['style_default']['tpldir'] ? $_G['cache']['style_default']['tpldir'] : './template/default') . '/' . $primaltplname . '.htm';
if (!file_exists($file)) {
$file = './template/default/' . $primaltplname . '.htm';
}
if (!file_exists($file)) {
return false;
}
$content = file_get_contents(DISCUZ_ROOT . $file);
$content = preg_replace("/\\<\\!\\-\\-\\[name\\].+?\\[\\/name\\]\\-\\-\\>\\s+/is", '', $content);
$content = preg_replace("/\\<script src\\=\"misc\\.php\\?mod\\=diyhelp\\&action\\=get.+?\\>\\<\\/script\\>/", '', $content);
foreach ($data['layoutdata'] as $key => $value) {
$key = trimdxtpllang($key);
$html = '';
$html .= '<div id="' . $key . '" class="area">';
$html .= getframehtml($value);
$html .= '</div>';
$content = preg_replace("/(\\<\\!\\-\\-\\[diy\\={$key}\\]\\-\\-\\>).+?(\\<\\!\\-\\-\\[\\/diy\\]\\-\\-\\>)/is", "\\1" . $html . "\\2", $content);
}
$data['spacecss'] = str_replace('.content', '.dxb_bc', $data['spacecss']);
$data['spacecss'] = trimdxtpllang($data['spacecss']);
$content = preg_replace("/(\\<style id\\=\"diy_style\" type\\=\"text\\/css\"\\>).*?(\\<\\/style\\>)/is", "\\1" . $data['spacecss'] . "\\2", $content);
if (!empty($data['style'])) {
$content = preg_replace("/(\\<link id\\=\"style_css\" rel\\=\"stylesheet\" type\\=\"text\\/css\" href\\=\").+?(\"\\>)/is", "\\1" . $data['style'] . "\\2", $content);
}
$flag = $optype == 'savecache' ? true : false;
if ($flag) {
$targettplname = $targettplname . '_diy_preview';
} else {
@unlink('./data/diy/' . $targettplname . '_diy_preview.htm');
}
$tplfile = DISCUZ_ROOT . './data/diy/' . $targettplname . '.htm';
$tplpath = dirname($tplfile);
if (!is_dir($tplpath)) {
dmkdir($tplpath);
} else {
if (file_exists($tplfile) && !$flag) {
copy($tplfile, $tplfile . '.bak');
}
}
$r = file_put_contents($tplfile, $content);
if ($r && $database && !$flag) {
$tpldata = daddslashes(serialize($data));
$diytplname = getdiytplname($targettplname);
$diytplname = addslashes($diytplname);
DB::query("REPLACE INTO " . DB::table('common_diy_data') . " (targettplname, primaltplname, diycontent, `name`, uid, username, dateline) VALUES ('{$targettplname}', '{$primaltplname}', '{$tpldata}', '{$diytplname}', '{$_G['uid']}', '{$_G['username']}', '" . TIMESTAMP . "')");
}
return $r;
}
示例3: save_diy_data
function save_diy_data($tpldirectory, $primaltplname, $targettplname, $data, $database = false, $optype = '')
{
global $_G;
if (empty($data) || !is_array($data)) {
return false;
}
checksecurity($data['spacecss']);
if (empty($tpldirectory)) {
$tpldirectory = getdiytpldir($primaltplname);
}
$isextphp = false;
$file = $tpldirectory . '/' . $primaltplname . '.htm';
if (!file_exists($file)) {
$file = $tpldirectory . '/' . $primaltplname . '.php';
if (!file_exists($file)) {
$file = './template/default/' . $primaltplname . '.htm';
} else {
$isextphp = true;
}
}
if (!file_exists($file)) {
return false;
}
$content = file_get_contents(DISCUZ_ROOT . $file);
if ($isextphp) {
$content = substr($content, strpos($content, "\n"));
}
$content = preg_replace("/\\<\\!\\-\\-\\[name\\].+?\\[\\/name\\]\\-\\-\\>\\s+/is", '', $content);
$content = preg_replace("/\\<script src\\=\"misc\\.php\\?mod\\=diyhelp\\&action\\=get.+?\\>\\<\\/script\\>/", '', $content);
foreach ($data['layoutdata'] as $key => $value) {
$key = trimdxtpllang($key);
$html = '';
$html .= '<div id="' . $key . '" class="area">';
$html .= getframehtml($value);
$html .= '</div>';
$content = preg_replace("/(\\<\\!\\-\\-\\[diy\\={$key}\\]\\-\\-\\>).+?(\\<\\!\\-\\-\\[\\/diy\\]\\-\\-\\>)/is", "\\1" . $html . "\\2", $content);
}
$data['spacecss'] = str_replace('.content', '.dxb_bc', $data['spacecss']);
$data['spacecss'] = trimdxtpllang($data['spacecss']);
$content = preg_replace("/(\\<style id\\=\"diy_style\" type\\=\"text\\/css\"\\>).*?(\\<\\/style\\>)/is", "\\1" . $data['spacecss'] . "\\2", $content);
if (!empty($data['style'])) {
$content = preg_replace("/(\\<link id\\=\"style_css\" rel\\=\"stylesheet\" type\\=\"text\\/css\" href\\=\").+?(\"\\>)/is", "\\1" . $data['style'] . "\\2", $content);
}
$flag = $optype == 'savecache' ? true : false;
if ($flag) {
$targettplname = $targettplname . '_diy_preview';
} else {
@unlink('./data/diy/' . $tpldirectory . '/' . $targettplname . '_diy_preview.htm');
}
$tplfile = DISCUZ_ROOT . './data/diy/' . $tpldirectory . '/' . $targettplname . '.htm';
$tplpath = dirname($tplfile);
if (!is_dir($tplpath)) {
dmkdir($tplpath);
} else {
if (file_exists($tplfile) && !$flag) {
copy($tplfile, $tplfile . '.bak');
}
}
$r = file_put_contents($tplfile, $content);
if ($r && $database && !$flag) {
$diytplname = getdiytplname($targettplname, $tpldirectory);
C::t('common_diy_data')->insert(array('targettplname' => $targettplname, 'tpldirectory' => $tpldirectory, 'primaltplname' => $primaltplname, 'diycontent' => serialize($data), 'name' => $diytplname, 'uid' => $_G['uid'], 'username' => $_G['username'], 'dateline' => TIMESTAMP), false, true);
}
return $r;
}
示例4: exit
<?php
/*
[UCenter Home] (C) 2007-2008 Comsenz Inc.
$Id: cp_theme.php 12880 2009-07-24 07:20:24Z liguode $
*/
if (!defined('IN_UCHOME')) {
exit('Access Denied');
}
$op = empty($_GET['op']) ? '' : $_GET['op'];
$dir = empty($_GET['dir']) ? '' : preg_replace("/[^0-9a-z]/i", '', $_GET['dir']);
$allowcss = checkperm('allowcss');
if (submitcheck('csssubmit')) {
checksecurity($_POST['css']);
$css = $allowcss ? getstr($_POST['css'], 5000, 1, 1) : '';
$nocss = empty($_POST['nocss']) ? 0 : 1;
updatetable('spacefield', array('theme' => '', 'css' => $css, 'nocss' => $nocss), array('uid' => $_SGLOBAL['supe_uid']));
showmessage('do_success', 'cp.php?ac=theme&op=diy&view=ok', 0);
} elseif (submitcheck('timeoffsetsubmit')) {
updatetable('spacefield', array('timeoffset' => $_POST['timeoffset']), array('uid' => $_SGLOBAL['supe_uid']));
showmessage('do_success', 'cp.php?ac=theme');
}
//确定文件是否存在
if ($dir && $dir != 'uchomedefault') {
$cssfile = S_ROOT . './theme/' . $dir . '/style.css';
if (!file_exists($cssfile)) {
showmessage('theme_does_not_exist');
}
}
if ($op == 'use') {
//启用