From 6928a0aaa84c34d85c589581de3ea68244669620 Mon Sep 17 00:00:00 2001 From: Wainui Witika-Park Date: Sun, 27 Jun 2021 04:16:04 +0000 Subject: [PATCH] Revert "Bug 28409: Comprehensively validate category in opac-shelves.pl" This reverts commit b2e542e783f6b9dea43d757a6b934880e2e44779. --- opac/opac-shelves.pl | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/opac/opac-shelves.pl b/opac/opac-shelves.pl index 3b10dfab52..9e5736d45a 100755 --- a/opac/opac-shelves.pl +++ b/opac/opac-shelves.pl @@ -60,15 +60,7 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user({ my $op = $query->param('op') || 'list'; my $referer = $query->param('referer') || $op; -my $category = 1; -if ( $query->param('category') && ( - ($query->param('category') == 1) || - ($query->param('category') == 2) - ) - ){ - $category = $query->param('category'); -} - +my $category = $query->param('category') || 1; my ( $shelf, $shelfnumber, @messages ); if ( $op eq 'add_form' ) { @@ -96,7 +88,7 @@ if ( $op eq 'add_form' ) { $shelf = Koha::Virtualshelf->new( { shelfname => scalar $query->param('shelfname'), sortfield => scalar $query->param('sortfield'), - category => $category || 1, + category => scalar $query->param('category') || 1, allow_change_from_owner => $allow_changes_from > 0, allow_change_from_others => $allow_changes_from == ANYONE, owner => scalar $loggedinuser, @@ -130,7 +122,7 @@ if ( $op eq 'add_form' ) { my $allow_changes_from = $query->param('allow_changes_from'); $shelf->allow_change_from_owner( $allow_changes_from > 0 ); $shelf->allow_change_from_others( $allow_changes_from == ANYONE ); - $shelf->category( $category ); + $shelf->category( scalar $query->param('category') ); eval { $shelf->store }; if ($@) { -- 2.39.5