Koha-clms/svc
David Cook f7d6d87543
Bug 37464: Validate "type" sent to barcode/svc
This change validates the "type" sent to the barcode/svc. Without this
change, we pass the user input directly to GD::Barcode, which passes
the input into an eval{} block without any validation of its own.

Test plan:
0. Apply the patch
1. koha-plack --reload kohadev
2. Go to http://localhost:8081/cgi-bin/koha/svc/barcode?type=bad&barcode=123456
3. Note that a Code39 barcode is provided for an invalid type
4. Go to http://localhost:8081/cgi-bin/koha/svc/barcode?type=Code39&barcode=123456
5. Note that a Code39 barcode is provided
6. Go to http://localhost:8081/cgi-bin/koha/svc/barcode?type=UPCE&barcode=123456
7. Note that a non-Code39 barcode is provided (presumably UPCE)

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2024-08-13 11:53:59 -03:00
..
cataloguing
…
club Bug 35942: OPAC user can enroll several times to the same club [23.05.x] 2024-03-04 17:34:39 +01:00
config Bug 34369: Require CSRF token for updating system preferences 2023-09-28 09:18:30 +00:00
letters
…
mana
…
members
…
records
…
virtualshelves
…
article_request
…
authentication
…
authorised_values
…
barcode Bug 37464: Validate "type" sent to barcode/svc 2024-08-13 11:53:59 -03:00
bib
…
bib_framework
…
bib_profile
…
checkin
…
checkout_notes
…
checkouts Bug 33944: Don't fetch item object unless using recalls 2023-07-18 11:11:10 +00:00
convert_report Bug 34533: jsdiff library missing from guided reports page 2023-08-31 10:11:32 +00:00
cover_images
…
creator_batches
…
holds
…
import_bib Bug 15869: Change framework on overlay 2023-02-08 16:34:09 +00:00
localization
…
new_bib
…
problem_reports
…
recall
…
renew Bug 27249: Prevent infinite loop when searching for an open day 2023-11-13 13:45:36 +00:00
report
…
return_claims
…
split_callnumbers
…