Make WordPress Core

Opened 17 months ago

Closed 17 months ago

Last modified 17 months ago

#57700 closed defect (bug) (fixed)

Incorrect $order_by parameter name in personal data exporter and eraser

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


[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.

17 months ago

  • Keywords has-patch added; needs-patch removed

#2 @kapilpaul
17 months ago

patch looks good.

#3 @SergeyBiryukov
17 months ago

  • Milestone changed from 6.3 to 6.2

#4 @SergeyBiryukov
17 months ago

  • Owner set to SergeyBiryukov
  • Resolution set to fixed
  • Status changed from new to closed

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:

17 months ago

Thanks for the PR! Merged in r55324.

Note: See TracTickets for help on using tickets.