WordPress.org

Make WordPress Core

#47573 closed enhancement (fixed)

Use strict comparison in wp-includes/taxonomy.php

Reported by: andizer Owned by: SergeyBiryukov
Milestone: 5.3 Priority: normal
Severity: normal Version:
Component: Taxonomy Keywords: has-patch
Focuses: coding-standards Cc:

Description

Improvement in doing comparisons in taxonomy.php:
Do strict comparison where possible.
Did two small readability improvements.

Attachments (1)

47573.diff (8.8 KB) - added by andizer 11 months ago.

Download all attachments as: .zip

Change History (7)

@andizer
11 months ago

#1 @SergeyBiryukov
11 months ago

  • Milestone changed from Awaiting Review to 5.3
  • Owner set to SergeyBiryukov
  • Status changed from new to reviewing

#2 @SergeyBiryukov
10 months ago

  • Focuses coding-standards added

For some context, we have to be extra careful with this kind of changes, as these values are sometimes an integer and sometimes a numeric string, causing various inconsistencies. See #16101, #22324, #25092, #25852, #43752, #44723 for example.

I've double-checked 47573.diff and made some adjustments to ensure the correct types when comparing.

#3 @SergeyBiryukov
10 months ago

  • Resolution set to fixed
  • Status changed from reviewing to closed

In 45710:

Coding Standards: Use strict comparison in wp-includes/taxonomy.php.

Props andizer, SergeyBiryukov.
Fixes #47573.

#4 @SergeyBiryukov
10 months ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

Hmm, for some reason the tests pass for me locally, but fail on Travis:
https://travis-ci.com/WordPress/wordpress-develop/builds/121609760

#5 @SergeyBiryukov
10 months ago

In 45711:

Taxonomy: Correct some strict comparisons after [45710].

See #47573.

#6 @SergeyBiryukov
10 months ago

  • Resolution set to fixed
  • Status changed from reopened to closed
Note: See TracTickets for help on using tickets.