Skip to content

fix: add a wrapper around wp_kses_post() function to allow for null#3049

Draft
Levdbas wants to merge 1 commit into2.xfrom
3008-bug-deprecated-preg_replace-passing-null-to-parameter-3-subject-of-type-arraystring-is-deprecated
Draft

fix: add a wrapper around wp_kses_post() function to allow for null#3049
Levdbas wants to merge 1 commit into2.xfrom
3008-bug-deprecated-preg_replace-passing-null-to-parameter-3-subject-of-type-arraystring-is-deprecated

Conversation

@Levdbas
Copy link
Copy Markdown
Member

@Levdbas Levdbas commented Oct 8, 2024

Related:

Issue

wp_kses_post() function does not allow null values.

Solution

Wrap the function in a method to bail early before escaping

Impact

Better escaping

Usage Changes

No.

Considerations

There might be a better way to achieve this? If so, let me know

Testing

Yes

…alues. This prevents errors when the provided string is null.
@coveralls
Copy link
Copy Markdown

Coverage Status

coverage: 88.022% (+0.008%) from 88.014%
when pulling 6e6365f on 3008-bug-deprecated-preg_replace-passing-null-to-parameter-3-subject-of-type-arraystring-is-deprecated
into 5d64d9a on 2.x.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Deprecated: preg_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated

2 participants