Support » Plugin: Usernoise modal feedback / contact form » [Plugin: Usernoise modal feedback / contact form] Getting an error when submitting

  • Resolved chriswhittle

    (@chriswhittle)


    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);
    to
    $headers = implode("\r\n",array('Content-type: text/html')) . "\r\n";

    http://wordpress.org/extend/plugins/usernoise/

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

    (@karevn)

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

    Plugin Author karevn

    (@karevn)

    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!

    Thanks karevn!

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

    Plugin Author karevn

    (@karevn)

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

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘[Plugin: Usernoise modal feedback / contact form] Getting an error when submitting’ is closed to new replies.