X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fprofile_photo.php;h=64093b2de0fb4c062dbd3250f003963440e97761;hb=4a2d83fcfff548e50d3138ff617c0acd99445e03;hp=32ace62f0583580dd7060de3ca487712189c6dfb;hpb=b94cb8d234d70bc534ad1cef767b9f62d10eef26;p=friendica.git diff --git a/mod/profile_photo.php b/mod/profile_photo.php index 32ace62f05..64093b2de0 100644 --- a/mod/profile_photo.php +++ b/mod/profile_photo.php @@ -8,7 +8,6 @@ function profile_photo_init(&$a) { return; } - require_once("mod/profile.php"); profile_load($a,$a->user['nickname']); } @@ -42,7 +41,7 @@ function profile_photo_post(&$a) { $srcY = $_POST['ystart']; $srcW = $_POST['xfinal'] - $srcX; $srcH = $_POST['yfinal'] - $srcY; -//dbg(3); + $r = q("SELECT * FROM `photo` WHERE `resource-id` = '%s' AND `uid` = %d AND `scale` = %d LIMIT 1", dbesc($image_id), dbesc(local_user()), @@ -97,6 +96,7 @@ function profile_photo_post(&$a) { else notice( t('Unable to process image') . EOL); } + goaway($a->get_baseurl() . '/profiles'); return; // NOTREACHED } @@ -105,6 +105,14 @@ function profile_photo_post(&$a) { $filename = basename($_FILES['userfile']['name']); $filesize = intval($_FILES['userfile']['size']); + $maximagesize = get_config('system','maximagesize'); + + if(($maximagesize) && ($filesize > $maximagesize)) { + notice( t('Image exceeds size limit of ') . $maximagesize . EOL); + @unlink($src); + return; + } + $imagedata = @file_get_contents($src); $ph = new Photo($imagedata);