Skip to content

Commit eb41143

Browse files
authored
Update kses.php to fix deprecated warnings
Update kses.php to fix deprecated warnings: -- Backtrace from warning 'preg_replace(): Passing null to parameter WordPress#3 ($subject) of type array|string is deprecated' at /wp-includes/kses.php 1805: This was the line of code causing the error: $content = preg_replace( '/[\x00-\x08\x0B\x0C\x0E-\x1F]/', '', $content );
1 parent 59f3fef commit eb41143

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎src/wp-includes/kses.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1804,7 +1804,7 @@ function wp_kses_no_null( $content, $options = null ) {
18041804
$options = array( 'slash_zero' => 'remove' );
18051805
}
18061806

1807-
$content = preg_replace( '/[\x00-\x08\x0B\x0C\x0E-\x1F]/', '', $content );
1807+
$content = preg_replace('/[\x00-\x08\x0B\x0C\x0E-\x1F]/', '', $content ?? '');
18081808
if ( 'remove' === $options['slash_zero'] ) {
18091809
$content = preg_replace( '/\\\\+0+/', '', $content );
18101810
}

0 commit comments

Comments
 (0)