Partially revert changes for the RC
This commit is contained in:
@@ -890,6 +890,9 @@ class User
|
||||
if (in_array($photo['type'], ['image/png', 'image/gif'])) {
|
||||
$imagetype = IMAGETYPE_PNG;
|
||||
}
|
||||
} else {
|
||||
// Only for the RC phase: Don't return an image link for the default picture
|
||||
return '';
|
||||
}
|
||||
|
||||
return $url . $user['nickname'] . image_type_to_extension($imagetype) . ($updated ? '?ts=' . strtotime($updated) : '');
|
||||
|
||||
@@ -46,6 +46,30 @@ class Images
|
||||
return $m;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return file extension for mime type
|
||||
* @param string $mimetype
|
||||
* @return string
|
||||
*/
|
||||
public static function getExtensionByMimeType(string $mimetype): string
|
||||
{
|
||||
switch ($mimetype) {
|
||||
case 'image/png':
|
||||
$imagetype = IMAGETYPE_PNG;
|
||||
break;
|
||||
|
||||
case 'image/gif':
|
||||
$imagetype = IMAGETYPE_GIF;
|
||||
break;
|
||||
|
||||
default:
|
||||
$imagetype = IMAGETYPE_JPC;
|
||||
break;
|
||||
}
|
||||
|
||||
return image_type_to_extension($imagetype);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns supported image mimetypes and corresponding file extensions
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user