-
-
Save peterwilsoncc/87160c24a252d211cd9736ed57609d8c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Trigger Error mini plugin re: escaping. | |
* | |
* Tested with https://github.com/WordPress/wordpress-develop/pull/5175 checked out. | |
* | |
* @wordpress-plugin | |
* Plugin Name: Trigger Error mini plugin re: escaping. | |
*/ | |
add_action( | |
'init', | |
function() { | |
$user_input = $_GET['user_input']; | |
if ( ! is_array( $user_input ) ) { | |
$message = "\$user_input expects an array, '$user_input' given."; | |
wp_trigger_error( __FUNCTION__, $message ); | |
// wp_trigger_error( __FUNCTION__, esc_html( $message ) ); | |
// wp_trigger_error( __FUNCTION__, esc_html( esc_html( $message ) ) ); | |
} | |
} | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment