Siebrand has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/56372


Change subject: Prevent PHP notice by adding isset() check
......................................................................

Prevent PHP notice by adding isset() check

Bug: 46627
Change-Id: Ida87efc622e9e90b835473f069559817565eafc1
---
M includes/WebRequest.php
1 file changed, 3 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/72/56372/1

diff --git a/includes/WebRequest.php b/includes/WebRequest.php
index 30a51b0..739340c 100644
--- a/includes/WebRequest.php
+++ b/includes/WebRequest.php
@@ -654,10 +654,12 @@
                if( $hash !== false ) {
                        $base = substr( $base, 0, $hash );
                }
+
                if( $base[0] == '/' ) {
-                       if( $base[1] == '/' ) { /* More than one slash will 
look like it is protocol relative */
+                       if( isset( $base[1] ) && $base[1] == '/' ) { /* More 
than one slash will look like it is protocol relative */
                                return preg_replace( '!//*!', '/', $base );
                        }
+
                        return $base;
                } else {
                        // We may get paths with a host prepended; strip it.

-- 
To view, visit https://gerrit.wikimedia.org/r/56372
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ida87efc622e9e90b835473f069559817565eafc1
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Siebrand <[email protected]>

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

Reply via email to