WordPress.org

Ready to get started?Download WordPress

Forums

WP-reCAPTCHA
Undefined index: rcommentid... - Undefined index: rchash... (5 posts)

  1. tomczech
    Member
    Posted 2 years ago #

    Dear all,

    I wanted to use the wp-recaptcha plugin by Jorge Pena on my blog and it seems to work well in most parts. The only issue I have is this error message, which is shown on the upper edge of the page, when trying to post a comment:

    Notice: Undefined index: rcommentid in /website/wordpress/wp-content/plugins/wp-recaptcha/recaptcha.php on line 476

    Notice: Undefined index: rchash in /website/wp-content/plugins/wp-recaptcha/recaptcha.php on line 477

    Do you have any suggestion how to get rid of this? How and in which line can I define the needed indices?

    Thank you very much in advance for your help and best wishes
    tomczech

    http://wordpress.org/extend/plugins/wp-recaptcha/

  2. tomczech
    Member
    Posted 2 years ago #

    Hi, again!

    I still did not manage to solve the problem, so I push this thread upwards again. Maybe now someone has an idea.

    Thanks a lot in advance and best wishes
    tomczech

  3. mochitto
    Member
    Posted 2 years ago #

    change that two lines to

    $comment_id = isset($_REQUEST['rcommentid']) ? $_REQUEST['rcommentid'] : '';
    $comment_hash = isset($_REQUEST['rchash']) ? $_REQUEST['rchash'] : '';
  4. tomczech
    Member
    Posted 2 years ago #

    Hi, mochitto!

    Thanks a lot for your reply. Just to make it clear for me, may I ask again?

    These are the lines as given in my file:

    $comment_id = $_REQUEST['rcommentid'];
    $comment_hash = $_REQUEST['rchash'];

    They are followed by:

    if (empty($comment_id) || empty($comment_hash))
       return;
    if ($comment_hash == $this->hash_comment($comment_id)) {
       $comment = get_comment($comment_id);

    I exchanged the first two of these lines by the ones you had sent and received the following:

    Notice: Undefined index: rcommentid in .../wordpress/wp-content/plugins/wp-recaptcha/recaptcha.php on line 480

    Notice: Undefined index: rchash in .../wordpress/wp-content/plugins/wp-recaptcha/recaptcha.php on line 481

    Would you, please, be so kind to have another look at this and tell me how these 6 lines would be correct?

    Thanks a lot and best wishes

    tomczech

  5. eskebarne
    Member
    Posted 2 years ago #

    Hi tomczech,

    I changed the empty string values to NULL instead:

    $comment_id = isset($_REQUEST['rcommentid']) ? $_REQUEST['rcommentid'] : NULL;
    $comment_hash = isset($_REQUEST['rchash']) ? $_REQUEST['rchash'] : NULL;

    This removed both the line 480 and 481 errors for me.

    Hope this helps

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic