GithubHelp home page GithubHelp logo

utf-8 url转译扩展? about flarum HOT 5 OPEN

justjavac avatar justjavac commented on April 30, 2024
utf-8 url转译扩展?

from flarum.

Comments (5)

shangjiaxuan avatar shangjiaxuan commented on April 30, 2024

在讨论串里面点头像进中文用户名用户界面,目前默认不开新页面有时候能成功进入,但是有空格又不行。这里可能有另一个代码路线,也应该处理一下。(指在页面产生的url也要先编码好)

from flarum.

shangjiaxuan avatar shangjiaxuan commented on April 30, 2024

似乎英文标签如果有空格也有这个问题。应该如果能识别%20就能解决了

from flarum.

shangjiaxuan avatar shangjiaxuan commented on April 30, 2024

按最新的release,似乎也有人提到utf-8的问题,主要开发人员讲的是本地临时修改一点点应该不难,可以在主仓库开issue。

按我的理解应该主要改一下core/src/Http里面的东西就可以了(如果后续处理不管http不允许的字符,这里字符串改对应该就可以了?)?

(更好的当然是在每个需要的模块去改。。。)

from flarum.

shangjiaxuan avatar shangjiaxuan commented on April 30, 2024

具体实际在数据库查询的字符串如图:
https://forum.nepfan.club/assets/files/2019-12-03/1575371941-530726-en-space.png
https://forum.nepfan.club/assets/files/2019-12-03/1575371964-632641-cjk-string.png

from flarum.

shangjiaxuan avatar shangjiaxuan commented on April 30, 2024

用户名url的问题似乎可以在src/Api//Controller/ShowUserController.php里面的

protected function data(ServerRequestInterface $request, Document $document)

修改

if (! is_numeric($id)) {
    $id = $this->users->getIdForUsername($id);
}

if (! is_numeric($id)) {
    $id = $this->users->getIdForUsername(urldecode($id));
}

解决

from flarum.

Related Issues (16)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.