diff options
author | Friendika <info@friendika.com> | 2010-11-09 18:24:35 -0800 |
---|---|---|
committer | Friendika <info@friendika.com> | 2010-11-09 18:24:35 -0800 |
commit | f4fd67992812c5c356ff51e875077921a2222d90 (patch) | |
tree | 0ca3e25a5760c3d9d1598bca716f24767fe234fa /mod | |
parent | 70bcf000e3662266df8683d57269a0b75af60330 (diff) | |
download | volse-hubzilla-f4fd67992812c5c356ff51e875077921a2222d90.tar.gz volse-hubzilla-f4fd67992812c5c356ff51e875077921a2222d90.tar.bz2 volse-hubzilla-f4fd67992812c5c356ff51e875077921a2222d90.zip |
couple of issues w/ profile photo update propogation
Diffstat (limited to 'mod')
-rw-r--r-- | mod/dfrn_request.php | 2 | ||||
-rw-r--r-- | mod/photos.php | 8 | ||||
-rw-r--r-- | mod/profile_photo.php | 11 |
3 files changed, 20 insertions, 1 deletions
diff --git a/mod/dfrn_request.php b/mod/dfrn_request.php index 8c259f231..60106661c 100644 --- a/mod/dfrn_request.php +++ b/mod/dfrn_request.php @@ -192,6 +192,8 @@ function dfrn_request_post(&$a) { $network = 'dfrn'; } + logger('dfrn_request: url: ' . $url); + if(! strlen($url)) { notice( t("Unable to resolve your name at the provided location.") . EOL); return; diff --git a/mod/photos.php b/mod/photos.php index e1926bb56..addc04d76 100644 --- a/mod/photos.php +++ b/mod/photos.php @@ -453,6 +453,14 @@ function photos_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); diff --git a/mod/profile_photo.php b/mod/profile_photo.php index 32ace62f0..39808776b 100644 --- a/mod/profile_photo.php +++ b/mod/profile_photo.php @@ -42,7 +42,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 +97,7 @@ function profile_photo_post(&$a) { else notice( t('Unable to process image') . EOL); } + goaway($a->get_baseurl() . '/profiles'); return; // NOTREACHED } @@ -105,6 +106,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); |