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>
|
||
|---|---|---|
| .. | ||
| cataloguing | ||
| club | ||
| config | ||
| letters | ||
| mana | ||
| members | ||
| records | ||
| virtualshelves | ||
| article_request | ||
| authentication | ||
| authorised_values | ||
| barcode | ||
| bib | ||
| bib_framework | ||
| bib_profile | ||
| checkin | ||
| checkout_notes | ||
| checkouts | ||
| convert_report | ||
| cover_images | ||
| creator_batches | ||
| holds | ||
| import_bib | ||
| localization | ||
| new_bib | ||
| problem_reports | ||
| recall | ||
| renew | ||
| report | ||
| return_claims | ||
| split_callnumbers | ||