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)
1  2 
RELEASE-NOTES-1.21
includes/GlobalFunctions.php

diff --combined RELEASE-NOTES-1.21
@@@ -169,6 -169,8 +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.
    iicontinue).
  * Add supports for all pageset capabilities - generators, redirects, converttitles to
    action=purge and action=setnotificationtimestamp.
 +* (bug 43251) prop=pageprops&ppprop= now accepts multiple props to query.
  
  === API internal changes in 1.21 ===
  * For debugging only, a new global $wgDebugAPI removes many API restrictions when true.
    first one keeping its meaning. ApiPageSet is now derived from ApiBase.
  * BREAKING CHANGE: ApiQuery::newGenerator() and executeGeneratorModule() were deleted.
  * ApiQueryGeneratorBase::setGeneratorMode() now requires a pageset param.
 +* $wgAPIGeneratorModules is now obsolete and will be ignored.
 +* Added flags ApiResult::OVERRIDE and ADD_ON_TOP to setElement() and addValue()
  
  === Languages updated in 1.21 ===
  
@@@ -809,9 -809,14 +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'] = '';
                }
        }
  
@@@ -3206,7 -3211,6 +3211,7 @@@ function wfDoUpdates( $commit = '' ) 
   * @return string|bool The output number as a string, or false on error
   */
  function wfBaseConvert( $input, $sourceBase, $destBase, $pad = 1, $lowercase = true, $engine = 'auto' ) {
 +      $input = (string)$input;
        if(
                $sourceBase < 2 ||
                $sourceBase > 36 ||