Checking a form_key in confirm_box

Discussion forum for Extension Writers regarding Extension Development.
Post Reply
User avatar
Kailey
Community Team Leader
Community Team Leader
Posts: 3730
Joined: Mon Sep 01, 2014 1:00 am
Location: sudo rm -rf /
Name: Kailey Snay
Contact:

Checking a form_key in confirm_box

Post by Kailey »

I'm using confirm_box to remove categories from my Knowledge Base extension. Problem is I don't know how to do it within the function. Usually if I was using a submit button, I would have code like this:

Code: Select all

if ($submit)
{
    // Test if the form is valid
    if (!check_form_key('add_edit_category'))
    {
        $errors[] = $this->lang->lang('FORM_INVALID');
    }
}
Where would I put this code in for confrim_box?

EDIT: Nevermind
Note: When using confirm_box(), the add_form_key() and check_form_key() functions are not needed (for CSRF protection).
Kailey Snay - Community Team Leader
Knowledge Base | Documentation | Community rules

If you have any questions about the rules/customs of this website, feel free to send me a PM.
Post Reply

Return to “Extension Writers Discussion”