Make WordPress Core

Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#57700 closed defect (bug) (fixed)

Incorrect $order_by parameter name in personal data exporter and eraser

Reported by: SergeyBiryukov Owned by: SergeyBiryukov
Priority: normal Milestone: 6.2
Component: Comments Version: 4.9.6
Severity: normal Keywords: good-first-bug has-patch
Cc: Focuses: privacy

Description

[42888] / #43440 and [42994] / #43442 introduced these two functions:

  • wp_comments_personal_data_exporter()
  • wp_comments_personal_data_eraser()

Both functions call get_comments() with 'order_by' => 'comment_ID' as part of the arguments. However, the actual parameter name is orderby.

This does not seem to affect anything in practice, as the incorrect parameter name is just ignored, and the orderby parameter defaults to comment_date_gmt instead, which should result in the same order on a typical installation.

So the order_by parameter here can either be removed or corrected to orderby.

Change History (5)

This ticket was mentioned in PR #4059 on WordPress/wordpress-develop by shariffff.


4 years ago
#1

  • Keywords has-patch added; needs-patch removed

#2 @kapilpaul
4 years ago

patch looks good.

#3 @SergeyBiryukov
4 years ago

  • Milestone 6.36.2

#4 @SergeyBiryukov
4 years ago

  • Owner set to SergeyBiryukov
  • Resolutionfixed
  • Status newclosed

In 55324:

Comments: Use correct orderby parameter name in personal data exporter and eraser.

This ensures that get_comments() is called with the correct parameter name in:

  • wp_comments_personal_data_exporter()
  • wp_comments_personal_data_eraser()

Follow-up to [42888], [42994].

Props smeunus, kapilpaul, SergeyBiryukov.
Fixes #57700.

@SergeyBiryukov commented on PR #4059:


4 years ago
#5

Thanks for the PR! Merged in r55324.

Note: See TracTickets for help on using tickets.