cfaa25f667
- enable debug logging for image proxy - show enclosure image only if no article content exists - do not store empty favicons - fix typo in get_item_favicons (worked anyway since get_favicons returned all known favicons instead)
29 lines
527 B
PHP
29 lines
527 B
PHP
<?php
|
|
|
|
namespace Model\Proxy;
|
|
|
|
use Model\Config;
|
|
use PicoFeed\Client\Client;
|
|
use PicoFeed\Client\ClientException;
|
|
|
|
function download($url)
|
|
{
|
|
try {
|
|
$client = Client::getInstance();
|
|
$client->setUserAgent(Config\HTTP_USER_AGENT);
|
|
$client->execute($url);
|
|
|
|
$content = array(
|
|
$client->getContent(),
|
|
$client->getContentType(),
|
|
);
|
|
}
|
|
catch (ClientException $e) {
|
|
$content = array(false, false);
|
|
}
|
|
|
|
Config\write_debug();
|
|
|
|
return $content;
|
|
}
|