X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=opac%2Fopac-ratings-ajax.pl;h=2d6c706f33b8d9956af2690e2f37f6dc30ace119;hb=6ca6fb45b6122d8d31a8e9d5e3168127373bb1f6;hp=a47484526ba7694602a0e5dc005b673334075457;hpb=482c96c4651d5b6eb86332637363707423c6c110;p=koha.git diff --git a/opac/opac-ratings-ajax.pl b/opac/opac-ratings-ajax.pl index a47484526b..2d6c706f33 100755 --- a/opac/opac-ratings-ajax.pl +++ b/opac/opac-ratings-ajax.pl @@ -4,18 +4,18 @@ # # This file is part of Koha. # -# Koha is free software; you can redistribute it and/or modify it under the -# terms of the GNU General Public License as published by the Free Software -# Foundation; either version 2 of the License, or (at your option) any later -# version. +# Koha is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. # -# Koha is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR -# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# Koha is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. # -# You should have received a copy of the GNU General Public License along -# with Koha; if not, write to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# You should have received a copy of the GNU General Public License +# along with Koha; if not, see . =head1 DESCRIPTION @@ -26,7 +26,7 @@ A script that takes an ajax json query, and then inserts or modifies a star-rati use strict; use warnings; -use CGI; +use CGI qw ( -utf8 ); use CGI::Cookie; # need to check cookies before having CGI parse the POST request use C4::Auth qw(:DEFAULT check_cookie_auth); @@ -67,10 +67,9 @@ else { } my $rating; +$rating_value //= ''; -undef $rating_value if $rating_value eq ''; - -if ( !$rating_value ) { +if ( $rating_value eq '' ) { #### delete $rating = DelRating( $biblionumber, $loggedinuser ); } @@ -106,7 +105,7 @@ exit; # a ratings specific ajax return sub, returns CGI object, and an 'auth_success' value sub ajax_auth_cgi { my $needed_flags = shift; - my %cookies = fetch CGI::Cookie; + my %cookies = CGI::Cookie->fetch; my $input = CGI->new; my $sessid = $cookies{'CGISESSID'}->value || $input->param('CGISESSID'); my ( $auth_status, $auth_sessid ) =