}
}
- static function fromAvatar($avatar)
+ static function fromAvatar(Avatar $avatar)
{
- if (empty($avatar)) {
- return null;
- }
$alink = new AvatarLink();
$alink->type = $avatar->mediatype;
$alink->height = $avatar->height;
// yuck!
static function mediatype($filename) {
- $ext = strtolower(end(explode('.', $filename)));
+ $parts = explode('.', $filename);
+ $ext = strtolower(end($parts));
if ($ext == 'jpeg') {
$ext = 'jpg';
}