mirror of
https://github.com/friendica/friendica
synced 2025-04-24 23:50:20 +00:00
Curl Response Refactoring
- refactored Network::getCurl() - replaced every Network::getCur() execution with a Curl Response
This commit is contained in:
parent
7c73e8634c
commit
ffbc688797
9 changed files with 30 additions and 30 deletions
|
@ -720,17 +720,18 @@ class Image
|
|||
*
|
||||
* @param string $filename Image filename
|
||||
* @param boolean $fromcurl Check Content-Type header from curl request
|
||||
* @param string $header passed headers to take into account
|
||||
*
|
||||
* @return object
|
||||
*/
|
||||
public static function guessType($filename, $fromcurl = false)
|
||||
public static function guessType($filename, $fromcurl = false, $header = '')
|
||||
{
|
||||
logger('Image: guessType: '.$filename . ($fromcurl?' from curl headers':''), LOGGER_DEBUG);
|
||||
$type = null;
|
||||
if ($fromcurl) {
|
||||
$a = get_app();
|
||||
$headers=[];
|
||||
$h = explode("\n", Network::getCurl()->getHeaders());
|
||||
$h = explode("\n", $header);
|
||||
foreach ($h as $l) {
|
||||
$data = array_map("trim", explode(":", trim($l), 2));
|
||||
if (count($data) > 1) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue