diff options
author | Sebastian Egbers <sebastian@egbers.info> | 2012-06-26 08:33:41 +0200 |
---|---|---|
committer | Sebastian Egbers <sebastian@egbers.info> | 2012-06-26 08:33:41 +0200 |
commit | 0f0fb2e2f3b9819e4f1b65c3ea1b96e78c008381 (patch) | |
tree | 8f38f64f6239f1c132b0e2118a4a9b42ba801752 /mod/wall_attach.php | |
parent | 8c251aebc77a6daacfe20598fc861df4c243a726 (diff) | |
parent | a4b407eb54c67a0c9b8137b44fbd20b43eccb224 (diff) | |
download | volse-hubzilla-0f0fb2e2f3b9819e4f1b65c3ea1b96e78c008381.tar.gz volse-hubzilla-0f0fb2e2f3b9819e4f1b65c3ea1b96e78c008381.tar.bz2 volse-hubzilla-0f0fb2e2f3b9819e4f1b65c3ea1b96e78c008381.zip |
Merge branch 'master' of https://github.com/friendica/friendica
Diffstat (limited to 'mod/wall_attach.php')
-rw-r--r-- | mod/wall_attach.php | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/mod/wall_attach.php b/mod/wall_attach.php index 03d9f5105..f179b3ca5 100644 --- a/mod/wall_attach.php +++ b/mod/wall_attach.php @@ -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(); |