Prevent URL-encoding of characters in link in MediaWiki

假装没事ソ 提交于 2020-01-23 04:12:27

问题


I.e.: How to suppress substitution/replacement of characters with its html entities in a MediaWiki link?

I need to insert a link looking like this, pipes (|) included, into a MediaWiki article:

http://www.somesite.asdf/#|param1|param2|param3

The target site does not accept %7C or | as pipe-substitutes in its URL. Ergo, the following URLs are invalid:

http://www.somesite.asdf/#%7Cparam1%7Cparam2%7Cparam3
http://www.somesite.asdf/#|param1|param2|param3

When I type the link into the MediaWiki-article like:

http://www.somesite.asdf/#|param1|param2|param3

... it results in a link pointing to:

http://www.somesite.asdf/#%7Cparam1%7Cparam2%7Cparam3

, which is not valid.

Any suggestions?


回答1:


That is not a valid URI; per RFC 3986, an URI consists of the characters ALPHA / DIGIT / "-" / "." / "_" / "~" / ":" / "/" / "?" / "#" / "[" / "]" / "@" / "!" / "$" / "&" / "'" / "(" / ")" / "*" / "+" / "," / ";" / "="; everything else must be percent-encoded. MediaWiki automatically corrects invalid URLs (as would any other CMS, probably), so if this wiki is owned by someone else, you are out of luck. If it is yours, you can use some method to avoid the built-in HTML processing (e. g. enable the <html> tag); make sure you know what you are doing, this usually has security consequences.



来源:https://stackoverflow.com/questions/12653058/prevent-url-encoding-of-characters-in-link-in-mediawiki

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!