diff options
author | Robin Appelman <icewind@owncloud.com> | 2013-01-03 15:59:17 +0100 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2013-01-03 15:59:17 +0100 |
commit | e40be93e87e5a401039f0ce1a3e47e9a44635936 (patch) | |
tree | 25a3cbe8b62447e9b0dde39590034f248981f561 /apps/files/ajax | |
parent | 6a6d6756b7a6495d044d44c8d6081505880d96b9 (diff) | |
parent | b673748151b4e46b03592459f6eea4e250fc473a (diff) | |
download | nextcloud-server-e40be93e87e5a401039f0ce1a3e47e9a44635936.tar.gz nextcloud-server-e40be93e87e5a401039f0ce1a3e47e9a44635936.zip |
merge master into filesystem
Diffstat (limited to 'apps/files/ajax')
-rw-r--r-- | apps/files/ajax/upload.php | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/apps/files/ajax/upload.php b/apps/files/ajax/upload.php index f40679f5756..b6ae69f1e30 100644 --- a/apps/files/ajax/upload.php +++ b/apps/files/ajax/upload.php @@ -8,14 +8,15 @@ OCP\JSON::setContentTypeHeader('text/plain'); OCP\JSON::checkLoggedIn(); OCP\JSON::callCheck(); +$l=OC_L10N::get('files'); if (!isset($_FILES['files'])) { - OCP\JSON::error(array('data' => array( 'message' => 'No file was uploaded. Unknown error' ))); + OCP\JSON::error(array('data' => array( 'message' => $l->t( 'No file was uploaded. Unknown error' )))); exit(); } + foreach ($_FILES['files']['error'] as $error) { if ($error != 0) { - $l=OC_L10N::get('files'); $errors = array( UPLOAD_ERR_OK=>$l->t('There is no error, the file uploaded with success'), UPLOAD_ERR_INI_SIZE=>$l->t('The uploaded file exceeds the upload_max_filesize directive in php.ini: ') @@ -64,7 +65,7 @@ if(strpos($dir, '..') === false) { OCP\JSON::encodedPrint($result); exit(); } else { - $error='invalid dir'; + $error=$l->t( 'Invalid directory.' ); } -OCP\JSON::error(array('data' => array('error' => $error, 'file' => $fileName))); +OCP\JSON::error(array('data' => array('message' => $error ))); |