插件

今天又安装了2个插件,一个是tag  一个是jsformat  其中tag 是手动安装,安装包已经放到云盘。 直接把安装包放到 C:Documents and SettingsAdministratorApplication DataSublime Text 2Packages  重启即可。

2014年3月18日 14:50:06

中文参数的问题解决了,编写覆盖CI核心类

放在目录为:application/core/下面

<?php

/**
 * 2014年3月18日 14:13:36
 * 解决中文参数的问题,避免CI过滤
 */
 
class MY_URI extends CI_URI {
 
    function _filter_uri($str) {
       /* $encoding = mb_detect_encoding($str, "gb2312,utf-8");
        if ($encoding != "utf-8") {
            $str = iconv($encoding, "utf-8", $str);
        }
        */
        if ($str != '' && $this->config->item('permitted_uri_chars') != '' && $this->config->item('enable_query_strings') == FALSE) {
            // preg_quote() in PHP 5.3 escapes -, so the str_replace() and addition of - to preg_quote() is to maintain backwards
            // compatibility as many are unaware of how characters in the permitted_uri_chars will be parsed as a regex pattern
            if (!preg_match($this->config->item('permitted_uri_chars'), $str)) {
                show_error('myurl:The URI you submitted has disallowed characters.' . $str, 400);
            }
        }
        // Convert programatic characters to entities
        $bad = array('$', '(', ')', '%28', '%29');
        $good = array('$', '(', ')', '(', ')');
 
        return str_replace($bad, $good, $str);
    }
 
}
 
核心类
 
修改配置文件中 $config['permitted_uri_chars'] = '|^[a-z 0-9~%.:_+- x{4e00}-x{9fa5}]+$|iu';
QQ:540045865 热爱生活,热爱编程。
原文地址:https://www.cnblogs.com/jsRunner/p/3606990.html