diff --git a/extensions/Servers/Proxmox/Livewire/Firewall.php b/extensions/Servers/Proxmox/Livewire/Firewall.php index 29298a866..02de467d5 100644 --- a/extensions/Servers/Proxmox/Livewire/Firewall.php +++ b/extensions/Servers/Proxmox/Livewire/Firewall.php @@ -1653,11 +1653,11 @@ class Firewall extends Component if ($this->cachedStates === null || $this->cacheTimestamp === null || ($now - $this->cacheTimestamp) > self::STATE_CACHE_TTL) { - $this->cachedStates = $client->listStates(); + $this->cachedStates = $client->listStates() ?? []; $this->cacheTimestamp = $now; } - $allStates = $this->cachedStates; + $allStates = $this->cachedStates ?? []; // Normalize search parameters once $normalizedSourceIP = strtolower(trim($sourceIP)); diff --git a/extensions/Servers/Proxmox/views/firewall.blade.php b/extensions/Servers/Proxmox/views/firewall.blade.php index a22dde9dc..48458b8cf 100644 --- a/extensions/Servers/Proxmox/views/firewall.blade.php +++ b/extensions/Servers/Proxmox/views/firewall.blade.php @@ -1131,8 +1131,9 @@ rows.forEach(row => { csvContent += row.map(cell => { const str = String(cell); - if (str.includes(',') || str.includes('"') || str.includes('\n')) { - return '"' + str.replace(/"/g, '""') + '"'; + const dq = String.fromCharCode(34); + if (str.indexOf(',') !== -1 || str.indexOf(dq) !== -1 || str.indexOf('\n') !== -1) { + return dq + str.replace(new RegExp(dq, 'g'), dq + dq) + dq; } return str; }).join(',') + '\n'; @@ -1142,7 +1143,7 @@ const link = document.createElement('a'); const timestamp = new Date().toISOString().slice(0, 19).replace(/[T:]/g, '-'); link.href = URL.createObjectURL(blob); - link.download = `network-analysis-${this.sourceIP}-${timestamp}.csv`; + link.download = 'network-analysis-' + this.sourceIP + '-' + timestamp + '.csv'; link.click(); URL.revokeObjectURL(link.href); }