Error validating WordPress nonce
-
Hi, today I start to receive a Failed security check message in several pages, but not in all browsers.
I checked the code and I see that in the file productprint.php method productprint_button at line 462, the url is created with wp_nonce_url that could to have problems with the char & present on $link var.
I changed that line and now all is working fine.
I’ll copy here the previous code commented and the new code:
$link = home_url('/index.php?task=productprint&pid='.$product->get_id()); //sets the URL for the post page //$nonced_url = wp_nonce_url($link, $product->get_id()); // adds a nonce to the URL $nonced_url = $link . '&_wpnonce=' . wp_create_nonce( $product->get_id() ); // Carlos Longarela, 2022/07/25. Fix the problem with bad nonce in print page.Kindly regards.
The topic ‘Error validating WordPress nonce’ is closed to new replies.