Commit 120291367a for wordpress.org

commit 120291367ae76cba12abab4c946556ae94278fa2
Author: Sergey Biryukov <sergeybiryukov.ru@gmail.com>
Date:   Sun Oct 18 06:57:04 2020 +0000

    Formatting: Deprecate `wp_slash_strings_only()` in favor of `wp_slash()`.

    The reason for introducing `wp_slash_strings_only()` in [46454] was to keep non-string values untouched.

    Later, `wp_slash()` itself was updated in [48433] to prevent changing non-string values.

    To avoid confusion, `wp_slash_strings_only()` is now deprecated.

    Props ayeshrajans, ocean90.
    Fixes #50635.
    Built from https://develop.svn.wordpress.org/trunk@49188


    git-svn-id: http://core.svn.wordpress.org/trunk@48950 1a063a9b-81f0-0310-95a4-ce76da25c4cd

diff --git a/wp-includes/deprecated.php b/wp-includes/deprecated.php
index bde6bdd430..4361412a92 100644
--- a/wp-includes/deprecated.php
+++ b/wp-includes/deprecated.php
@@ -4101,3 +4101,36 @@ function remove_option_whitelist( $del_options, $options = '' ) {

 	return remove_allowed_options( $del_options, $options );
 }
+
+/**
+ * Adds slashes to only string values in an array of values.
+ *
+ * This should be used when preparing data for core APIs that expect slashed data.
+ * This should not be used to escape data going directly into an SQL query.
+ *
+ * @since 5.3.0
+ * @deprecated 5.6.0 Use wp_slash()
+ *
+ * @see wp_slash()
+ *
+ * @param mixed $value Scalar or array of scalars.
+ * @return mixed Slashes $value
+ */
+function wp_slash_strings_only( $value ) {
+	return map_deep( $value, 'addslashes_strings_only' );
+}
+
+/**
+ * Adds slashes only if the provided value is a string.
+ *
+ * @since 5.3.0
+ * @deprecated 5.6.0
+ *
+ * @see wp_slash()
+ *
+ * @param mixed $value
+ * @return mixed
+ */
+function addslashes_strings_only( $value ) {
+	return is_string( $value ) ? addslashes( $value ) : $value;
+}
diff --git a/wp-includes/formatting.php b/wp-includes/formatting.php
index 5bd8d5934a..1187efc52d 100644
--- a/wp-includes/formatting.php
+++ b/wp-includes/formatting.php
@@ -5545,33 +5545,6 @@ function wp_unslash( $value ) {
 	return stripslashes_deep( $value );
 }

-/**
- * Adds slashes to only string values in an array of values.
- *
- * This should be used when preparing data for core APIs that expect slashed data.
- * This should not be used to escape data going directly into an SQL query.
- *
- * @since 5.3.0
- *
- * @param mixed $value Scalar or array of scalars.
- * @return mixed Slashes $value
- */
-function wp_slash_strings_only( $value ) {
-	return map_deep( $value, 'addslashes_strings_only' );
-}
-
-/**
- * Adds slashes only if the provided value is a string.
- *
- * @since 5.3.0
- *
- * @param mixed $value
- * @return mixed
- */
-function addslashes_strings_only( $value ) {
-	return is_string( $value ) ? addslashes( $value ) : $value;
-}
-
 /**
  * Extract and return the first URL from passed content.
  *
diff --git a/wp-includes/rest-api/fields/class-wp-rest-meta-fields.php b/wp-includes/rest-api/fields/class-wp-rest-meta-fields.php
index f709afa85a..2d69e9e903 100644
--- a/wp-includes/rest-api/fields/class-wp-rest-meta-fields.php
+++ b/wp-includes/rest-api/fields/class-wp-rest-meta-fields.php
@@ -372,7 +372,7 @@ abstract class WP_REST_Meta_Fields {
 			return true;
 		}

-		if ( ! update_metadata( $meta_type, $object_id, wp_slash( $meta_key ), wp_slash_strings_only( $value ) ) ) {
+		if ( ! update_metadata( $meta_type, $object_id, wp_slash( $meta_key ), wp_slash( $value ) ) ) {
 			return new WP_Error(
 				'rest_meta_database_error',
 				/* translators: %s: Custom field key. */
diff --git a/wp-includes/version.php b/wp-includes/version.php
index 1987891bdb..8318fb87a1 100644
--- a/wp-includes/version.php
+++ b/wp-includes/version.php
@@ -13,7 +13,7 @@
  *
  * @global string $wp_version
  */
-$wp_version = '5.6-alpha-49187';
+$wp_version = '5.6-alpha-49188';

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