Bug 29744: Remove unnecessary condition in C4::Auth::safe_exit

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
[EDIT] Adding David's comments from Bugzilla to safe_exit here.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
David Cook 2022-04-20 05:27:32 +00:00 committed by Tomas Cohen Arazi
parent 0b80172a49
commit 97b1bd1dae
No known key found for this signature in database
GPG Key ID: 0A272EA1B2F3C15F
1 changed files with 4 additions and 2 deletions

View File

@ -56,9 +56,11 @@ use Koha::CookieManager;
use vars qw($ldap $cas $caslogout);
our (@ISA, @EXPORT_OK);
#NOTE: The utility of keeping the safe_exit function is that it can be easily re-defined in unit tests and plugins
sub safe_exit {
if (C4::Context::psgi_env) { die 'psgi:exit' }
else { exit }
# It's fine for us to "exit" because CGI::Compile (used in Plack::App::WrapCGI) redefines "exit" for us automatically.
# Since we only seem to use C4::Auth::safe_exit in a CGI context, we don't actually need PSGI detection at all here.
exit;
}