#56338 closed defect (bug) (fixed)
`taxonomy_exists()` does not guard against non-string arguments.
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 6.1 | Priority: | normal |
Severity: | normal | Version: | 3.0 |
Component: | Taxonomy | Keywords: | php8 has-patch has-unit-tests commit |
Focuses: | Cc: |
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.
10 months ago
#1
- Keywords has-patch has-unit-tests added
mukeshpanchal27 commented on PR #3066:
10 months ago
#3
@costdev Can you please add test coverage for the special characters?
10 months 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
@
10 months ago
- Owner changed from costdev to audrasjb
- Status changed from assigned to accepted
Looks good to go. Self-assigning for commit
.
10 months ago
#8
committed in https://core.trac.wordpress.org/changeset/53869
Trac ticket: https://core.trac.wordpress.org/ticket/56338