PasteCSV fix + code cleanup
This commit is contained in:
@@ -464,20 +464,19 @@ function ExportCSV() {
|
||||
//------------------------------------------------------------------------------
|
||||
function ImportCSV() {
|
||||
|
||||
global $db;
|
||||
$file = '../../../config/devices.csv';
|
||||
$data = "";
|
||||
$skipped = "";
|
||||
$error = "";
|
||||
|
||||
// check if content passed in query string
|
||||
if(isset ($_REQUEST['content']) && !empty ($_REQUEST['content']))
|
||||
if(isset ($_POST['content']) && !empty ($_POST['content']))
|
||||
{
|
||||
|
||||
// Decode the Base64 string
|
||||
$data = base64_decode($_REQUEST['content']);
|
||||
$data = base64_decode($_POST['content']);
|
||||
|
||||
} else if (file_exists($file)) { // try to get the data form the file
|
||||
global $db;
|
||||
$skipped = "";
|
||||
$error = "";
|
||||
|
||||
// Read the CSV file
|
||||
$data = file_get_contents($file);
|
||||
|
||||
Reference in New Issue
Block a user