I read this and I did the below.
$confirmation = htmlspecialchars( 'return confirm("' . esc_html__( 'Do you really want to delete?', 'tor-child' ) . '");' );
$output .= '<form method="post" action="" onsubmit="' . $confirmation . '">';
Security is my concern. So, could I be overdoing it by using htmlspecialchars
and esc_html__
together in $confirmation
?
Or should I replace esc_html__()
with __()
and still be safe? Someone might enter some markup in translation text, though.