mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-08 08:57:03 +03:00
Make CSP entries unique
This commit is contained in:
parent
529d727189
commit
0e347625e3
1 changed files with 6 additions and 6 deletions
|
|
@ -35,20 +35,20 @@ class CSP
|
||||||
function __toString() : string
|
function __toString() : string
|
||||||
{
|
{
|
||||||
$params = [
|
$params = [
|
||||||
'base-uri ' . \implode(' ', $this->base),
|
'base-uri ' . \implode(' ', \array_unique($this->base)),
|
||||||
'default-src ' . \implode(' ', $this->default)
|
'default-src ' . \implode(' ', \array_unique($this->default))
|
||||||
];
|
];
|
||||||
if ($this->script) {
|
if ($this->script) {
|
||||||
$params[] = 'script-src ' . \implode(' ', $this->script);
|
$params[] = 'script-src ' . \implode(' ', \array_unique($this->script));
|
||||||
}
|
}
|
||||||
if ($this->img) {
|
if ($this->img) {
|
||||||
$params[] = 'img-src ' . \implode(' ', $this->img);
|
$params[] = 'img-src ' . \implode(' ', \array_unique($this->img));
|
||||||
}
|
}
|
||||||
if ($this->style) {
|
if ($this->style) {
|
||||||
$params[] = 'style-src ' . \implode(' ', $this->style);
|
$params[] = 'style-src ' . \implode(' ', \array_unique($this->style));
|
||||||
}
|
}
|
||||||
if ($this->frame) {
|
if ($this->frame) {
|
||||||
$params[] = 'frame-src ' . \implode(' ', $this->frame);
|
$params[] = 'frame-src ' . \implode(' ', \array_unique($this->frame));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Deprecated
|
// Deprecated
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue