Quantcast
Channel: WordPress.org Forums » All Topics
Viewing all articles
Browse latest Browse all 59525

Error in code using wp_nonce_field incorrectly

$
0
0

Replies: 0

A coding error in check-email.php on line 178 is causing invalid html to be output.

The problem is using the function wp_nonce_field( ‘checkemail’ ) concatenated in a string.

wp_nonce_field( ‘checkemail’ ) already ‘echos’, outputing directly into the stream, so you cannot use it like this:

	<input type="submit" name="checkemail_go" id="checkemail_go" class="button-primary" value="' . __( "Send test email", "check-email" ) . '" /></p>
	' . wp_nonce_field( 'checkemail' ) . '
	</form>

Needs to be changed to:

	<input type="submit" name="checkemail_go" id="checkemail_go" class="button-primary" value="' . __( "Send test email", "check-email" ) . '" /></p>';
	wp_nonce_field( 'checkemail' );
	echo '</form>

Viewing all articles
Browse latest Browse all 59525

Trending Articles