mirror of
https://git.friendi.ca/friendica/friendica.git
synced 2025-06-17 02:45:16 +02:00
typos in bbcode, add service class restrictions to jot uploads
This commit is contained in:
parent
89ad19ce01
commit
b044cd922d
5 changed files with 40 additions and 11 deletions
|
@ -60,6 +60,19 @@ function wall_attach_post(&$a) {
|
|||
return;
|
||||
}
|
||||
|
||||
$r = q("select sum(octet_length(data)) as total from attach where uid = %d ",
|
||||
intval($page_owner_uid)
|
||||
);
|
||||
|
||||
$limit = service_class_fetch($page_owner_uid,'attach_upload_limit');
|
||||
|
||||
if(($limit !== false) && (($r[0]['total'] + strlen($imagedata)) > $limit)) {
|
||||
echo upgrade_message(true) . EOL ;
|
||||
@unlink($src);
|
||||
killme();
|
||||
}
|
||||
|
||||
|
||||
$filedata = @file_get_contents($src);
|
||||
$mimetype = z_mime_content_type($filename);
|
||||
$hash = random_string();
|
||||
|
|
|
@ -79,6 +79,19 @@ function wall_upload_post(&$a) {
|
|||
killme();
|
||||
}
|
||||
|
||||
$r = q("select sum(octet_length(data)) as total from photo where uid = %d and scale = 0 and album != 'Contact Photos' ",
|
||||
intval($page_owner_uid)
|
||||
);
|
||||
|
||||
$limit = service_class_fetch($page_owner_uid,'photo_upload_limit');
|
||||
|
||||
if(($limit !== false) && (($r[0]['total'] + strlen($imagedata)) > $limit)) {
|
||||
echo upgrade_message(true) . EOL ;
|
||||
@unlink($src);
|
||||
killme();
|
||||
}
|
||||
|
||||
|
||||
$imagedata = @file_get_contents($src);
|
||||
$ph = new Photo($imagedata, $filetype);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue