#56338 closed defect (bug) (fixed)
`taxonomy_exists()` does not guard against non-string arguments.
| Reported by: | costdev | Owned by: | audrasjb |
|---|---|---|---|
| Priority: | normal | Milestone: | 6.1 |
| Component: | Taxonomy | Version: | 3.0 |
| Severity: | normal | Keywords: | php8 has-patch has-unit-tests commit |
| Cc: | Focuses: |
Description
Follow-up to #56336.
While testing the issue reported by @dd32, I came across a similar warning/error. This can be produced, for example, when using Yoast SEO for sitemaps.
Warning: Illegal offset type in isset or empty in src/wp-includes/taxonomy.php on line 340
Tested and verified by @peterwilsoncc
Adding an is_string( $taxonomy ) check to the condition in taxonomy_exists resolves the issue. The $taxonomy argument is documented as a string.
Change History (9)
This ticket was mentioned in PR #3066 on WordPress/wordpress-develop by costdev.
4 years ago
#1
- Keywords has-patch has-unit-tests added
mukeshpanchal27 commented on PR #3066:
4 years ago
#3
@costdev Can you please add test coverage for the special characters?
4 years ago
#4
@costdev Can you please add test coverage for the special characters?
Hi @mukeshpanchal27, I'm not sure what you mean. Which special characters will trigger an illegal offset warning/error?
#6
@
4 years ago
- Owner changed from to
- Status assigned → accepted
Looks good to go. Self-assigning for commit.
4 years ago
#8
committed in https://core.trac.wordpress.org/changeset/53869
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Trac ticket: https://core.trac.wordpress.org/ticket/56338