Email subject in content language instead of sending user's UI language
[lhc/web/wiklou.git] / includes / HttpFunctions.php
index bff9b3e..9ab7447 100644 (file)
@@ -20,10 +20,11 @@ class Http {
        static function request( $method, $url, $timeout = 'default' ) {
                global $wgHTTPTimeout, $wgHTTPProxy, $wgVersion, $wgTitle;
 
+               wfDebug( __METHOD__ . ": $method $url\n" );
                # Use curl if available
                if ( function_exists( 'curl_init' ) ) {
                        $c = curl_init( $url );
-                       if ( wfIsLocalURL( $url ) ) {
+                       if ( self::isLocalURL( $url ) ) {
                                curl_setopt( $c, CURLOPT_PROXY, 'localhost:80' );
                        } else if ($wgHTTPProxy) {
                                curl_setopt($c, CURLOPT_PROXY, $wgHTTPProxy);
@@ -57,6 +58,10 @@ class Http {
                        if ( curl_getinfo( $c, CURLINFO_HTTP_CODE ) != 200 ) {
                                $text = false;
                        }
+                       # Don't return truncated output
+                       if ( curl_errno( $c ) != CURLE_OK ) {
+                               $text = false;
+                       }
                        curl_close( $c );
                } else {
                        # Otherwise use file_get_contents...