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:
mdtrooper 2011-08-31 12:35:09 +00:00
parent 1272ea9275
commit 149e5f5f57
3 changed files with 82 additions and 64 deletions

View File

@ -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

View File

@ -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();
@ -381,6 +383,10 @@ function um_package_info_from_paths ($tmpDir) {
unset($f_content->status);
return json_decode($f_content);
}
else {
return false;
}
}
function um_client_update_from_paths ($file_paths, $tmpDir, $num_package, $type) {

View File

@ -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) {
@ -136,6 +139,7 @@ if (isset($_FILES["fileloaded"]["error"]) && !$_FILES["fileloaded"]["error"]) {
}
}
}
}
}
else {
$error = '<h5 class="error">'.__('File cannot be uploaded').'</h5>';