Support » Theme: P2 » p2 theme does not send all input from comment form via ajax request

  • webvitalii


    I am the developer of Anti-spam plugin.

    Anti-spam plugin works like this:

    Two extra hidden fields are added to comments form. Both them should be send and checked on the server. If the user visits site, than the hidden fields are filled automatically with javascript insted of the user. If the spammer tries to submit comment form, he will make a mistake with filling inputs and spam comment will be automatically rejected.

    p2 theme submits comments via ajax and scripts sends only name, email, url, comments etc. But p2 script does not sends new added inputs to comment form via another plugins.

    I checked the code and founded it in ‘js/p2.js’ file:

    var dataString = {action: 'new_comment' , _ajax_post: nonce, comment: commenttext,  comment_parent: comment_parent, comment_post_ID: comment_post_ID, subscribe: subscribe, subscribe_blog: subscribe_blog};
    if (!isUserLoggedIn) {
    	dataString['author'] = $('#author').val();
    	dataString['email'] = $('#email').val();
    	dataString['url'] = $('#url').val();

    What can be done to make p2 theme work with Anti-spam and other plugins related to commenting?

Viewing 3 replies - 1 through 3 (of 3 total)
  • I’m not sure, what would you suggest? I don’t think this has come up before from other plugin developers.

    Maybe a filter on the comment POST variables so plugins can submit other values?

    Is it possible to go thru all inputs in the form and submit all of them via js?

    No, that would be a security issue, because anyone could insert any value or input they wish.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘p2 theme does not send all input from comment form via ajax request’ is closed to new replies.