Skip to content

Don't write unfiltered POST data to database #8

@JustThomas

Description

@JustThomas

Hi,

you have those lines in the function user_profile_field_save:

    if ( !isset( $_POST['ja_disable_user'] ) ) {
        $disabled = 0;
    } else {
        $disabled = $_POST['ja_disable_user'];
    }

    update_user_meta( $user_id, 'ja_disable_user', $disabled );

This writes the contents of $_POST['ja_disable_user'] directly to the database. You should avoid this and rather change the else block to

    } else {
        $disabled = 1;
    }

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions