Fix extra space from r64084
[lhc/web/wiklou.git] / includes / GlobalFunctions.php
index cd2c00e..36860e3 100644 (file)
@@ -9,7 +9,6 @@ if ( !defined( 'MEDIAWIKI' ) ) {
  */
 
 require_once dirname(__FILE__) . '/normal/UtfNormalUtil.php';
-require_once dirname(__FILE__) . '/XmlFunctions.php';
 
 // Hide compatibility functions from Doxygen
 /// @cond
@@ -1410,16 +1409,19 @@ function wfAppendQuery( $url, $query ) {
 
 /**
  * Expand a potentially local URL to a fully-qualified URL.  Assumes $wgServer
- * is correct.  Also doesn't handle any type of relative URL except one
- * starting with a single "/": this won't work with current-path-relative URLs
- * like "subdir/foo.html", protocol-relative URLs like
- * "//en.wikipedia.org/wiki/", etc.  TODO: improve this!
+ * and $wgProto are correct.
+ *
+ * @todo this won't work with current-path-relative URLs
+ * like "subdir/foo.html", etc.
  *
  * @param $url String: either fully-qualified or a local path + query
  * @return string Fully-qualified URL
  */
 function wfExpandUrl( $url ) {
-       if( substr( $url, 0, 1 ) == '/' ) {
+       if( substr( $url, 0, 2 ) == '//' ) {
+               global $wgProto;
+               return $wgProto . ':' . $url;
+       } elseif( substr( $url, 0, 1 ) == '/' ) {
                global $wgServer;
                return $wgServer . $url;
        } else {
@@ -2581,11 +2583,13 @@ function wfArrayMerge( $array1/* ... */ ) {
  *             array( 'y' )
  *     )
  */
-function wfMergeErrorArrays(/*...*/) {
+function wfMergeErrorArrays( /*...*/ ) {
        $args = func_get_args();
        $out = array();
        foreach ( $args as $errors ) {
                foreach ( $errors as $params ) {
+                       # FIXME: sometimes get nested arrays for $params,
+                       # which leads to E_NOTICEs
                        $spec = implode( "\t", $params );
                        $out[$spec] = $params;
                }
@@ -2808,15 +2812,6 @@ function wfCreateObject( $name, $p ){
        }
 }
 
-/**
- * Alias for modularized function
- * @deprecated Use Http::get() instead
- */
-function wfGetHTTP( $url ) {
-       wfDeprecated(__FUNCTION__);
-       return Http::get( $url );
-}
-
 /**
  * Alias for modularized function
  * @deprecated Use Http::isLocalURL() instead