Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F5680
GlobalFunctions.php.patch
Public
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Authored By
•
bzimport
Nov 21 2014, 10:36 PM
2014-11-21 22:36:45 (UTC+0)
Size
752 B
Referenced Files
None
Subscribers
None
GlobalFunctions.php.patch
View Options
--- ../prod/base/w/includes/GlobalFunctions.php 2009-02-22 19:38:43.000000000 -0500
+++ ../prod/pool/w/includes/GlobalFunctions.php 2009-05-03 17:56:57.000000000 -0400
@@ -1199,9 +1199,20 @@
* @return string Fully-qualified URL
*/
function wfExpandUrl( $url ) {
+ // Allow for both site- and protocol-relative URLs
if( substr( $url, 0, 1 ) == '/' ) {
global $wgServer;
- return $wgServer . $url;
+ if ( substr( $url, 0, 2 ) == '//' ) {
+ // Try to extract the protocol from the server
+ if ( $protocolPos = strpos( $wgServer, '//' ) ) {
+ $protocol = substr( $wgServer, 0, $protocolPos );
+ return $protocol . $url;
+ } else {
+ return $url;
+ }
+ } else {
+ return $wgServer . $url;
+ }
} else {
return $url;
}
File Metadata
Details
Attached
Mime Type
text/x-diff
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5230
Default Alt Text
GlobalFunctions.php.patch (752 B)
Attached To
Mode
T20664: Relative URIs in interwiki links table causes failed redirects
Attached
Detach File
Event Timeline
Log In to Comment