summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2009-06-09 21:33:12 +0000
committerDries Buytaert <dries@buytaert.net>2009-06-09 21:33:12 +0000
commit5b6680861b4c211ee0df48e982e134d5d54f9a50 (patch)
tree695b96ec2938114ad9c8af27e42a47c50abd93dd /includes
parent7e4fb51913c97d8a8778711bccfa4da94513e8ed (diff)
downloadbrdo-5b6680861b4c211ee0df48e982e134d5d54f9a50.tar.gz
brdo-5b6680861b4c211ee0df48e982e134d5d54f9a50.tar.bz2
- Patch #197266 by drewish: added code comment.
Diffstat (limited to 'includes')
-rw-r--r--includes/file.inc3
1 files changed, 2 insertions, 1 deletions
diff --git a/includes/file.inc b/includes/file.inc
index d649364c1..bb9a6a594 100644
--- a/includes/file.inc
+++ b/includes/file.inc
@@ -1121,6 +1121,7 @@ function file_validate_size($file, $file_limit = 0, $user_limit = 0) {
$errors[] = t('The file is %filesize exceeding the maximum file size of %maxsize.', array('%filesize' => format_size($file->filesize), '%maxsize' => format_size($file_limit)));
}
+ // Save a query by only calling file_space_used() when a limit is provided.
if ($user_limit && (file_space_used($user->uid) + $file->filesize) > $user_limit) {
$errors[] = t('The file is %filesize which would exceed your disk quota of %quota.', array('%filesize' => format_size($file->filesize), '%quota' => format_size($user_limit)));
}
@@ -1597,4 +1598,4 @@ function drupal_chmod($path, $mode = NULL) {
/**
* @} End of "defgroup file".
- */ \ No newline at end of file
+ */