Test in Ostatus_profile if avatar is an image before writing to filesystem

This clears one FIXME...

We also fix HTTPClient::quickGet() (and a related call in OStatus testfeed.php).
This commit is contained in:
Mikael Nordfeldth
2015-01-27 13:49:26 +01:00
parent cdd3c52633
commit cc996f58db
3 changed files with 11 additions and 11 deletions

View File

@@ -177,10 +177,12 @@ class HTTPClient extends HTTP_Request2
/**
* Quick static function to GET a URL
*/
public static function quickGet($url, $accept='text/html,application/xhtml+xml')
public static function quickGet($url, $accept=null)
{
$client = new HTTPClient();
$client->setHeader('Accept', $accept);
if (!is_null($accept)) {
$client->setHeader('Accept', $accept);
}
$response = $client->get($url);
if (!$response->isOk()) {
// TRANS: Exception. %s is a profile URL.