summaryrefslogtreecommitdiff
path: root/classes/File.php
diff options
context:
space:
mode:
Diffstat (limited to 'classes/File.php')
-rw-r--r--classes/File.php9
1 files changed, 4 insertions, 5 deletions
diff --git a/classes/File.php b/classes/File.php
index 56d9f9827..0c4fbf7e6 100644
--- a/classes/File.php
+++ b/classes/File.php
@@ -79,9 +79,8 @@ class File extends Memcached_DataObject
if (isset($redir_data['type'])
&& ('text/html' === substr($redir_data['type'], 0, 9))
- && ($oembed_data = File_oembed::_getOembed($given_url))
- && isset($oembed_data['json'])) {
- File_oembed::saveNew($oembed_data['json'], $file_id);
+ && ($oembed_data = File_oembed::_getOembed($given_url))) {
+ File_oembed::saveNew($oembed_data, $file_id);
}
return $x;
}
@@ -123,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.'),
@@ -136,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;