用户
 找回密码
 入住 CI 中国社区
搜索
查看: 1435|回复: 0
收起左侧

[HELP] 关于router的问题

[复制链接]
发表于 2013-6-6 14:54:24 | 显示全部楼层 |阅读模式
CI_Router类中,set_directory方法:
PHP复制代码
 
    /**
     *  Set the directory name
     *
     * @access    public
     * @param    string
     * @return    void
     */

    function set_directory($dir)
    {
        $this->directory = str_replace(array('/', '.'), '', $dir).'/';
    }
 
复制代码

对$dir进行了过滤(替换),这样做的目的是什么?出于安全考虑吗?

本版积分规则