Exemplo n.º 1
0
function doStripslashes()
{
    if (function_exists(get_magic_quotes_gpc()) && get_magic_quotes_gpc()) {
        $_GET = stripslashesDeep($_GET);
        $_POST = stripslashesDeep($_POST);
        $_COOKIE = stripslashesDeep($_COOKIE);
        $_REQUEST = stripslashesDeep($_REQUEST);
    }
}
Exemplo n.º 2
0
function datasafe()
{
    if (get_magic_quotes_gpc()) {
        $_GET = stripslashesDeep($_GET);
        $_POST = stripslashesDeep($_POST);
        $_COOKIE = stripslashesDeep($_COOKIE);
        $_REQUEST = stripslashesDeep($_REQUEST);
    }
}
 public function edit()
 {
     $id = intval($_REQUEST['id']);
     $vo = D("MSearchcate")->getById($id);
     $vo['tags'] = stripslashesDeep(unserialize($vo['tags']));
     if (is_array($vo['tags']) && count($vo['tags']) > 0) {
         $vo['tags'] = array_chunk($vo['tags'], 3);
     }
     $this->assign('vo', $vo);
     $cate_list = D("AlbumCategory")->where('status = 1')->field('id,name')->order('sort ASC,id ASC')->findAll();
     $this->assign("cate_list", $cate_list);
     $this->display();
 }
 public function edit()
 {
     $id = intval($_REQUEST['id']);
     $vo = D("MIndex")->getById($id);
     $vo['data'] = stripslashesDeep(unserialize($vo['data']));
     if (isset($vo['data']['tags'])) {
         $vo['data']['tags'] = implode(' ', $vo['data']['tags']);
     }
     $this->assign('vo', $vo);
     $cate_list = D("AlbumCategory")->where('status = 1')->field('id,name')->order('sort ASC,id ASC')->findAll();
     $this->assign("cate_list", $cate_list);
     $this->display();
 }
Exemplo n.º 5
0
 protected function _initialize()
 {
     unset($_SESSION['__hash__']);
     /* 对用户传入的变量进行转义操作。*/
     if (get_magic_quotes_gpc()) {
         if (!empty($_GET)) {
             $_GET = stripslashesDeep($_GET);
         }
         if (!empty($_POST)) {
             $_POST = stripslashesDeep($_POST);
         }
         $_COOKIE = stripslashesDeep($_COOKIE);
         $_REQUEST = stripslashesDeep($_REQUEST);
     }
     //加载扩展函数库
     //Load('extend');
     $this->_CFG = load_config();
     $this->_refererUrl = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '';
     if (!$this->isAjax() && !$this->isPost()) {
         $this->assign('_CFG', $this->_CFG);
         $this->assign('refererUrl', $this->_refererUrl);
     }
 }
Exemplo n.º 6
0
function requestData($arg = '')
{
    $s = $sep = '';
    foreach ($arg as $k => $v) {
        $k = urlencode($k);
        if (is_array($v)) {
            $s2 = $sep2 = '';
            foreach ($v as $k2 => $v2) {
                $k2 = urlencode($k2);
                $s2 .= "{$sep2}{$k}[{$k2}]=" . urlencode(stripslashesDeep($v2));
                $sep2 = '&';
            }
            $s .= $sep . $s2;
        } else {
            $s .= "{$sep}{$k}=" . urlencode(stripslashesDeep($v));
        }
        $sep = '&';
    }
    return $s;
}
Exemplo n.º 7
0
<?php

define('SUB_DIR', '/' . APP_NAME);
define('MANAGE_HANDLER', true);
session_start();
error_reporting(E_ALL ^ E_NOTICE);
require FANWE_ROOT . 'core/fanwe.php';
$fanwe =& FanweService::instance();
$fanwe->is_admin = true;
$fanwe->is_session = false;
$fanwe->is_user = false;
$fanwe->is_cron = false;
$fanwe->is_misc = false;
$fanwe->cache_list = array();
$fanwe->initialize();
if (!MAGIC_QUOTES_GPC) {
    $_GET = stripslashesDeep($_GET);
    $_POST = stripslashesDeep($_POST);
    $_COOKIE = stripslashesDeep($_COOKIE);
}
include_once FANWE_ROOT . './common/common.php';
Exemplo n.º 8
0
 function _initialize()
 {
     /* 对用户传入的变量进行转义操作。*/
     if (MAGIC_QUOTES_GPC) {
         if (!empty($_GET)) {
             $_GET = stripslashesDeep($_GET);
         }
         if (!empty($_POST)) {
             $_POST = stripslashesDeep($_POST);
         }
         $_COOKIE = stripslashesDeep($_COOKIE);
         $_REQUEST = stripslashesDeep($_REQUEST);
     }
     $this->assign('module_name', MODULE_NAME);
     $this->assign('action_name', ACTION_NAME);
     $langSet = C('DEFAULT_LANG');
     // 定义当前语言
     define('FANWE_LANG_SET', strtolower($langSet));
     $this->assign('default_lang', FANWE_LANG_SET);
     // 读取项目公共语言包
     if (is_file(LANG_PATH . $langSet . '/common.php')) {
         L(include LANG_PATH . $langSet . '/common.php');
     }
     // 读取当前模块语言包
     if (is_file(LANG_PATH . $langSet . '/' . MODULE_NAME . '.php')) {
         L(include LANG_PATH . $langSet . '/' . MODULE_NAME . '.php');
     }
     $this->assign('ur_href', L(MODULE_NAME) . ' > ' . L(MODULE_NAME . '_' . ACTION_NAME));
     if (Session::isExpired()) {
         unset($_SESSION[C('USER_AUTH_KEY')]);
         unset($_SESSION);
         session_destroy();
     }
     Session::setExpire(time() + fanweC("EXPIRED_TIME") * 60);
     // 用户权限检查
     if (C('USER_AUTH_ON') && !in_array(MODULE_NAME, explode(',', C('NOT_AUTH_MODULE')))) {
         import('@.ORG.RBAC');
         if (!RBAC::AccessDecision()) {
             //检查认证识别号
             if (!$_SESSION[C('USER_AUTH_KEY')]) {
                 //跳转到认证网关
                 redirect(PHP_FILE . C('USER_AUTH_GATEWAY'));
             }
             // 没有权限 抛出错误
             if (C('RBAC_ERROR_PAGE')) {
                 // 定义权限错误页面
                 redirect(C('RBAC_ERROR_PAGE'));
             } else {
                 if (C('GUEST_AUTH_ON')) {
                     $this->assign('jumpUrl', PHP_FILE . C('USER_AUTH_GATEWAY'));
                 }
                 // 提示错误信息
                 if (intval($_REQUEST['ajax']) == 2) {
                     echo L('_VALID_ACCESS_');
                     exit;
                 } else {
                     $this->assign("jumpUrl", u("Index/main"));
                     $this->error(L('_VALID_ACCESS_'));
                 }
             }
         }
     }
 }