where to apply “apply filters” and other Sanitization Functions

I use these commands at the top of my functions.php in all child themes; it will sanitize all POST/GETs. Maybe there are better ways (and it might be redundant), but it appears to work for me. $_POST = filter_input_array(INPUT_POST, FILTER_SANITIZE_STRING); $_GET = filter_input_array(INPUT_GET, FILTER_SANITIZE_STRING); But I am open to constructive criticism….

Overwrite default WordPress wording

You can filter ‘gettext’. Sample code, not tested: add_filter( ‘gettext’, ‘wpse_65085_change_error_messages’, 10, 3 ); function wpse_65085_change_error_messages( $translated, $text, domain ) { if ( ‘default’ !== $domain ) { return $translated; } switch( $text ) { case ‘Hint: The password should be at least seven characters long. To make it stronger, use upper and lower case … Read more

Use safety filters even if after applied intval?

intval() behaves sometimes a little bit counter-intuitive when then value has leading zeros or when it is a mathematic expression. The result should always be safe, but is not always what you might expect. A simple example: intval( ‘9223372036854775808’ ); will never return this value, because even 64 bit system cannot handle such a large … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)