• Resolved 723432

    Hi all,

    I’ve noticed an issue with PHP and the new WordPress installation. (2.5.1)

    Submitting a ‘blank’ comment seems to throw a 500 Internal Server Error. This can also occur when WordPress is configured to check for email/name, and they aren’t filled in correctly. Easiest way to reproduce is to submit a blank form as a comment.

    Theme is irrelevant. No plugins need to be present.

    This error is not specific to any installation I have. I created two new test installations as a proof-of-concept.

    New Version (2.5.1) with the error:
    http://fizzworld.org/test/

    Older version (2.3.2), no error:
    http://fizzworld.org/test2/

    The 500 error seems to occur in IE7.

    Tested Firefox and the error does not come up.

    I contacted the host to check to see if it was an issue there and recieved:
    “This is something beyond our control .. servers are running the latest stable versions of php as released by DA. If it works in FF, but not in IE, it’s not a server issue. I’d suggest posing your question to the wordpress support groups and see if they’ve got a patch in the works.”

    Please advise.

    Thanks guys!

Viewing 6 replies - 1 through 6 (of 6 total)
  • It works ok in Firefox (theres a surprise NOT)
    but not in IE (theres a surprise NOT)

    In firefox, with empty fields you get

    Error: please fill the required fields (name, email).

    The bug is IE related I think it treats it as internal error if the returned page is less 512Bytes.

    To fix this I think you can do

    a. In Internet Explorer 5.x and 6.x, on the Tools menu, click Internet Options.
    b. On the Advanced tab, under the Browsing section, click to clear the Show friendly HTTP error messages check box, and then click OK.

    AND REPEAT THIS FOR ALL VISITORS’ PCs TO YOUR SITE, EHERM!

    Thread Starter 723432

    Cute response. 🙂

    Sure enough, you nailed the reason. Disabling that ‘feature’ shows the proper message.
    I don’t know what the official/unofficial standard size response is for proper etiquette with http traffic. (if there even is one) So I can’t pretend to know if this is a BAD or GOOD thing MS has implemented in IE7.

    I also don’t want to spark the debate of “is this an IE bug or a WordPress bug?”. I can point out that IE is still the most widely used browser, and it seems to me that this should probably be adapted to work in IE. Of course, I’m sure others would stand up for other principles…

    You might want to try this plugin, I am not sure what exactly it does read somewhere it prevents the 500 error in wordpress in IE.

    http://txfx.net/code/wordpress/wordpress-tuneup/wordpress-205-tuneup/

    Whether it is compatible in 2.5.1 I dont know.

    I would imagine along the way wordpress will correct the problem or maybe IE starts to behave properly.

    Thread Starter 723432

    My fix:

    I really hate having to manually alter core files for the system. But, gotta do whatcha gotta do.

    For those interested:

    1. Open your wp-comments-post.php file
    2. Search for these lines:
      wp_die( __('Error: please fill the required fields (name, email). ...
      wp_die( __('Error: please enter a valid email address. ...
      wp_die( __('Error: please type a comment. ...
    3. Change the error message to something longer. For example, here’s a full excerpt from my file:
      if ( get_option('require_name_email') && !$user->ID ) {
      	if ( 6 > strlen($comment_author_email) || '' == $comment_author )
      		wp_die( __('Error: please fill the required fields (name, email).  Those are required fields.  Come on!  You should know better!  tsk 
      
      tsk') );
      	elseif ( !is_email($comment_author_email))
      		wp_die( __('Error: please enter a valid email address.  Those are required fields.  Come on!  You should know better!  tsk tsk') );
      }
      
      if ( '' == $comment_content )
      	wp_die( __('Error: please type a comment.  Those are required fields.  Come on!  You should know better!  tsk tsk') );
    4. Alter the other error messages as needed.
      i.e.

      wp_die( __('Sorry, comments are closed for this item.  This was probably done on purpose to avoid mindless arguing! .. or spam') );
      wp_die( __('Sorry, you must be logged in to post a comment.  This system is set up to deny users that are not logged into the site.')

    Good luck!

    I have exactly the same problem but changing the error messages to something long did not work. I’m completely stuck 🙁

    hi,

    in case of entry-errors wp_die() is called, wich is located in wp-includes/functions.php. This function creates an error page with an header 500. This causes IE to forward to an internal error-page.

    Using WP 2.6.3 i just set this line (1800) into comments: status_header( 500 );

    Now the error Page is responded with a header 200 ok, and IE displays it. Did not find an better way…

    regards, wende from Munich, Germany

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘BUG in 2.5.1 when posting blank comment’ is closed to new replies.