Bug 37826 - Templates that use the variable script_name should be called by scripts that set it
Summary: Templates that use the variable script_name should be called by scripts that ...
Status: ASSIGNED
Alias: None
Product: Koha
Classification: Unclassified
Component: Templates (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Owen Leonard
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-09-04 01:46 UTC by Phil Ringnalda
Modified: 2024-09-06 12:39 UTC (History)
0 users

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Phil Ringnalda 2024-09-04 01:46:08 UTC
We have templates that use the variable script_name for the path and filename of the script that called them, particularly as the action attribute of forms that call back to it.

We have scripts that set the template->param script_name to their path and filename.

What we don't have is a 1:1 match between templates and scripts, as the failure mode in bug 37797 comment 1 shows. If you set action="[% script_name %]" when it isn't defined, you get action="", which may work for years if every form submitted to that script is a POST, but once someone changes one to a get, action="" will POST to aqbudgetperiods.pl?op=delete_confirm&budget_period_id=2 and both the things in the POST body and also things in the query string will wind up being sent to the script.

What I don't have is any good idea how to find templates using unset script_name, short of just brute force looking at every one.