diff options
-rw-r--r-- | include/Photo.php | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/include/Photo.php b/include/Photo.php index 3eccbb5fb..3ce531c44 100644 --- a/include/Photo.php +++ b/include/Photo.php @@ -656,7 +656,9 @@ function import_profile_photo($photo,$xchan) { $a = get_app(); - $r = q("select `resource_id` from photo where xchan = '%s' and `scale` = 4 limit 1", + logger('import_profile_photo: updating channel photo from ' . $photo . ' for ' . $xchan, LOGGER_DEBUG); + + $r = q("select resource_id from photo where xchan = '%s' and scale = 4 limit 1", dbesc($xchan) ); if($r) { @@ -668,6 +670,7 @@ function import_profile_photo($photo,$xchan) { $photo_failure = false; + $filename = basename($photo); $img_str = fetch_url($photo,true); @@ -700,9 +703,10 @@ function import_profile_photo($photo,$xchan) { $thumb = $a->get_baseurl() . '/photo/' . $hash . '-5'; $micro = $a->get_baseurl() . '/photo/' . $hash . '-6'; } - else + else { + logger('import_profile_photo: invalid image from ' . $photo); $photo_failure = true; - + } if($photo_failure) { $photo = $a->get_baseurl() . '/images/person-175.jpg'; $thumb = $a->get_baseurl() . '/images/person-80.jpg'; |