PMC-1498
This commit is contained in:
@@ -206,13 +206,10 @@ function importSkin ()
|
|||||||
if (!isset($_FILES['uploadedFile'])) {
|
if (!isset($_FILES['uploadedFile'])) {
|
||||||
throw (new Exception(G::LoadTranslation('ID_SKIN_FILE_REQUIRED')));
|
throw (new Exception(G::LoadTranslation('ID_SKIN_FILE_REQUIRED')));
|
||||||
}
|
}
|
||||||
$uploadedInstances = count( $_FILES['uploadedFile']['name'] );
|
|
||||||
$sw_error = false;
|
|
||||||
$sw_error_exists = isset( $_FILES['uploadedFile']['error'] );
|
|
||||||
$emptyInstances = 0;
|
|
||||||
$quequeUpload = array ();
|
|
||||||
|
|
||||||
// upload files & check for errors
|
$sw_error_exists = isset($_FILES['uploadedFile']['error']);
|
||||||
|
|
||||||
|
// Upload files & check for errors
|
||||||
$tmp = $_FILES['uploadedFile']['tmp_name'];
|
$tmp = $_FILES['uploadedFile']['tmp_name'];
|
||||||
$items = stripslashes($_FILES['uploadedFile']['name']);
|
$items = stripslashes($_FILES['uploadedFile']['name']);
|
||||||
if ($sw_error_exists) {
|
if ($sw_error_exists) {
|
||||||
@@ -226,23 +223,18 @@ function importSkin ()
|
|||||||
}
|
}
|
||||||
if ($up_err == 1 || $up_err == 2) {
|
if ($up_err == 1 || $up_err == 2) {
|
||||||
throw (new Exception(G::LoadTranslation('ID_FILE_TOO_BIG')));
|
throw (new Exception(G::LoadTranslation('ID_FILE_TOO_BIG')));
|
||||||
//$errors[$i]='miscfilesize';
|
|
||||||
}
|
}
|
||||||
if ($up_err == 3) {
|
if ($up_err == 3) {
|
||||||
throw (new Exception(G::LoadTranslation('ID_ERROR_UPLOAD_FILE_CONTACT_ADMINISTRATOR')));
|
throw (new Exception(G::LoadTranslation('ID_ERROR_UPLOAD_FILE_CONTACT_ADMINISTRATOR')));
|
||||||
//$errors[$i]='miscfilepart';
|
|
||||||
}
|
}
|
||||||
if (!@is_uploaded_file($tmp)) {
|
if (!@is_uploaded_file($tmp)) {
|
||||||
throw (new Exception(G::LoadTranslation('ID_ERROR_UPLOAD_FILE_CONTACT_ADMINISTRATOR')));
|
throw (new Exception(G::LoadTranslation('ID_ERROR_UPLOAD_FILE_CONTACT_ADMINISTRATOR')));
|
||||||
//$errors[$i]='uploadfile';
|
|
||||||
}
|
}
|
||||||
$fileInfo = pathinfo($items);
|
$fileInfo = pathinfo($items);
|
||||||
$validType = array ('tar','gz'
|
$validType = ['tar', 'gz'];
|
||||||
);
|
|
||||||
|
|
||||||
if (!in_array($fileInfo['extension'], $validType)) {
|
if (!in_array($fileInfo['extension'], $validType)) {
|
||||||
throw (new Exception(G::LoadTranslation('ID_FILE_UPLOAD_INCORRECT_EXTENSION')));
|
throw (new Exception(G::LoadTranslation('ID_FILE_UPLOAD_INCORRECT_EXTENSION')));
|
||||||
//$errors[$i]='wrongtype';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$filename = $items;
|
$filename = $items;
|
||||||
|
|||||||
Reference in New Issue
Block a user