From 5b158dbcfbe99eddc06eb7d931e7ef5ac8fbc58c Mon Sep 17 00:00:00 2001 From: Matthew Exon Date: Mon, 1 Apr 2013 12:26:11 +0800 Subject: [PATCH] Make the content type available after calling fetch_url --- boot.php | 9 +++++++++ include/network.php | 1 + 2 files changed, 10 insertions(+) diff --git a/boot.php b/boot.php index faaa124e0a..a445793231 100644 --- 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; } diff --git a/include/network.php b/include/network.php index e4d01c00fb..5a36bd6a00 100644 --- a/include/network.php +++ b/include/network.php @@ -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); -- 2.39.5