]> git.mxchange.org Git - friendica.git/commitdiff
Make the content type available after calling fetch_url
authorMatthew Exon <git.mexon@spamgourmet.com>
Mon, 1 Apr 2013 04:26:11 +0000 (12:26 +0800)
committerMatthew Exon <git.mexon@spamgourmet.com>
Mon, 1 Apr 2013 04:36:43 +0000 (12:36 +0800)
boot.php
include/network.php

index faaa124e0abc2666ff5644a2dfc6ef9bee4a8638..a44579323158a36a28264f6969f1dccca31e0a72 100644 (file)
--- a/boot.php
+++ b/boot.php
@@ -401,6 +401,7 @@ if(! class_exists('App')) {
                private $db;
 
                private $curl_code;
+               private $curl_content_type;
                private $curl_headers;
 
                private $cached_profile_image;
@@ -673,6 +674,14 @@ if(! class_exists('App')) {
                        return $this->curl_code;
                }
 
+               function set_curl_content_type($content_type) {
+                       $this->curl_content_type = $content_type;
+               }
+
+               function get_curl_content_type() {
+                       return $this->curl_content_type;
+               }
+
                function set_curl_headers($headers) {
                        $this->curl_headers = $headers;
                }
index e4d01c00fb46ea1a2cc3064a7da72ff809c3a746..5a36bd6a0043d506b9900cd00956d099f6847857 100644 (file)
@@ -101,6 +101,7 @@ function fetch_url($url,$binary = false, &$redirects = 0, $timeout = 0, $accept_
        }
 
        $a->set_curl_code($http_code);
+       $a->set_curl_content_type($curl_info['content_type']);
 
        $body = substr($s,strlen($header));
        $a->set_curl_headers($header);