Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Center area post/pages (http://forum.bytesforall.com/forumdisplay.php?f=32)
-   -   PHP Notice: Undefined index: bfa_ata_noncename (http://forum.bytesforall.com/showthread.php?t=19623)

codered Feb 12, 2013 10:49 AM

PHP Notice: Undefined index: bfa_ata_noncename
 
This has just happened:
----------------------
PHP Notice: Undefined index: bfa_ata_noncename
wp-content/themes/atahualpa/functions.php on line 661

I'm using the latest Atahualpa (3.7.10) with the latest version of wordpress on shared hosting.
Here's what's on line 661:
Code:

if ( !wp_verify_nonce( $_POST['bfa_ata_noncename'], plugin_basename(__FILE__) )) {
    return $post_id;

As fas as I can see, it's a security feature to prevent Cross-Site Request Forgeries (http://codex.wordpress.org/WordPress_Nonces)
A random, one time use token (the 'nonce' - nothing to do with the pejorative meaning of the word in British English, it's short for 'number used once') is set in the form displayed on a custom box on the page.

The routine doing this is in function bfa_ata_inner_custom_box() on line 589:

Code:

echo '<input type="hidden" name="bfa_ata_noncename" id="bfa_ata_noncename" value="' .
    wp_create_nonce( plugin_basename(__FILE__) ) . '" />';

It uses the absolute path and filename of functions.php as the 'seed' for the token.

The token is verified when the form is processed by bfa_ata_save_postdata - if they're the same, the form is genuine.

The bfa_ata_save_postdata function wants to save the post in the database, but $_POST['bfa_ata_noncename'] does not exist, hence the error - don't know why, it should be OK.

I'm suffering an error on my wp install, so this could be specific to me but I thought I'd post here as I can't find much elsewhere and it might help someone.

I wrapped the line with a check, that fixed it but it won't survive the next upgrade:
Code:

if (isset($_POST['bfa_ata_noncename'])) {//fix130212a
  if ( !wp_verify_nonce( $_POST['bfa_ata_noncename'], plugin_basename(__FILE__) )) {
    return $post_id;
  }
  }


lmilesw Feb 12, 2013 01:26 PM

Perhaps a reinstall of WordPress and/or Atahualpa would "fix"


All times are GMT -6. The time now is 05:04 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.