Greetings,
MediaWiki, in its grandmotherly kindness, automatically converts plain text unmarked URLs like "http://google.com" into "<a href="http://google.com" class="external free" title="http://google.com" rel="nofollow">http://google.com</a> when rendering. Is there any sensible way to disable this? I couldn't find a public configuration option for this, although these are apparently a subtype of magic links(*) and I'd be happy to disable magic links completely if need be. Commenting out "$text = $this->doMagicLinks( $text );" or stabbing at the regexp in said function in Parser.php works, but, eww.
(*) http://www.mediawiki.org/wiki/Markup_spec/BNF/Magic_links
Cheers, -jani
Maybe you could modify this array? http://www.mediawiki.org/wiki/Manual:$wgUrlProtocols
http://www.mediawiki.org/wiki/Manual:$wgUrlProtocolsAK
On Thu, Jul 22, 2010 at 6:25 PM, Jani Patokallio jpatokal@iki.fi wrote:
Greetings,
MediaWiki, in its grandmotherly kindness, automatically converts plain text unmarked URLs like "http://google.com" into "<a href="http://google.com" class="external free" title="http://google.com" rel="nofollow">http://google.com</a> when rendering. Is there any sensible way to disable this? I couldn't find a public configuration option for this, although these are apparently a subtype of magic links(*) and I'd be happy to disable magic links completely if need be. Commenting out "$text = $this->doMagicLinks( $text );" or stabbing at the regexp in said function in Parser.php works, but, eww.
(*) http://www.mediawiki.org/wiki/Markup_spec/BNF/Magic_links
Cheers, -jani
Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
On Fri, Jul 23, 2010 at 12:04 AM, Alex Kozak akozak@creativecommons.org wrote:
Maybe you could modify this array? http://www.mediawiki.org/wiki/Manual:$wgUrlProtocols
That won't do what he wants. That array is responsible for all sorts of things, and removing things like "http://" from it will break everything. I don't know offhand if there's a way to do it, but this isn't it.
Ah, ok my apologies. Maybe you could add a note describing some of the things that would break to http://www.mediawiki.org/wiki/Manual:$wgUrlProtocols?
- Alex
On Fri, Jul 23, 2010 at 9:22 AM, Aryeh Gregor <Simetrical+wikilist@gmail.comSimetrical%2Bwikilist@gmail.com
wrote:
On Fri, Jul 23, 2010 at 12:04 AM, Alex Kozak akozak@creativecommons.org wrote:
Maybe you could modify this array? http://www.mediawiki.org/wiki/Manual:$wgUrlProtocols
That won't do what he wants. That array is responsible for all sorts of things, and removing things like "http://" from it will break everything. I don't know offhand if there's a way to do it, but this isn't it.
Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
On Fri, Jul 23, 2010 at 12:41 PM, Alex Kozak akozak@creativecommons.org wrote:
Ah, ok my apologies. Maybe you could add a note describing some of the things that would break to http://www.mediawiki.org/wiki/Manual:$wgUrlProtocols?
I've corrected some inaccuracies on that page. I'm not even going to *try* to predict what would break if you removed things like 'http:' from the array -- link parsing would break throughout the software.
Aryeh Gregor wrote:
On Fri, Jul 23, 2010 at 12:41 PM, Alex Kozak akozak@creativecommons.org wrote:
Ah, ok my apologies. Maybe you could add a note describing some of the things that would break to http://www.mediawiki.org/wiki/Manual:$wgUrlProtocols?
I've corrected some inaccuracies on that page. I'm not even going to *try* to predict what would break if you removed things like 'http:' from the array -- link parsing would break throughout the software.
I don't see anything obvious breaking. Of course, external links stop working, both plain and in [], also magic external images, and the captcha won't detect it as addition of urls. But all of that seems expected behavior on removing http from $wgUrlProtocols.
You mentioned Special:LinkSearch and wfParseUrl(), but LinkSearch has nothing to search if you don't allow external links, and wfParseUrl() is only used inside the parser (precisely to work with the previously matched external urls).
On Fri, Jul 23, 2010 at 7:04 PM, Platonides Platonides@gmail.com wrote:
I don't see anything obvious breaking. Of course, external links stop working, both plain and in [], also magic external images, and the captcha won't detect it as addition of urls. But all of that seems expected behavior on removing http from $wgUrlProtocols.
It's not what he asked for. He only asked for disabling bare links, not explicit external links like [http://...].
You mentioned Special:LinkSearch and wfParseUrl(), but LinkSearch has nothing to search if you don't allow external links, and wfParseUrl() is only used inside the parser (precisely to work with the previously matched external urls).
It also looks like it will break API pretty-printing (see ApiFormatBase::formatHTML()), and do something in Sanitizer::safeEncodeAttribute() (not sure what), and prohibit use of <a href=""> and <img src=""> if those are enabled, and break any scripts that use wgUrlProtocols, and do something unexpected to the 'edithelppage' message functionality by breaking Skin::makeInternalOrExternalUrl(), and break the 'sidebar' message if you use URLs as keys, and break stripping of URLs during section anchor generation (Parser::stripSectionName()), and undoubtedly various other things that I didn't spot in this cursory inspection, not even counting extensions.
So, yeah, I'm going to stand by "don't ever remove stuff like http:// from $wgUrlProtocols".
wikitech-l@lists.wikimedia.org