diff --git a/agent/post/asset.php b/agent/post/asset.php index 9795ee9d..cb9f5f36 100644 --- a/agent/post/asset.php +++ b/agent/post/asset.php @@ -1166,7 +1166,7 @@ if (isset($_GET['download_assets_csv_template'])) { $delimiter = ","; $enclosure = '"'; $escape = '\\'; - $filename = strtoAZaz09($client_name) . "-Assets-Template.csv"; + $filename = toAlphanumeric($client_name) . "-Assets-Template.csv"; //create a file pointer $f = fopen('php://memory', 'w'); @@ -1813,7 +1813,7 @@ if (isset($_GET['download_client_asset_interfaces_csv_template'])) { $delimiter = ","; $enclosure = '"'; $escape = '\\'; - $filename = strtoAZaz09($asset_name) . "-Asset-Interfaces-Template.csv"; + $filename = toAlphanumeric($asset_name) . "-Asset-Interfaces-Template.csv"; //create a file pointer $f = fopen('php://memory', 'w'); @@ -1859,7 +1859,7 @@ if (isset($_POST['export_client_asset_interfaces_csv'])) { $delimiter = ","; $enclosure = '"'; $escape = '\\'; // backslash - $filename = strtoAZaz09($asset_name) . "-Interfaces-" . date('Y-m-d') . ".csv"; + $filename = toAlphanumeric($asset_name) . "-Interfaces-" . date('Y-m-d') . ".csv"; //create a file pointer $f = fopen('php://memory', 'w'); diff --git a/agent/post/client.php b/agent/post/client.php index 89d43fd4..d87cbe61 100644 --- a/agent/post/client.php +++ b/agent/post/client.php @@ -2063,7 +2063,7 @@ if (isset($_POST["export_client_pdf"])) { $pdf->writeHTML($html, true, false, true, false, ""); // Output the PDF document for download - $pdf->Output(strtoAZaz09($client_name) . "-IT_Documentation-" . date("Y-m-d") . ".pdf", "D"); + $pdf->Output(toAlphanumeric($client_name) . "-IT_Documentation-" . date("Y-m-d") . ".pdf", "D"); exit; } diff --git a/functions/sanitize.php b/functions/sanitize.php index 02fbf757..9c9961b0 100644 --- a/functions/sanitize.php +++ b/functions/sanitize.php @@ -51,7 +51,7 @@ function cleanInput($input) { return $input; } -function strtoAZaz09($string) +function toAlphanumeric($string) { // Gets rid of non-alphanumerics return preg_replace('/[^A-Za-z0-9_-]/', '', $string);