From 571cad1e2691c68d885a199f917580ad6450aed6 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Mon, 2 Feb 2026 10:02:23 +0000 Subject: [PATCH] Bug 38365: Fix no-op //= operator on variable declarations The //= (defined-or assignment) operator on a freshly declared variable is a no-op since the variable is always undef at that point. Replace with simple = assignment. Affects header_name(), header_value(), and is_enabled() methods. Signed-off-by: David Cook Signed-off-by: Lari Taskula --- Koha/ContentSecurityPolicy.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Koha/ContentSecurityPolicy.pm b/Koha/ContentSecurityPolicy.pm index 79c8bc99ca1..de17672e813 100644 --- a/Koha/ContentSecurityPolicy.pm +++ b/Koha/ContentSecurityPolicy.pm @@ -84,7 +84,7 @@ sub new { sub header_name { my ( $self, $args ) = @_; - my $interface //= $args->{interface} || C4::Context->interface; + my $interface = $args->{interface} || C4::Context->interface; my $conf_csp = $self->{config}->get('content_security_policy'); @@ -119,7 +119,7 @@ sub header_name { sub header_value { my ( $self, $args ) = @_; - my $interface //= $args->{interface} || C4::Context->interface; + my $interface = $args->{interface} || C4::Context->interface; my $conf_csp = $self->{config}->get('content_security_policy'); @@ -153,7 +153,7 @@ sub header_value { sub is_enabled { my ( $self, $args ) = @_; - my $interface //= $args->{interface} || C4::Context->interface; + my $interface = $args->{interface} || C4::Context->interface; my $conf_csp = $self->{config}->get('content_security_policy'); -- 2.39.5