WordPress.org

Make WordPress Core

Opened 4 years ago

Last modified 2 years ago

#10790 new defect (bug)

No feedback given to commenter when "Name" field empty

Reported by: WK1 Owned by:
Priority: normal Milestone: Future Release
Component: Comments Version: 2.8.4
Severity: normal Keywords: has-patch dev-feedback
Cc: secondv

Description

On my installation, name and email are not required to post a comment. I must approve every comment before it appears. If a user chooses to give their name anyway, then after they post their comment, they get a screen that says "Blah says:" and below that "Your comment is awaiting moderation." This is expected behavior.

However, if the user does not give their name, then they do not get any sort of confirmation that their comment was sent. It is sent successfully, but the user should have confirmation, otherwise they will likely try more than once before giving up in frustration.

I have tested this bug using Firefox 3.0, with and without JS enabled, and Internet Explorer 6.

Attachments (2)

comment-template.php.diff (1.0 KB) - added by secondv 3 years ago.
10790.diff (1.6 KB) - added by solarissmoke 2 years ago.

Download all attachments as: .zip

Change History (10)

comment:1 scribu4 years ago

  • Milestone changed from Unassigned to 2.9
  • Summary changed from Wordpress is silent when user posts a comment without filling in "Name" field, name field is not required, and comment requires moderator approval. to No feedback given to commenter when "Name" field empty

comment:2 azaozz4 years ago

  • Milestone changed from 2.9 to 3.0

No patch.

comment:3 secondv3 years ago

  • Cc secondv added
  • Keywords has-patch needs-testing added

comment:4 secondv3 years ago

Oh, probably important to note, this was patched against r12781

comment:5 scribu3 years ago

Please explain how your patch fixes the current bug, as I fail to understand it.

And why do you pass an empty string to $wpdb->prepare() ?

comment:6 secondv3 years ago

It fixes the bug, because WordPress does not query pending comments if the Comment Author is blank/anonymous, which means when redirected back to the post/#comments - you get no confirmation that your comment was sent through.

As far as $wpdb-prepare, that actually could be changed. Will attach a new patch when I've tested the change.

comment:7 dd323 years ago

  • Keywords needs-patch added; has-patch needs-testing removed
  • Milestone changed from 3.0 to Future Release

This patch isn't safe, by removing the approved status check, you're allowing for non-approved comments to be seen by users with blank usernames, that includes their posts, and any others that there may be.

Moving to Future Release as this isnt a regression from a previous version and we dont have a usable patch

solarissmoke2 years ago

comment:8 solarissmoke2 years ago

  • Keywords has-patch dev-feedback added; needs-patch removed

This patch shows recent anonymous comments from the current visitor (best guess at least). It does however mean abandoning the get_comments API and making the query a lot more complicated... is it worth it?

Note: See TracTickets for help on using tickets.