User "Catrope" changed the status of MediaWiki.r94375.

Old Status: new
New Status: fixme

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

Full URL: 
https://secure.wikimedia.org/wikipedia/mediawiki/wiki/Special:Code/MediaWiki/94375#c20722
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:

<pre>
+               $url = wfExpandUrl( $url );
</pre>
Calling <code>wfExpandUrl()</code> is not the same as prepending 
<code>$wgServer</code> since I rewrote <code>wfExpandUrl()</code> recently. You 
will now need to use <code>wfExpandUrl( $url, PROTO_RELATIVE )</code> to 
achieve the same effect. With the current code, a protocol-relative 
<code>$wgServer</code> will lead to <code>getFullUrl()</code> returning HTTP 
URLs for HTTP requests and HTTPS URLs for HTTPS requests, leading to cache 
pollution (of the parser cache if nothing else).

Looks good to me otherwise.

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

Reply via email to