that didn't work in every case.. this might work better

This commit is contained in:
Hannes Mannerheim 2016-01-12 05:06:16 +01:00
parent 734bff0946
commit 05bdb531a0

View File

@ -1256,10 +1256,8 @@ class QvitterPlugin extends Plugin {
} catch (Exception $e) {
// ugly fix if avatar is missing in the db but exists on the server
$avatar_profile_size = Avatar::byProfile($profile, AVATAR_PROFILE_SIZE);
$wildcard_avatar = str_replace('-'.AVATAR_PROFILE_SIZE.'-','-*-',$avatar_profile_size->filename);
$largest_avatar = array('name'=>false,'size'=>0);
foreach (glob('avatar/'.$wildcard_avatar) as $filename) {
foreach (glob('avatar/'.$profile->id.'-*') as $filename) {
$size = filesize($filename);
if($size > $largest_avatar['size']) {
$largest_avatar['size'] = $size;