summaryrefslogtreecommitdiffstats
path: root/vendor/ipl/web/src/Compat/StyleWithNonce.php
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 11:30:22 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 11:30:22 +0000
commit9919ea7a76a4bf1eaffe5e288ab82dcafeb775ce (patch)
treeb00a07aca10f581c2be69d612a0a397a415eeb6b /vendor/ipl/web/src/Compat/StyleWithNonce.php
parentReleasing progress-linux version 0.13.1-1~progress7.99u1. (diff)
downloadicinga-php-library-9919ea7a76a4bf1eaffe5e288ab82dcafeb775ce.tar.xz
icinga-php-library-9919ea7a76a4bf1eaffe5e288ab82dcafeb775ce.zip
Merging upstream version 0.13.2.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/ipl/web/src/Compat/StyleWithNonce.php')
-rw-r--r--vendor/ipl/web/src/Compat/StyleWithNonce.php8
1 files changed, 5 insertions, 3 deletions
diff --git a/vendor/ipl/web/src/Compat/StyleWithNonce.php b/vendor/ipl/web/src/Compat/StyleWithNonce.php
index f4c7185..8c1be31 100644
--- a/vendor/ipl/web/src/Compat/StyleWithNonce.php
+++ b/vendor/ipl/web/src/Compat/StyleWithNonce.php
@@ -2,6 +2,7 @@
namespace ipl\Web\Compat;
+use Icinga\Application\Icinga;
use Icinga\Application\Version;
use Icinga\Util\Csp;
use ipl\Web\Style;
@@ -15,9 +16,10 @@ class StyleWithNonce extends Style
public function getNonce(): ?string
{
if ($this->nonce === null) {
- $this->nonce = version_compare(Version::VERSION, '2.12.0', '>=')
- ? Csp::getStyleNonce() ?? ''
- : '';
+ $this->nonce = '';
+ if (version_compare(Version::VERSION, '2.12.0', '>=') && Icinga::app()->isWeb()) {
+ $this->nonce = Csp::getStyleNonce() ?? '';
+ }
}
return parent::getNonce();