User "Dantman" posted a comment on MediaWiki.r94373.

Full URL: 
https://secure.wikimedia.org/wikipedia/mediawiki/wiki/Special:Code/MediaWiki/94373#c20708
Commit summary:

Improve the ability for extensions to participate in how MediaWiki handles url 
paths:
- Allow extensions to hook into WebRequest::getPathInfo and add to or alter the 
way titles are extracted from paths
- Add a $variant argument to the GetLocalURL hook; It's always had $query, but 
never had $variant. As a result extensions using GetLocalURL never new if 
getLocalURL and have the possibility of trying to change the url in cases where 
they shouldn't and as a result breaking links on wiki with language variants.
- Add GetLocalURL::Internal hook for non-interwiki links. These kinds of links 
internally use a ugly hack for action=render and an extension using GetLocalURL 
can be buggy in render mode if they don't re-implement the same ugly hack that 
MW does. This ::Internal hook runs before the hack does so extension authors 
don't need to be exposed to our ugly hacky code.
- Add GetLocalURL::Article hook specifically for url tweaks to pretty urls (ie: 
Only when we would apply $wgArticlePath); This hook avoids the need for 
extensions that only want to tweak pretty url output. This hook avoids the need 
to make a bunch of tests for things like !$title->isExternal(), $query == '', 
and $variant === false which getLocalURL does and could potentially change in 
the future making wider GetLocalURL hooks change in function requiring 
extension updates.

Comment:

The & is really only there for consistency. It practically has no meaning, but 
since GetLocalURL already has it there, I just kept the pattern instead of 
messing with things.

_______________________________________________
MediaWiki-CodeReview mailing list
mediawiki-coderev...@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview

Reply via email to