diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/quotes-upload.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/quotes-upload.tt index 21fa005afe..827cbd471d 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/quotes-upload.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/quotes-upload.tt @@ -263,7 +263,7 @@ contentType : "application/x-www-form-urlencoded", // we must claim this mimetype or CGI will not decode the URL encoding dataType : "json", data : { - "quote" : JSON.stringify(oTable.fnGetData()), + "quote" : encodeURI ( JSON.stringify(oTable.fnGetData()) ), "action" : "add", }, success : function(){ diff --git a/tools/quotes/quotes-upload_ajax.pl b/tools/quotes/quotes-upload_ajax.pl index 179c645c1a..727280c9e7 100755 --- a/tools/quotes/quotes-upload_ajax.pl +++ b/tools/quotes/quotes-upload_ajax.pl @@ -22,6 +22,7 @@ use warnings; use CGI qw ( -utf8 ); use JSON; +use URI::Escape; use autouse 'Data::Dumper' => qw(Dumper); use C4::Auth; @@ -40,8 +41,9 @@ unless ($status eq "ok") { } my $success = 'true'; +my $quotes_tmp = uri_unescape( $cgi->param('quote' ) ); +my $quotes = decode_json( $quotes_tmp ); -my $quotes = decode_json($cgi->param('quote')); my $action = $cgi->param('action'); my $sth = $dbh->prepare('INSERT INTO quotes (source, text) VALUES (?, ?);');