arshidkv12 / contact-form-cfdb7

Database addon for Contact Form 7 WordPress plugin. Save and manage Contact Form 7 messages.
https://ciphercoin.com
GNU Affero General Public License v3.0
13 stars 28 forks source link

form_values should be cleared for each result #33

Closed kurorido closed 1 year ago

kurorido commented 1 year ago

form_values is not cleared in each loop.

The previous value in result will pollute to the next result.

For example, a result have a key "text-257" but the next result doesn't have the key then the value in the previous is keeped to the next result.

arshidkv12 commented 1 year ago

Add it to last part of the loop.

kurorido commented 1 year ago

I don't think it's a good idea to add $form_values = []; to the last part of the loop.

because the line $form_values['form_id'] = $result->form_id; is above it.

I know it's fine to use variable without declare it in PHP, but it shouldn't be a good practice.