Ready to get started?Download WordPress


Usernoise modal feedback / contact form
[resolved] Getting an error when submitting (6 posts)

  1. chriswhittle
    Posted 2 years ago #

    Original Error Jquery

    Uncaught SyntaxError: Unexpected token W

    once I alerted the response from ajax I got

    Warning: mysql_real_escape_string() expects parameter 1 to be string, array given in /var/www/socialfabric.us/htdocs/wp-includes/wp-db.php on line 787

    After a few hours of troubleshooting I was able to fix it by changing model.php from
    $headers = apply_filters('un_admin_notification_headers', array('Content-type: text/html'), $id);
    $headers = implode("\r\n",array('Content-type: text/html')) . "\r\n";


  2. karevn
    Posted 2 years ago #

    What version did you use? Do you have Pro version installed?

  3. karevn
    Posted 2 years ago #

    Aha. Here is is the deal. $headers variable is passed to wp_mail function right after assigning, and wp_mail can receive a string or array as the fourth argument ($headers) according to API specification. It looks like you have some plugin installed that hooks into wp_mail call to log outgoing emails sent and it does not handle array in $headers right, but it should (according to wp_mail documentation).

    That said, fixing that plugin is a better way to resolve the problem you have. But thanks for your time spent troubleshooting!

  4. chriswhittle
    Posted 2 years ago #

    Thanks karevn!

  5. chriswhittle
    Posted 2 years ago #

    Which version will this be fixed in... Had to change 2.0.1

  6. karevn
    Posted 2 years ago #

    The problem is at another plugin that does not follow wp_mail API specs. Please contact that plugin's author to have it fixed.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic