fix csv sanitizations

This commit is contained in:
root 2025-01-29 08:48:51 +01:00
parent 53f988fa75
commit 61cf769fc2
2 changed files with 9 additions and 0 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 34 KiB

Before After
Before After

View file

@ -11,6 +11,15 @@ if (($handle = fopen($csvfile, "r")) !== FALSE) {
while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) {
//PREVENT ALL MALICIOUS PHP PAYLOADS FROM BEING EXECUTED FROM CSV FILES!
$data[0] = htmlspecialchars($data[0]);
$data[1] = htmlspecialchars($data[1]);
$data[2] = htmlspecialchars($data[2]);
$data[3] = htmlspecialchars($data[3]);
$data[4] = htmlspecialchars($data[4]);
$data[5] = htmlspecialchars($data[5]);
$data[6] = htmlspecialchars($data[6]);
$data[7] = htmlspecialchars($data[7]);
$data[0]=preg_replace("/[^a-zA-Z0-9:\/.\ -✔️❌]/", "", $data[0]);
$data[1]=preg_replace("/[^a-zA-Z0-9:\/.\ -✔️❌]/", "", $data[1]);
$data[2]=preg_replace("/[^a-zA-Z0-9:\/.\ -✔️❌]/", "", $data[2]);