Make WordPress Core

Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#29563 closed defect (bug) (invalid)

WordPress does not preserve original comment text in database

Reported by: AmbushCommander Owned by:
Priority: normal Milestone:
Component: Comments Version: 3.1
Severity: normal Keywords:
Cc: Focuses:

Description (last modified by SergeyBiryukov)

Steps to reproduce:

  1. Write a comment which contains some invalid HTML, e.g. <s>a</s>
  2. Submit comment
  3. View comment in database

Expected results: Comment in database is original, verbatim comment input by commentor

Actual result: Comment in database has had HTML stripped out, e.g.

mysql> select comment_content from wp_comments where comment_id = 2;
+-----------------+
| comment_content |
+-----------------+
| a               |
+-----------------+
1 row in set (0.00 sec)

This is bad behavior because if a user formats a comment incorrectly, WordPress will silently eat their markup, and an administrator has no way of retroactively going and fixing the comment. WordPress should *always always always* keep the original text.

Change History (3)

#1 @SergeyBiryukov
12 years ago

  • Description modified (diff)
  • Focuses ui removed
  • Summary Wordpress does not preserve original comment text in database → WordPress does not preserve original comment text in database

#2 @miqrogroove
12 years ago

  • Resolution → invalid
  • Status new → closed
  • Version 3.9.2 → 3.1

kses has been hooked to the comment_text filter since at least 3.1.0. This is by design, and I see no reason to change it.

You could easily remove that security mechanism or modify it as needed to save raw inputs.

#3 @SergeyBiryukov
12 years ago

  • Milestone Awaiting Review
Note: See TracTickets for help on using tickets.