check_admin_referer is a template tag only
|Reported by:||hakre||Owned by:|
|Component:||Security||Keywords:||has-patch dev-feedback needs-testing gsoc|
when a plugin author wants to check (e.g. in the init hook) if a certain admin_referer is available or not, the plugin needs to write it's own admin referer implementation because the existing function
can only be used to check for, but not agains (if it's not the appropriate refer, the script will die.
this is mainly because that function is to be used as a admin "template tag" only.
useful would be a function that will return a boolean value instead of dieing / continuing execution.
this can be done by moving the decision out of check_admin_referer() into a new function check_admin_referer_test() and leave the die in there.
this will make plugin coding more safe because right now no such function exists and that done it's hard to check pre-conditions like proper form submits in init.
Change History (6)
comment:1 wojtek.szkutnik — 4 years ago
- Cc wojtek.szkutnik@… added
- Keywords has-patch needs-testing added; needs-patch removed
- Component changed from General to Security
- Milestone changed from Awaiting Review to Future Release