Issue #1468210 by marthinal, Eric_A, quicksketch: remove special ->uid == 1 check in filefield_validate_size().

8.0.x
Dries 2012-09-21 21:04:45 -04:00
parent 83a8e3af78
commit 91cf274fc9
1 changed files with 4 additions and 4 deletions

View File

@ -527,7 +527,6 @@ function file_validate_extensions(File $file, $extensions) {
*/
function file_validate_size(File $file, $file_limit = 0, $user_limit = 0) {
global $user;
$errors = array();
if ($file_limit && $file->filesize > $file_limit) {
@ -538,6 +537,7 @@ function file_validate_size(File $file, $file_limit = 0, $user_limit = 0) {
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)));
}
return $errors;
}