WordPress.org

Ready to get started?Download WordPress

Forums

Contact Form 7
WP_DEBUG error -- easy fix, has-patch (4 posts)

  1. In ~/modules/submit.php

    lines 14&15:

    $options = (array) $tag['options'];
    	$values = (array) $tag['values'];

    are causing errors:

    Notice: Undefined index: options in /wp-content/plugins/contact-form-7/modules/submit.php on line 14
    
    Notice: Undefined index: values in /wp-content/plugins/contact-form-7/modules/submit.php on line 15

    please change to

    $options = (array) isset($tag['options'])?$tag['options']:array();
    	$values = (array) isset($tag['values'])?$tag['values']:array();

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

  2. Also, please wrap

    foreach ( $options as $option ) { }

    in a

    if( $options ) { }

    check.

  3. Minor correction on the first change ... the (array) was casting the wrong bit ...

    $options = (array) ( isset($tag['options'])?$tag['options']:array() );
    	$values = (array) ( isset($tag['values'])?$tag['values']:array() );
  4. Takayuki Miyoshi
    Member
    Plugin Author

    Posted 2 years ago #

    Thanks. This issue should have been fixed in the development version.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic