Make WordPress Core

Opened 18 months ago

Closed 18 months ago

Last modified 8 months ago

#58988 closed enhancement (duplicate)

Coding Standards: Use strict comparison in wp-admin/includes/ajax-actions.php

Reported by: mujuonly's profile mujuonly Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: General Keywords:
Focuses: coding-standards Cc:

Description

Coding Standards: Use strict comparison in wp-admin/includes/ajax-actions.php

Attachments (1)

58988.patch (6.7 KB) - added by nihar007 18 months ago.
Patch added. I added strict comparison

Download all attachments as: .zip

Change History (4)

@nihar007
18 months ago

Patch added. I added strict comparison

#1 @audrasjb
18 months ago

  • Keywords needs-patch removed
  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed
  • Version trunk deleted

Hello,

Thanks for the ticket and patch, but it appears that this issue is already covered by this PR: https://github.com/WordPress/wordpress-develop/pull/3873/files#diff-0654ebf17929e2c6b7aebbbab05808973b621ea19004971c1217f7d2be9f82e8 related to ticket #58831.

Thus I'm closing it as duplicate of #58831.
Pinging @SergeyBiryukov who's kinda coordinating this :)

#2 @SergeyBiryukov
18 months ago

Thanks for the ticket and the patch! As noted above, the PR on the other ticket should already cover this.

Some of these changes would need double-checking, as the values passed in $_GET or $_POST arrays are strings, so for example 1 === $_GET['test'] or 1 === $_POST['delete'] might not work as expected.

Some other values are converted to an integer, so this would need an appropriate type adjustment as well:

$thumbnail_id = (int) $_POST['thumbnail_id'];
...
if ( '-1' === $thumbnail_id ) { ... }
Last edited 8 months ago by SergeyBiryukov (previous) (diff)

#3 @SergeyBiryukov
8 months ago

In 58287:

Coding Standards: Use strict comparison in wp-admin/includes/ajax-actions.php.

Follow-up to [6213], [8296], [8720], [9098], [10204], [10476], [10912], [11644], [11749], [12008], [12036], [13489], [17354], [17832], [18663], [18796], [18937], [22843], [28892], [33356].

Props mujuonly, nihar007, aristath, poena, afercia, SergeyBiryukov.
See #58988, #60700.

Note: See TracTickets for help on using tickets.