deprecate a->get_curl_code() and $a->get_curl_headers()

This commit is contained in:
friendica
2013-12-01 00:16:02 -08:00
parent 3163731a3d
commit bd33e0486d
5 changed files with 20 additions and 400 deletions

View File

@@ -473,19 +473,19 @@ abstract class photo_driver {
* @arg $fromcurl boolean Check Content-Type header from curl request
*/
function guess_image_type($filename, $fromcurl=false) {
function guess_image_type($filename, $headers = '') {
logger('Photo: guess_image_type: '.$filename . ($fromcurl?' from curl headers':''), LOGGER_DEBUG);
$type = null;
if ($fromcurl) {
if ($headers) {
$a = get_app();
$headers=array();
$h = explode("\n",$a->get_curl_headers());
$hdrs=array();
$h = explode("\n",$headers);
foreach ($h as $l) {
list($k,$v) = array_map("trim", explode(":", trim($l), 2));
$headers[$k] = $v;
$hdrs[$k] = $v;
}
if (array_key_exists('Content-Type', $headers))
$type = $headers['Content-Type'];
if (array_key_exists('Content-Type', $hdrs))
$type = $hdrs['Content-Type'];
}
if (is_null($type)){
// FIXME!!!!