WordPress.org

Ready to get started?Download WordPress

Forums

Contact Form 7
[resolved] PHP Notice - incorrectly assumes posted values exist (2 posts)

  1. Dean Taylor
    Member
    Posted 1 year ago #

    Hi Takayuki Miyoshi (Plugin Author),

    Noticed this error in my logs...

    It appears that inside the wpcf7_text_validation_filter function there is an assumption that all the form arguments were posted ... this is not always the case (i.e. when spammers post).

    The line causing the PHP notice:

    $_POST[$name] = trim( strtr( (string) $_POST[$name], "\n", " " ) );

    Detailed log, note that username was not posted but did exist in the form:

    URL: http://example.com/signup/
    Referrer: http://example.com/signup/
    Error(E_NOTICE): Undefined index: username
    Source: /var/sites/g/example.com/public_html/wp-content/plugins/contact-form-7/modules/text.php [124]
    
    Trace:
    #1 /var/sites/g/example.com/public_html/index.php:17 - require('/var/si...')
    #2 /var/sites/g/example.com/public_html/wp-blog-header.php:12 - require_once('/var/si...')
    #3 /var/sites/g/example.com/public_html/wp-load.php:29 - require_once('/var/si...')
    #4 /var/sites/g/example.com/public_html/wp-config.php:153 - require_once('/var/si...')
    #5 /var/sites/g/example.com/public_html/wp-settings.php:302 - do_action('init')
    #6 /var/sites/g/example.com/public_html/wp-includes/plugin.php:403 - call_user_func_array('wpcf7_c...', Array)
    #7 [internal call] - wpcf7_control_init('')
    #8 /var/sites/g/example.com/public_html/wp-content/plugins/contact-form-7/includes/controller.php:8 - wpcf7_submit_nonajax()
    #9 /var/sites/g/example.com/public_html/wp-content/plugins/contact-form-7/includes/controller.php:121 - WPCF7_ContactForm->submit()
    #10 /var/sites/g/example.com/public_html/wp-content/plugins/contact-form-7/includes/classes.php:362 - WPCF7_ContactForm->validate()
    #11 /var/sites/g/example.com/public_html/wp-content/plugins/contact-form-7/includes/classes.php:418 - apply_filters('wpcf7_v...', Array, Array)
    #12 /var/sites/g/example.com/public_html/wp-includes/plugin.php:170 - call_user_func_array('wpcf7_t...', Array)
    #13 [internal call] - wpcf7_text_validation_filter(Array, Array)
    
    POST:
    array (
      'SUdomains' => 'null',
      'SUusername' => 'tongs.hanpang736@163.com',
      'SUpassword' => 'adaxiaoF0',
      'SUverifypassword' => 'adaxiaoF0',
      'SUfirstname' => 'Smith',
      'SUTOS' => 'on',
      'SUbirth_Month' => '07',
      'SUbirth_Day' => '15',
      'SUbirth_Year' => '1980',
      'SUzip' => '518000',
      'SUcountry' => 'CN',
      'SUcouponcode' => '',
      'signupSubmit' => '',
      '_wpcf7' => '59',
      '_wpcf7_version' => '3.3.2',
      '_wpcf7_unit_tag' => 'wpcf7-f59-p52-o1',
      '_wpnonce' => '520c7e51b1',
    )
    
    GET:
    array (
    )

    http://wordpress.org/extend/plugins/contact-form-7/

  2. Takayuki Miyoshi
    Member
    Plugin Author

    Posted 1 year ago #

    Thanks for reporting. It will be fixed in the next release.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic