Merge "(bug 45069) wfParseUrl() no longer produces a PHP notice if passed a "mailto...
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Wed, 20 Feb 2013 15:42:16 +0000 (15:42 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Wed, 20 Feb 2013 15:42:16 +0000 (15:42 +0000)
RELEASE-NOTES-1.21
includes/GlobalFunctions.php

index 6143030..2eca857 100644 (file)
@@ -169,6 +169,8 @@ production.
 * (bug 43964) Invalid value of "link" parameter in <gallery> no longer produces
   a fatal error.
 * (bug 44775) The username field is not pre-filled when creating an account.
+* (bug 45069) wfParseUrl() no longer produces a PHP notice if passed a "mailto:"
+  URL without address
 
 === API changes in 1.21 ===
 * prop=revisions can now report the contentmodel and contentformat.
index 0e5fddc..be862e7 100644 (file)
@@ -809,9 +809,14 @@ function wfParseUrl( $url ) {
        if ( !isset( $bits['host'] ) ) {
                $bits['host'] = '';
 
-               /* parse_url loses the third / for file:///c:/ urls (but not on variants) */
-               if ( substr( $bits['path'], 0, 1 ) !== '/' ) {
-                       $bits['path'] = '/' . $bits['path'];
+               // bug 45069
+               if ( isset( $bits['path'] ) ) {
+                       /* parse_url loses the third / for file:///c:/ urls (but not on variants) */
+                       if ( substr( $bits['path'], 0, 1 ) !== '/' ) {
+                               $bits['path'] = '/' . $bits['path'];
+                       }
+               } else {
+                       $bits['path'] = '';
                }
        }