Koha-clms/tools
Martin Renvoize d413403825
Bug 42746: (QA follow-up) Sanitize agefield and substitution field at the sink too
The original fix only whitelisted agefield, condition_field, and
substitution_field at the point they're saved in
tools/automatic_item_modification_by_age.pl, leaving the actual
consumer of the stored syspref, C4::Items::ToggleNewStatus, trusting
agefield and substitution field unchecked. agefield is spliced
directly into raw SQL (TO_DAYS($agefield)) and so can't be
parameterized like an ordinary value; substitution field reaches a
dynamic method call ($item->$field($value)). Any future or
alternate writer of the automatic_item_modification_by_age_configuration
syspref would have reopened both holes without touching the form at
all.

This adds the same allow-list validation directly in ToggleNewStatus
(falling back to the safe default agefield, or skipping the
substitution/condition, exactly as before for missing values), shares
the age-field allow-list between the two files via a new
GetAutomaticItemModificationAgeFields() in C4::Items so it can't drift
between them, and logs rejected values via Koha::Logger instead of
silently discarding them so tampering leaves an audit trail.

Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz>
2026-08-05 15:41:06 +12:00
..
csv-profiles
…
access_files.pl Bug 40163: Fix several http addresses in the code docs 2026-01-07 14:32:30 +00:00
additional-contents.pl Bug 41614: available options template params also needed for op=list 2026-06-19 13:02:18 +12:00
ajax-inventory.pl Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
automatic_item_modification_by_age.pl Bug 42746: (QA follow-up) Sanitize agefield and substitution field at the sink too 2026-08-05 15:41:06 +12:00
batchMod.pl Bug 40163: Fix several http addresses in the code docs 2026-01-07 14:32:30 +00:00
batch_delete_records.pl Bug 40163: Fix several http addresses in the code docs 2026-01-07 14:32:30 +00:00
batch_extend_due_dates.pl Bug 40163: Fix several http addresses in the code docs 2026-01-07 14:32:30 +00:00
batch_record_modification.pl Bug 40163: Fix several http addresses in the code docs 2026-01-07 14:32:30 +00:00
batch_records_ajax.pl Bug 40163: Fix several http addresses in the code docs 2026-01-07 14:32:30 +00:00
cleanborrowers.pl Bug 40163: Fix several http addresses in the code docs 2026-01-07 14:32:30 +00:00
copy-holidays.pl Bug 40163: Fix several http addresses in the code docs 2026-01-07 14:32:30 +00:00
csv-profiles.pl Bug 40163: Fix several http addresses in the code docs 2026-01-07 14:32:30 +00:00
exceptionHolidays.pl Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
export.pl Bug 40163: Fix several http addresses in the code docs 2026-01-07 14:32:30 +00:00
holidays.pl Bug 40163: Fix several http addresses in the code docs 2026-01-07 14:32:30 +00:00
import_borrowers.pl Bug 40163: Fix several http addresses in the code docs 2026-01-07 14:32:30 +00:00
inventory.pl Bug 40163: Fix several http addresses in the code docs 2026-01-07 14:32:30 +00:00
letter.pl Bug 40163: Fix several http addresses in the code docs 2026-01-07 14:32:30 +00:00
manage-marc-import.pl Bug 40163: Fix several http addresses in the code docs 2026-01-07 14:32:30 +00:00
marc_modification_templates.pl Bug 40163: Fix several http addresses in the code docs 2026-01-07 14:32:30 +00:00
modborrowers.pl Bug 40163: Fix several http addresses in the code docs 2026-01-07 14:32:30 +00:00
newHolidays.pl Bug 40163: Fix several http addresses in the code docs 2026-01-07 14:32:30 +00:00
overduerules.pl Bug 40163: Fix several http addresses in the code docs 2026-01-07 14:32:30 +00:00
page.pl Bug 43019: Prevent access to pages belonging to another library (staff side) 2026-08-04 14:01:22 +12:00
picture-upload.pl Bug 40163: Fix several http addresses in the code docs 2026-01-07 14:32:30 +00:00
problem-reports.pl Bug 40163: Fix several http addresses in the code docs 2026-01-07 14:32:30 +00:00
quotes-upload.pl Bug 40163: Fix several http addresses in the code docs 2026-01-07 14:32:30 +00:00
quotes.pl Bug 40163: Fix several http addresses in the code docs 2026-01-07 14:32:30 +00:00
scheduler.pl Bug 40163: Fix several http addresses in the code docs 2026-01-07 14:32:30 +00:00
showdiffmarc.pl Bug 40163: Fix several http addresses in the code docs 2026-01-07 14:32:30 +00:00
stage-marc-import.pl Bug 40163: Fix several http addresses in the code docs 2026-01-07 14:32:30 +00:00
stockrotation.pl Bug 41076: [25.05.x] Adjust perl tidiness 2026-02-24 08:35:34 -07:00
tools-home.pl Bug 40163: Fix several http addresses in the code docs 2026-01-07 14:32:30 +00:00
upload-cover-image.pl Bug 40163: Fix several http addresses in the code docs 2026-01-07 14:32:30 +00:00
upload-file.pl Bug 40163: Fix several http addresses in the code docs 2026-01-07 14:32:30 +00:00
upload.pl Bug 40163: Fix several http addresses in the code docs 2026-01-07 14:32:30 +00:00
viewlog.pl Bug 40163: Fix several http addresses in the code docs 2026-01-07 14:32:30 +00:00