Bug 20019: use Modern::Perl in misc perl scripts
[srvgit] / tags / review.pl
index 009966d..353e741 100755 (executable)
@@ -19,8 +19,7 @@
 # You should have received a copy of the GNU General Public License
 # along with Koha; if not, see <http://www.gnu.org/licenses>.
 
-use warnings;
-use strict;
+use Modern::Perl;
 use Data::Dumper;
 use POSIX;
 use CGI qw ( -utf8 );
@@ -63,13 +62,13 @@ if (is_ajax()) {
        my ($tag, $js_reply);
        if ($tag = $input->param('test')) {
                my $check = is_approved($tag);
-        $js_reply = ( $check >=  1 ? 'success' : $check <= -1 ? 'failure' : 'indeterminate' ) . "_test('".uri_escape($tag)."');\n";
+        $js_reply = ( $check >=  1 ? 'success' : $check <= -1 ? 'failure' : 'indeterminate' ) . "_test('".uri_escape_utf8($tag)."');\n";
        }
        if ($tag = $input->param('ok')) {
-        $js_reply = (   whitelist($operator,$tag) ? 'success' : 'failure') . "_approve('".uri_escape($tag)."');\n";
+        $js_reply = (   whitelist($operator,$tag) ? 'success' : 'failure') . "_approve('".uri_escape_utf8($tag)."');\n";
        } 
        if ($tag = $input->param('rej')) {
-        $js_reply = (   blacklist($operator,$tag) ? 'success' : 'failure')  . "_reject('".uri_escape($tag)."');\n";
+        $js_reply = (   blacklist($operator,$tag) ? 'success' : 'failure')  . "_reject('".uri_escape_utf8($tag)."');\n";
        }
        output_with_http_headers $input, undef, $js_reply, 'js';
        exit;