Potential bug in /inc/core-form.php
-
Thanks to Jeff Starr for a handy and functional plugin.
With debug enabled, I noticed errors like:
PHP Warning: Invalid argument supplied for foreach() in /var/www/domain.com/htdocs/wp-content/plugins/contact-form-x/inc/core-form.php on line 45
There might be a bug here, because on line 41 $fields variable might be set to null. But on line 45, always, even if $fields is null, the plugin tries to call
foreach($fields as $id => $field)
.I suggest replacing:
$fields = isset($options_form['display-fields']) ? $options_form['display-fields'] : null;
on the:
$fields = isset($options_form['display-fields']) ? $options_form['display-fields'] : array();
Then the foreach() will always get an array.
- The topic ‘Potential bug in /inc/core-form.php’ is closed to new replies.