[Bug 9951] New: Resolve encoding problems where script parameters are not decoded
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9951 Bug ID: 9951 Summary: Resolve encoding problems where script parameters are not decoded Classification: Unclassified Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: gmcharlt@gmail.com Reporter: m.de.rooy@rijksmuseum.nl Bug 6554 corrects the handling of UTF-8 in template processing. This may actually reveal some bugs at other places in Koha where cgi parameters are not decoded. (I resolved some of these places with some followups for 6554, but like to freeze that report now.) There is an easy fix. We have two options: 1 Add the -utf8 parameter when using CGI at the start of the script. 2 Decode the parameters individually where utf8 chars are to be expected. For both methods, we could say something. I will send a mail to the dev list also to trigger a discussion and hopefully reach a best [Koha?] practice. I you still find such an instance, add it here and possibly include a patch. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9951 M. de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |6554 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9951 --- Comment #1 from M. de Rooy <m.de.rooy@rijksmuseum.nl> --- I took some time to glance through all opac scripts. With the following results: A nice one to start with: opac-password.pl: The password may contain diacritics. It should be decoded. But this needs a dive into C4/Auth.pm also (and probably in staff too). And we still have the problem with old incorrect hashes in the table. If you would have a old password with diacritics, you would still like to login. This is not just adding a flag to CGI, but a report on its own. So I leave that for now; these hashes still work :) Most scripts look fine to me; some have been corrected already. I only have some doubts on: ilsdi.pl oai.pl search.pl tracklinks.pl -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9951 Dobrica Pavlinusic <dpavlin@rot13.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dpavlin@rot13.org -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9951 M. de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9951 --- Comment #2 from M. de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 17124 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=17124&action=edit Bug 9951: Followup for Tools Adds decoding for Patron Cards/Patron Search and Tags (moderation). Test plan: Goto Tools. Add accent with diacritics in both areas. Check if you do not see converted characters. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9951 --- Comment #3 from M. de Rooy <m.de.rooy@rijksmuseum.nl> --- It seems that the scripts that are posting data generally do not have problems (at this moment..) but when GET is used for searching on names etc., we need to decode the parameters. This has to do with CGI.pm internals: the GET params are coming from the environment, the POST values are read from STDIN. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9951 M. de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Trivial patch Assignee|gmcharlt@gmail.com |m.de.rooy@rijksmuseum.nl -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9951 --- Comment #4 from M. de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 17128 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=17128&action=edit Bug 9951: Followup for tools/viewlog.pl Adds utf8 cgi parameter decoding. Test plan: Enter diacritics in librarian field. Submit. Check. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9951 Chris Cormack <chris@bigballofwax.co.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #17124|0 |1 is obsolete| | --- Comment #5 from Chris Cormack <chris@bigballofwax.co.nz> --- Created attachment 17221 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=17221&action=edit Bug 9951: Followup for Tools Adds decoding for Patron Cards/Patron Search and Tags (moderation). Test plan: Goto Tools. Add accent with diacritics in both areas. Check if you do not see converted characters. Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9951 Chris Cormack <chris@bigballofwax.co.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9951 Chris Cormack <chris@bigballofwax.co.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #17128|0 |1 is obsolete| | --- Comment #6 from Chris Cormack <chris@bigballofwax.co.nz> --- Created attachment 17222 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=17222&action=edit Bug 9951: Followup for tools/viewlog.pl Adds utf8 cgi parameter decoding. Test plan: Enter diacritics in librarian field. Submit. Check. Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> This is ok in this case, as we are not doing any post/get of binary data, but I note from the man page This makes CGI.pm treat all parameters as UTF-8 strings. Use this with care, as it will interfere with the processing of binary uploads. It is better to manually select which fields are expected to return utf-8 strings and convert them using code like this: use Encode; my $arg = decode utf8=>param('foo'); -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9951 --- Comment #7 from M. de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to comment #6)
Created attachment 17222 [details] [review] This is ok in this case, as we are not doing any post/get of binary data, but I note from the man page
This makes CGI.pm treat all parameters as UTF-8 strings. Use this with care, as it will interfere
Thx for your SO. I discussed this also with Dobrica on the original report 6554. I did not yet send a message to the list. Currently, both approaches are used in Koha. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9951 M. de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |http://bugs.koha-community. | |org/bugzilla3/show_bug.cgi? | |id=10019 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9951 M. de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA --- Comment #8 from M. de Rooy <m.de.rooy@rijksmuseum.nl> --- Taking the liberty to let this pass qa now too in connection with 6554 and the other encoding reports. Note that these small patches are actually qa followups for 6554. So not a real patch coming from me :) Passed QA -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9951 Jared Camins-Esakov <jcamins@cpbibliography.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master --- Comment #9 from Jared Camins-Esakov <jcamins@cpbibliography.com> --- This patch has been pushed to master and 3.12.x. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9951 M. de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to Master |RESOLVED Resolution|--- |WONTFIX --- Comment #10 from M. de Rooy <m.de.rooy@rijksmuseum.nl> --- Has been reverted. Closing this bug. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9951 Bug 9951 depends on bug 6554, which changed state. Bug 6554 Summary: Resolve encoding problems with corrected UTF8 handling in templates http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6554 What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |RESOLVED Resolution|--- |DUPLICATE -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9951 Bug 9951 depends on bug 6554, which changed state. Bug 6554 Summary: Resolve encoding problems with corrected UTF8 handling in templates http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6554 What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |REOPENED Resolution|DUPLICATE |--- -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9951 Bug 9951 depends on bug 6554, which changed state. Bug 6554 Summary: Resolve encoding problems with corrected UTF8 handling in templates http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6554 What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |RESOLVED Resolution|--- |MOVED -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org