mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2025-12-07 01:26:11 -08:00
CSV Export - encode quotes #808
This commit is contained in:
@@ -524,6 +524,25 @@ function handleNull ($text, $default = "") {
|
||||
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------------------------
|
||||
// Encode special chars
|
||||
function encodeSpecialChars($str) {
|
||||
return str_replace(
|
||||
['&', '<', '>', '"', "'"],
|
||||
['&', '<', '>', '"', '''],
|
||||
$str
|
||||
);
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------------------------
|
||||
// Decode special chars
|
||||
function decodeSpecialChars($str) {
|
||||
return str_replace(
|
||||
['&', '<', '>', '"', '''],
|
||||
['&', '<', '>', '"', "'"],
|
||||
$str
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
// -------------------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user