Merge "Allow adding arbitrary properties to OutputPage"
[lhc/web/wiklou.git] / includes / GlobalFunctions.php
index ce52c74..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'] = '';
                }
        }
 
@@ -2622,12 +2627,14 @@ function wfPercent( $nr, $acc = 2, $round = true ) {
 /**
  * Find out whether or not a mixed variable exists in a string
  *
+ * @deprecated Just use str(i)pos
  * @param $needle String
  * @param $str String
  * @param $insensitive Boolean
  * @return Boolean
  */
 function in_string( $needle, $str, $insensitive = false ) {
+       wfDeprecated( __METHOD__, '1.21' );
        $func = 'strpos';
        if( $insensitive ) $func = 'stripos';
 
@@ -3204,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 ||