Request->path()方法问题

浏览:1287 发布日期:2019/01/29 分类:求助交流 关键字: BUG Request path
public function path()
    {
        if (is_null($this->path)) {
            $suffix   = $this->config['url_html_suffix'];
            $pathinfo = $this->pathinfo();

            if (false === $suffix) {
                // 禁止伪静态访问
                $this->path = $pathinfo;
            } elseif ($suffix) {
                // 去除正常的URL后缀
                $this->path = preg_replace('/\.(' . ltrim($suffix, '.') . ')$/i', '', $pathinfo);
            } else {
                // 允许任何后缀访问
                $this->path = preg_replace('/\.' . $this->ext() . '$/i', '', $pathinfo);
            }
        }

        return $this->path;
    }
$this->path = preg_replace('/\.(' . ltrim($suffix, '.') . ')$/i', '', $pathinfo);当url地址为admin/index.html?name=abc时会导致action名称取到index.html, 没有去掉.html后缀
想请教下如何在不修改代码的情况下解决? 大家有没有遇到这种问题呢
最佳答案
评论( 相关
后面还有条评论,点击查看>>