(bug 22647) Add category details in search results. Contributed by Lejonel.
[lhc/web/wiklou.git] / includes / HttpFunctions.php
index d5dc243..5bf7050 100644 (file)
@@ -27,6 +27,7 @@ class Http {
         * @returns mixed (bool)false on failure or a string on success
         */
        public static function request( $method, $url, $options = array() ) {
+               $url = wfExpandUrl( $url );
                wfDebug( "HTTP: $method: $url" );
                $options['method'] = strtoupper( $method );
                if ( !isset( $options['timeout'] ) ) {
@@ -210,6 +211,15 @@ class HttpRequest {
                return $this->content;
        }
 
+       /**
+        * Set the parameters of the request
+        * @param $params array
+        * @todo overload the args param
+        */
+       public function setData($args) {
+               $this->postData = $args;
+       }
+
        /**
         * Take care of setting up the proxy
         * (override in subclass)
@@ -295,6 +305,8 @@ class HttpRequest {
        public function execute() {
                global $wgTitle;
 
+               $this->content = "";
+
                if( strtoupper($this->method) == "HEAD" ) {
                        $this->headersOnly = true;
                }