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:
Ian Berry committed 2003-11-14 05:03:35 +00:00
1 parent a0ef63947e
commit 9bd2eb0da2
1 file changed
+3 -1
+3 -1
View File
@@ -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);