Koha-clms/opac
David Cook 7302a4d8f2
Bug 41261: Valid inputs to unapi
This change adds data validation to the "unapi" API endpoint.

Test plan:
0. Apply the patch
1. Go to http://localhost:8080/cgi-bin/koha/unapi
2. Note the 400 HTTP response code
3. Go to http://localhost:8080/cgi-bin/koha/unapi?id=bad
4. Note the 400 HTTP response code
5. Go to http://localhost:8080/cgi-bin/koha/unapi?id=koha:biblionumber:1&format=bad
6. Note the XML response listing the available formats for that ID
7. Go to http://localhost:8080//cgi-bin/koha/unapi?id=koha:biblionumber:1
8. Note the XML response listing the available formats for that ID
9. Go to http://localhost:8080//cgi-bin/koha/unapi?format=mods
10. Note the 400 HTTP response code
11. Go to http://localhost:8080//cgi-bin/koha/unapi?id=koha:biblionumber:1&format=mods
12. Note the MODS format returned for biblionumber 1

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
2026-04-02 18:31:10 +01:00
..
clubs Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
errors Bug 28146: Respect ReplytoDefault in error pages 2025-10-09 14:58:41 -06:00
external/overdrive Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
sci Bug 34596: Add rebuild queue where needed for existing calls to AddReturn 2025-10-06 09:15:17 -06:00
sco Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
svc Bug 40163: (follow-up) Fix wrong GNU links and update test 2025-09-24 09:25:04 -06:00
ilsdi.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
maintenance.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
oai.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
opac-ISBDdetail.pl Bug 38936: Use redirect_if_opac_suppressed() in opac-*detail.pl pages 2025-09-29 14:02:23 -06:00
opac-MARCdetail.pl Bug 38936: Use redirect_if_opac_suppressed() in opac-*detail.pl pages 2025-09-29 14:02:23 -06:00
opac-account-pay-return.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
opac-account-pay.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
opac-account.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
opac-addbybiblionumber.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
opac-alert-subscribe.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
opac-alert-subscriptions.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
opac-article-request-cancel.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
opac-authorities-home.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
opac-authoritiesdetail.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
opac-basket.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
opac-blocked.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
opac-browse.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
opac-browser.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
opac-changelanguage.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
opac-course-details.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
opac-course-reserves.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
opac-curbside-pickups.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
opac-detail.pl Bug 39482: Correct the link to edit OpacLibraryInfo from library edit page 2026-01-16 17:00:10 +00:00
opac-discharge.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
opac-dismiss-message.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
opac-downloadcart.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
opac-downloadshelf.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
opac-export.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
opac-holdshistory.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
opac-ics.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
opac-idref.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
opac-illrequests-unauthenticated.pl Bug 36197: (QA follow-up): Adopt POST REDIRECT GET pattern 2025-04-25 08:47:11 +02:00
opac-illrequests.pl Bug 41204: Fallback to Standard earlier 2026-03-16 13:23:10 +00:00
opac-image.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
opac-imageviewer.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
opac-issue-note.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
opac-library.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
opac-main.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
opac-memberentry.pl Bug 41076: [25.11.x] Adjust perl tidiness for v20250105 2026-03-16 13:23:08 +00:00
opac-messaging.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
opac-modrequest-suspend.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
opac-modrequest.pl Bug 40929: Add $hold test in opac-modrequest 2025-10-06 09:15:19 -06:00
opac-mymessages.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
opac-news-rss.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
opac-overdrive-search.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
opac-page.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
opac-passwd.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
opac-password-recovery.pl Bug 39325: Automatic fix 2025-04-28 18:51:22 +02:00
opac-patron-consent.pl (RMaint follow up): make suggestion.pl & opac-patron-consent.pl executable 2026-01-29 15:29:00 +00:00
opac-patron-image.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
opac-privacy.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
opac-ratings.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
opac-readingrecord.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
opac-recall.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
opac-recalls.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
opac-registration-verify.pl Bug 41076: [25.11.x] Adjust perl tidiness for v20250105 2026-03-16 13:23:08 +00:00
opac-renew.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
opac-reportproblem.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
opac-request-article.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
opac-reserve.pl Bug 40517: Move creation of hold group into Patron class. Add exceptions 2025-10-29 11:50:07 -06:00
opac-reset-password.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
opac-restrictedpage.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
opac-retrieve-file.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
opac-review.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
opac-routing-lists.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
opac-search-history.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
opac-search.pl Bug 40966: Make sure 'whole_record' and 'weighted_fields' are passed around 2026-03-16 13:23:10 +00:00
opac-sendbasket.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
opac-sendshelf.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
opac-serial-issues.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
opac-shareshelf.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
opac-shelves.pl Bug 41655: Local OPAC covers are not displayed in OPAC lists 2026-03-16 13:23:09 +00:00
opac-showmarc.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
opac-showreviews.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
opac-suggestions.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
opac-tags.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
opac-tags_subject.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
opac-topissues.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
opac-user.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
opac-virtual-card.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
tracklinks.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
unapi Bug 41261: Valid inputs to unapi 2026-04-02 18:31:10 +01:00