Skip to content

Commit d5c4817

Browse files
author
pento
committed
Formatting: Add type checking to _sanitize_text_fields().
When a non-string value is passed, return an empty string. Props Mte90. Fixes #41450. Built from https://develop.svn.wordpress.org/trunk@44618 git-svn-id: http://core.svn.wordpress.org/trunk@44449 1a063a9b-81f0-0310-95a4-ce76da25c4cd
1 parent 67a89a7 commit d5c4817

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

wp-includes/formatting.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5102,6 +5102,10 @@ function sanitize_textarea_field( $str ) {
51025102
* @return string Sanitized string.
51035103
*/
51045104
function _sanitize_text_fields( $str, $keep_newlines = false ) {
5105+
if ( ! is_string( $str ) ) {
5106+
return '';
5107+
}
5108+
51055109
$filtered = wp_check_invalid_utf8( $str );
51065110

51075111
if ( strpos( $filtered, '<' ) !== false ) {

wp-includes/version.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
*
1414
* @global string $wp_version
1515
*/
16-
$wp_version = '5.1-beta1-44617';
16+
$wp_version = '5.1-beta1-44618';
1717

1818
/**
1919
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.

0 commit comments

Comments
 (0)