Joomla encodes my link targets inside my component

2019-08-14 03:03发布

Searched for a while now. I'm using newest Joomla Version 3.3.6 (with Gantry Framework) and am trying to create an own component for it. The problem I have is: I need to use links that contain special characters like spaces. Joomla seems to encode or rewrite these links and replaces the special characters with HTML code.

Example out of my components view file (hard coded):

<a href="index.html#test like" title="test like">test like</a>

Becomes when opened in frontend:

<a href="index.html#test%20like" title="test like">test like</a>

I'm now looking for the function that does this "trick" to hack this behaviour out of it, but can't find it yet. Hope someone can help me.

标签: joomla
1条回答
smile是对你的礼貌
2楼-- · 2019-08-14 03:37

Spaces are unsafe characters in URLs/URIs and therefore need to be encoded. This is because significant sequences of spaces may be lost in some uses (especially multiple spaces).

When a space is encoded it becomes %20 in hex. This is behaviour that is correct and you should not try to change as it will make your URL/URI unsafe.

For more information about unsafe and reserved characters check out the following links.

http://www.blooberry.com/indexdot/html/topics/urlencoding.htm

http://perishablepress.com/stop-using-unsafe-characters-in-urls/

查看更多
登录 后发表回答