X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fprofile_photo.php;h=c600dd1f868426c9759a89df47778540986c310a;hb=54905a3d81065915418af7f96953f957bf795300;hp=0b6dd8d13b31a73619d80fcbbfe4d26957b0c9f8;hpb=b6d11f21297331cda361ebadca3c1cf453027fdd;p=friendica.git diff --git a/mod/profile_photo.php b/mod/profile_photo.php index 0b6dd8d13b..c600dd1f86 100644 --- a/mod/profile_photo.php +++ b/mod/profile_photo.php @@ -133,9 +133,9 @@ function profile_photo_post(App &$a) { require_once('include/profile_update.php'); profile_change(); - } - else + } else { notice( t('Unable to process image') . EOL); + } } goaway(App::get_baseurl() . '/profiles'); @@ -146,11 +146,13 @@ function profile_photo_post(App &$a) { $filename = basename($_FILES['userfile']['name']); $filesize = intval($_FILES['userfile']['size']); $filetype = $_FILES['userfile']['type']; - if ($filetype=="") $filetype=guess_image_type($filename); - + if ($filetype == "") { + $filetype = guess_image_type($filename); + } + $maximagesize = get_config('system','maximagesize'); - if(($maximagesize) && ($filesize > $maximagesize)) { + if (($maximagesize) && ($filesize > $maximagesize)) { notice( sprintf(t('Image exceeds size limit of %s'), formatBytes($maximagesize)) . EOL); @unlink($src); return; @@ -159,7 +161,7 @@ function profile_photo_post(App &$a) { $imagedata = @file_get_contents($src); $ph = new Photo($imagedata, $filetype); - if(! $ph->is_valid()) { + if (! $ph->is_valid()) { notice( t('Unable to process image.') . EOL ); @unlink($src); return; @@ -168,7 +170,6 @@ function profile_photo_post(App &$a) { $ph->orient($src); @unlink($src); return profile_photo_crop_ui_head($a, $ph); - } @@ -204,7 +205,7 @@ function profile_photo_content(App &$a) { return; } $havescale = false; - foreach($r as $rr) { + foreach ($r as $rr) { if($rr['scale'] == 5) $havescale = true; }