• Resolved gmsb

    (@gmsb)


    import-users-from-csv-with-meta.php
    Line 582

    I have amended the code on my site to the following:

    if (!empty($_POST[$column])) {
                    update_user_meta($user_id, $column, $_POST[$column]);
                }

    I was receiving a warning that $_POST[‘ZIP’]; was empty, which output error messages. The error messages caused more errors messages about page headers not being able to be added after content has been output.

    https://wordpress.org/plugins/import-users-from-csv-with-meta/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Javier Carazo

    (@carazo)

    What strange. Could you send me the CSV file which is creating the problem to carazo AT codection DOT com?

    Thread Starter gmsb

    (@gmsb)

    Sorry I don’t think I explained the issue well in my original post.

    The problem occurs when I login using one of the test accounts, and go to update the password on the profile. When I submit the profile update form I receive a warning that was caused by $_POST[‘Zip’]; It is trying to update_user_meta with an empty form field which is throwing the error.

    Also on a side note, to conform to modern standards you really shouldn’t be using $_POST or $_GET variables from the client side directly, they should be filtered and validated using php’s filter_input functionality, or WordPress’ built in functions.

    Plugin Author Javier Carazo

    (@carazo)

    Thanks for your help, inline:

    The problem occurs when I login using one of the test accounts, and go to update the password on the profile. When I submit the profile update form I receive a warning that was caused by $_POST[‘Zip’]; It is trying to update_user_meta with an empty form field which is throwing the error.

    I have solved the bug.

    Also on a side note, to conform to modern standards you really shouldn’t be using $_POST or $_GET variables from the client side directly, they should be filtered and validated using php’s filter_input functionality, or WordPress’ built in functions.

    Thanks also for this note, I have changed the code to adapt to modern standards.

    A new version is prepared and it has just been updated, so you will receive the plugin updated in your WordPress soon.

    Thread Starter gmsb

    (@gmsb)

    Thank you for the incredibly fast support! (It’s very rare!)

    Plugin Author Javier Carazo

    (@carazo)

    We work with WordPress daily in Codection and we try to give the best support to our clients.

    Also, if you report us a bug of a plugin, we try to solve it soon.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Profile.php warning on update’ is closed to new replies.