User "Catrope" posted a comment on MediaWiki.r94375.

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

Touch up Title::get[Full|Local]URL. This concept of "if not an existing 
interwiki getFullURL calls getLocalURL" and "if external (interwiki) 
getLocalURL calls getFullURL" is ridiculous. In fact if mInterwiki just happens 
to not be '' and not exist, you create infinite recursion and php dies.
Instead of having getFullURL and getLocalURL call each other, move the 
interwiki workload into getLocalURL, and make getFullURL simply call 
getLocalURL then expand it (use the wf method in case it's already a full url) 
and append the fragment to it.

Comment:

We are going to use protocol-relative $wgServer on Wikimedia, so we can 
*replace* the secure gateway with 'real' HTTPS. I've worked on improving 
support for protocol-relative URLs in MediaWiki over the past few weeks. Things 
like <code><nowiki>[{{fullurl:Foo}} Bar]</nowiki></code> would then expand to 
<code><nowiki>[//example.com/wiki/Foo Bar]</nowiki></code>, you're right about 
that, so I added support for that kind of link as well.

I do worry about the parser cache because interwiki targets can be 
protocol-relative, so interwiki links can pollute it.

wfExpandUrl DOES NOT unexpand and re-expand. 
<code><nowiki>wfExpandUrl('http://foo', PROTO_HTTPS) == 
'http://foo'</nowiki></code>. So we don't need to add a new PROTO_ option or 
any of that.

As to what the default behavior of wfExpandUrl (in terms of PROTO_*) should be, 
that's an interesting question.

Your comment seems to be mostly based on misconceptions as to what 
wfExpandUrl() does; could you reformulate it based on what it actually does?

_______________________________________________
MediaWiki-CodeReview mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview

Reply via email to