Replace Function strtoAZaz09() with toAlphanumeric()

This commit is contained in:
johnnyq
2026-07-14 17:30:13 -04:00
parent 8de3cd300d
commit 31cc3f3ac3
3 changed files with 5 additions and 5 deletions

View File

@@ -1166,7 +1166,7 @@ if (isset($_GET['download_assets_csv_template'])) {
$delimiter = ","; $delimiter = ",";
$enclosure = '"'; $enclosure = '"';
$escape = '\\'; $escape = '\\';
$filename = strtoAZaz09($client_name) . "-Assets-Template.csv"; $filename = toAlphanumeric($client_name) . "-Assets-Template.csv";
//create a file pointer //create a file pointer
$f = fopen('php://memory', 'w'); $f = fopen('php://memory', 'w');
@@ -1813,7 +1813,7 @@ if (isset($_GET['download_client_asset_interfaces_csv_template'])) {
$delimiter = ","; $delimiter = ",";
$enclosure = '"'; $enclosure = '"';
$escape = '\\'; $escape = '\\';
$filename = strtoAZaz09($asset_name) . "-Asset-Interfaces-Template.csv"; $filename = toAlphanumeric($asset_name) . "-Asset-Interfaces-Template.csv";
//create a file pointer //create a file pointer
$f = fopen('php://memory', 'w'); $f = fopen('php://memory', 'w');
@@ -1859,7 +1859,7 @@ if (isset($_POST['export_client_asset_interfaces_csv'])) {
$delimiter = ","; $delimiter = ",";
$enclosure = '"'; $enclosure = '"';
$escape = '\\'; // backslash $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 //create a file pointer
$f = fopen('php://memory', 'w'); $f = fopen('php://memory', 'w');

View File

@@ -2063,7 +2063,7 @@ if (isset($_POST["export_client_pdf"])) {
$pdf->writeHTML($html, true, false, true, false, ""); $pdf->writeHTML($html, true, false, true, false, "");
// Output the PDF document for download // 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; exit;
} }

View File

@@ -51,7 +51,7 @@ function cleanInput($input) {
return $input; return $input;
} }
function strtoAZaz09($string) function toAlphanumeric($string)
{ {
// Gets rid of non-alphanumerics // Gets rid of non-alphanumerics
return preg_replace('/[^A-Za-z0-9_-]/', '', $string); return preg_replace('/[^A-Za-z0-9_-]/', '', $string);