Make WordPress Core

Opened 5 years ago

Closed 5 years ago

#47573 closed enhancement (fixed)

Use strict comparison in wp-includes/taxonomy.php

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


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 5 years ago.

Download all attachments as: .zip

Change History (7)

5 years ago

#1 @SergeyBiryukov
5 years ago

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

#2 @SergeyBiryukov
5 years 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
5 years 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
5 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

Hmm, for some reason the tests pass for me locally, but fail on Travis:

#5 @SergeyBiryukov
5 years ago

In 45711:

Taxonomy: Correct some strict comparisons after [45710].

See #47573.

#6 @SergeyBiryukov
5 years ago

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