1
1
Fork 0

couple of issues w/ profile photo update propogation

This commit is contained in:
Friendika 2010-11-09 18:24:35 -08:00
commit f4fd679928
7 changed files with 70 additions and 50 deletions

View file

@ -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;

View file

@ -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);

View file

@ -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);