Support » Plugin: Contact Form 7 » [Plugin: Contact Form 7] WP_DEBUG error — easy fix, has-patch

  • George Stephanis

    (@georgestephanis)


    Code Monkey

    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/

Viewing 3 replies - 1 through 3 (of 3 total)
  • George Stephanis

    (@georgestephanis)

    Code Monkey

    Also, please wrap

    foreach ( $options as $option ) { }

    in a

    if( $options ) { }

    check.

    George Stephanis

    (@georgestephanis)

    Code Monkey

    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() );
    Plugin Author Takayuki Miyoshi

    (@takayukister)

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

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Plugin: Contact Form 7] WP_DEBUG error — easy fix, has-patch’ is closed to new replies.