summaryrefslogtreecommitdiff
path: root/classes
diff options
context:
space:
mode:
authorCraig Andrews <candrews@integralblue.com>2009-07-22 10:24:34 -0400
committerCraig Andrews <candrews@integralblue.com>2009-07-22 10:24:34 -0400
commit684fc5d002998abd352f4e1c00c1a9a77cd91e53 (patch)
tree48383aafe019cc943692c6191170a421c3d0952b /classes
parente70a79d6ab5e9cd8894490d4fc0d3b855e807edc (diff)
parent28b62f357d80d86e17f9688d65809cb959f4be6c (diff)
Merge commit 'br3nda/0.8.x-attachmentfix' into 0.8.x
Diffstat (limited to 'classes')
-rw-r--r--classes/File.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/classes/File.php b/classes/File.php
index 68d385d1e..0c4fbf7e6 100644
--- a/classes/File.php
+++ b/classes/File.php
@@ -122,6 +122,7 @@ class File extends Memcached_DataObject
}
function isRespectsQuota($user,$fileSize) {
+
if ($fileSize > common_config('attachments', 'file_quota')) {
return sprintf(_('No file may be larger than %d bytes ' .
'and the file you sent was %d bytes. Try to upload a smaller version.'),
@@ -135,8 +136,7 @@ class File extends Memcached_DataObject
if ($total > common_config('attachments', 'user_quota')) {
return sprintf(_('A file this large would exceed your user quota of %d bytes.'), common_config('attachments', 'user_quota'));
}
-
- $query .= ' month(modified) = month(now()) and year(modified) = year(now())';
+ $query .= ' AND EXTRACT(month FROM file.modified) = EXTRACT(month FROM now()) and EXTRACT(year FROM file.modified) = EXTRACT(year FROM now())';
$this->query($query);
$this->fetch();
$total = $this->total + $fileSize;