mirror of
https://github.com/Cacti/cacti.git
synced 2026-11-08 21:16:17 +09:00
fix errors if the user selects nothing and clicks 'save'
git-svn-id: svn+ssh://repo.cacti.net/var/data/svnroot/cacti/trunk/cacti@1378 860744bd-22fc-0310-8c96-e9fe5004b5ca
This commit is contained in:
1 parent
a0ef63947e
commit
9bd2eb0da2
1 file changed
+3
-1
@@ -53,11 +53,13 @@ function form_save() {
|
||||
if (trim($_POST["import_text"] != "")) {
|
||||
/* textbox input */
|
||||
$xml_data = $_POST["import_text"];
|
||||
}elseif ($_FILES["import_file"]["tmp_name"] != "none") {
|
||||
}elseif (($_FILES["import_file"]["tmp_name"] != "none") && ($_FILES["import_file"]["tmp_name"] != "")) {
|
||||
/* file upload */
|
||||
$fp = fopen($_FILES["import_file"]["tmp_name"],"r");
|
||||
$xml_data = fread($fp,filesize($_FILES["import_file"]["tmp_name"]));
|
||||
fclose($fp);
|
||||
}else{
|
||||
header("Location: templates_import.php"); exit;
|
||||
}
|
||||
|
||||
$_SESSION["import_debug_info"] = import_xml_data($xml_data);
|
||||
|
||||
Reference in new issue
Block a user