clq

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

    //自动判断,消除魔术字符串
    public function get_request_real($strings)
    {
        if(get_magic_quotes_gpc())
        {
            $strings = public_functions::_stripslashes($strings);
        }

        return $strings;
    }

    //自动判断
    //get_magic_quotes_gpc
    //get_magic_quotes_gpc取得 PHP 环境变量 magic_quotes_gpc 的值。语法: long get_magic_quotes_gpc(void);
    //返回值: 长整数函数种类: PHP 系统功能内容说明本函数取得 PHP 环境配置的变量 magic_quotes_gpc (GPC, Get/Post/Cookie) 值。
    //返回 0 表示关闭本功能;
    //返回 1 表示本功能打开。
    //当 magic_quotes_gpc 打开时,所有的 ' (单引号), " (双引号), \ (反斜线) and 空字符会自动转为含有反斜线的转义字符。
    ////类似 get_request_real
    static public function GetRequest($key)
    {
        $r = $_REQUEST[$key];
        if (magic_quotes_gpc() == 1) $r = stripslashes($r);
        
        return $r;
    }//

posted on 2012-03-24 21:31  clq  阅读(387)  评论(0编辑  收藏  举报