2011-08-31 Miguel de Dios <miguel.dedios@artica.es>
* extensions/update_manager/lib/libupdate_manager_client.php, extensions/update_manager/main.php: fixed when the file is corrupted or empty. Fixes: #3400237 git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4861 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
1272ea9275
commit
149e5f5f57
|
@ -1,3 +1,11 @@
|
|||
2011-08-31 Miguel de Dios <miguel.dedios@artica.es>
|
||||
|
||||
* extensions/update_manager/lib/libupdate_manager_client.php,
|
||||
extensions/update_manager/main.php: fixed when the file is corrupted or
|
||||
empty.
|
||||
|
||||
Fixes: #3400237
|
||||
|
||||
2011-08-31 Miguel de Dios <miguel.dedios@artica.es>
|
||||
|
||||
* include/functions.php: fixed in function "string2image" when generate a
|
||||
|
|
|
@ -373,7 +373,9 @@ function um_client_print_update ($update, $settings) {
|
|||
}
|
||||
|
||||
function um_package_info_from_paths ($tmpDir) {
|
||||
$f = fopen($tmpDir.'info_package', "r");
|
||||
$f = @fopen($tmpDir.'info_package', "r");
|
||||
|
||||
if ($f !== false) {
|
||||
$f_content = fread($f, filesize($tmpDir.'info_package'));
|
||||
fclose($f);
|
||||
$f_array = array();
|
||||
|
@ -382,6 +384,10 @@ function um_package_info_from_paths ($tmpDir) {
|
|||
|
||||
return json_decode($f_content);
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function um_client_update_from_paths ($file_paths, $tmpDir, $num_package, $type) {
|
||||
global $config;
|
||||
|
|
|
@ -71,7 +71,10 @@ if (isset($_FILES["fileloaded"]["error"]) && !$_FILES["fileloaded"]["error"]) {
|
|||
}
|
||||
|
||||
$package = um_package_info_from_paths ($tempDir);
|
||||
|
||||
if ($package === false) {
|
||||
$error = '<h5 class="error">'.__('Error, the file package is empty or corrupted.').'</h5>';
|
||||
}
|
||||
else {
|
||||
$settings = um_db_load_settings ();
|
||||
|
||||
if($settings->current_update >= $package->id) {
|
||||
|
@ -137,6 +140,7 @@ if (isset($_FILES["fileloaded"]["error"]) && !$_FILES["fileloaded"]["error"]) {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
$error = '<h5 class="error">'.__('File cannot be uploaded').'</h5>';
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue