[wp-trac] [WordPress Trac] #51044: preprocess_comment filter is mising some data (like user agent)

WordPress Trac noreply at wordpress.org
Tue Aug 18 14:54:14 UTC 2020


#51044: preprocess_comment filter is mising some data (like user agent)
--------------------------+---------------------
 Reporter:  zodiac1978    |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  5.6
Component:  Comments      |     Version:
 Severity:  normal        |  Resolution:
 Keywords:  needs-patch   |     Focuses:
--------------------------+---------------------

Comment (by SergeyBiryukov):

 Replying to [comment:3 zodiac1978]:
 > The description of the filter is: "Filters a comment’s data *before* it
 is sanitized" (emphasize mine). if we move the filter before the
 `wp_filter_comment()` call it would be already sanitized.
 >
 > But maybe we could move the additions before the filter call?

 I think I interpreted `wp_filter_comment()` as sanitization, as its
 description is "Filters and sanitizes comment data", and there are some
 filters in `default-filters.php` attached to its hooks. But yeah, there is
 also some other sanitization code.

 It seems like at least `comment_author_IP` and `comment_agent` could be
 set before `preprocess_comment`.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/51044#comment:5>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list