Changeset 46454 for trunk/src/wp-includes/formatting.php
- Timestamp:
- 10/09/2019 05:34:20 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/formatting.php
r46451 r46454 5408 5408 5409 5409 /** 5410 * Adds slashes to only string values in an array of values. 5411 * 5412 * This should be used when preparing data for core APIs that expect slashed data. 5413 * This should not be used to escape data going directly into an SQL query. 5414 * 5415 * @since 5.3.0 5416 * 5417 * @param mixed $value Scalar or array of scalars. 5418 * @return mixed Slashes $value 5419 */ 5420 function wp_slash_strings_only( $value ) { 5421 return map_deep( $value, 'addslashes_strings_only' ); 5422 } 5423 5424 /** 5425 * Adds slashes only if the provided value is a string. 5426 * 5427 * @since 5.3.0 5428 * 5429 * @param mixed $value 5430 * @return mixed 5431 */ 5432 function addslashes_strings_only( $value ) { 5433 return is_string( $value ) ? addslashes( $value ) : $value; 5434 } 5435 5436 /** 5410 5437 * Extract and return the first URL from passed content. 5411 5438 *
Note: See TracChangeset
for help on using the changeset viewer.