Make WordPress Core

Opened 4 months ago

Closed 4 months ago

Last modified 4 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 4 months ago.
Patch added. I added strict comparison

Download all attachments as: .zip

Change History (3)

@nihar007
4 months ago

Patch added. I added strict comparison

#1 @audrasjb
4 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
4 months ago

Thanks for the ticket and the patch! As noted above, a 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 ) { ... }
Note: See TracTickets for help on using tickets.