User input sanitization
-
Hi,
i’m surprised this is not a built in feature of the plugin.
Anyway it’s imperative to sanitize user content.I tried this, but it doesn’t work. How to do it properly?
function sanitize_forms( $error ) { if ( isset( $_POST['user_content_copyright'] ) ) { sanitize_text_field($_POST['user_content_copyright']); } return''; } add_filter( 'wpuf_add_post_validate', 'sanitize_forms' );
The goal here is to sanitize $_POST[‘user_content_copyright’] BEFORE it gets in the db.
- The topic ‘User input sanitization’ is closed to new replies.