Bugzilla – Attachment 47463 Details for
Bug 15684
Fix encoding issues with quote upload
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 15684: Fix encoding issues with quote upload
Bug-15684-Fix-encoding-issues-with-quote-upload.patch (text/plain), 2.41 KB, created by
Kyle M Hall (khall)
on 2016-01-29 12:12:23 UTC
(
hide
)
Description:
Bug 15684: Fix encoding issues with quote upload
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2016-01-29 12:12:23 UTC
Size:
2.41 KB
patch
obsolete
>From 001851cac51a4aec1a530c9aa05f3530870ab571 Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?Marc=20V=C3=A9ron?= <veron@veron.ch> >Date: Thu, 28 Jan 2016 22:05:58 +0100 >Subject: [PATCH] Bug 15684: Fix encoding issues with quote upload > >To verify: >- Download attachment 'Goethe with umlaut' from Bug 15684 >- Go to Tools > Quote Editor >- Click "Import quotes" and select the file >- The quotes display in a table. Click 'Sav quotes' >- Result: Nothing happens > >To test: >- Apply patch >- Repeat steps above >- Verify that you get a message '2 quotes saved' and that the quotes > are added in to the quotes table >- Test with attachment 'sample quotes' as well > >Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net> > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > koha-tmpl/intranet-tmpl/prog/en/modules/tools/quotes-upload.tt | 2 +- > tools/quotes/quotes-upload_ajax.pl | 4 +++- > 2 files changed, 4 insertions(+), 2 deletions(-) > >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 21fa005..827cbd4 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 179c645..727280c 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 (?, ?);'); >-- >2.1.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 15684
:
47358
|
47404
|
47405
|
47411
|
47415
| 47463