阻止MediaWiki中链接中字符的URL编码 [英] Prevent URL-encoding of characters in link in MediaWiki

查看:131
本文介绍了阻止MediaWiki中链接中字符的URL编码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

即:如何在MediaWiki链接中禁止使用其HTML实体替换/替换字符?

我需要插入一个链接看起来像这样,管道( | )包含在MediaWiki文章中:

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

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

目标网站在其URL中不接受%7C | 作为管道替代品。以下网址无效:

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






当我键入MediaWiki文章中的链接,如:


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

,无效。

任何建议?

推荐答案

这不是一个有效的URI;根据 RFC 3986 ,URI由字符 ALPHA / 数字 / - / 。 /_/〜/:///? /#/[/]/@/! /$/& /'/(/)/*/+/,/; /=;其他一切都必须是百分比编码的。 MediaWiki会自动更正无效网址(和其他任何CMS一样),所以如果这个维基是由别人拥有的,那么你就不幸了。如果是您的,您可以使用一些方法来避免内置的HTML处理(例如启用< html> 标签);确保你知道你在做什么,这通常有安全性后果。

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.

这篇关于阻止MediaWiki中链接中字符的URL编码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆