jenkins-bot has submitted this change and it was merged.
Change subject: WebRequest::getRequestURL: Follow up Ibe00a6b8
......................................................................
WebRequest::getRequestURL: Follow up Ibe00a6b8
* Only match consecutive slashes at the beginning of the URL, where
they are actually a problem.
* Fix bug 46607 in cases where the server provides an absolute URL.
Change-Id: Ibe00a6b8722786170d09b846c1c4054b73da3d9e
---
M includes/WebRequest.php
1 file changed, 3 insertions(+), 6 deletions(-)
Approvals:
MarkAHershberger: Verified; Looks good to me, approved
jenkins-bot: Verified
diff --git a/includes/WebRequest.php b/includes/WebRequest.php
index 739340c..3bdf645 100644
--- a/includes/WebRequest.php
+++ b/includes/WebRequest.php
@@ -656,14 +656,11 @@
}
if( $base[0] == '/' ) {
- if( isset( $base[1] ) && $base[1] == '/' ) { /* More
than one slash will look like it is protocol relative */
- return preg_replace( '!//*!', '/', $base );
- }
-
- return $base;
+ // More than one slash will look like it is protocol
relative
+ return preg_replace( '!^/+!', '/', $base );
} else {
// We may get paths with a host prepended; strip it.
- return preg_replace( '!^[^:]+://[^/]+/!', '/', $base );
+ return preg_replace( '!^[^:]+://[^/]+/+!', '/', $base );
}
}
--
To view, visit https://gerrit.wikimedia.org/r/56344
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ibe00a6b8722786170d09b846c1c4054b73da3d9e
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: PleaseStand <[email protected]>
Gerrit-Reviewer: MarkAHershberger <[email protected]>
Gerrit-Reviewer: Nikerabbit <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits