mirror of
https://github.com/itflow-org/itflow
synced 2026-03-02 03:44:53 +00:00
added escape parameters to fputcsv to satisfy php 8.4 Depracations
This commit is contained in:
@@ -246,6 +246,8 @@ if (isset($_POST['export_products_csv'])) {
|
||||
|
||||
if ($num_rows > 0) {
|
||||
$delimiter = ",";
|
||||
$enclosure = '"';
|
||||
$escape = '\\'; // backslash
|
||||
$filename = "$session_company_name-Products.csv";
|
||||
|
||||
//create a file pointer
|
||||
@@ -253,12 +255,12 @@ if (isset($_POST['export_products_csv'])) {
|
||||
|
||||
//set column headers
|
||||
$fields = array('Product', 'Description', 'Price', 'Currency', 'Category', 'Tax');
|
||||
fputcsv($f, $fields, $delimiter);
|
||||
fputcsv($f, $fields, $delimiter, $enclosure, $escape);
|
||||
|
||||
//output each row of the data, format line as csv and write to file pointer
|
||||
while($row = mysqli_fetch_assoc($sql)) {
|
||||
$lineData = array($row['product_name'], $row['product_description'], $row['product_price'], $row['product_currency_code'], $row['category_name'], $row['tax_name']);
|
||||
fputcsv($f, $lineData, $delimiter);
|
||||
fputcsv($f, $lineData, $delimiter, $enclosure, $escape);
|
||||
}
|
||||
|
||||
//move back to beginning of file
|
||||
|
||||
Reference in New Issue
Block a user