Changeset 23554 for trunk/wp-includes/formatting.php
- Timestamp:
- 03/01/2013 04:28:40 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/formatting.php
r23466 r23554 1717 1717 */ 1718 1718 function wp_rel_nofollow( $text ) { 1719 // This is a pre save filter, so text is already escaped. 1720 $text = stripslashes($text); 1719 1721 $text = preg_replace_callback('|<a (.+?)>|i', 'wp_rel_nofollow_callback', $text); 1722 $text = esc_sql($text); 1720 1723 return $text; 1721 1724 } … … 3340 3343 return apply_filters( 'sanitize_trackback_urls', $urls_to_ping, $to_ping ); 3341 3344 } 3342 3343 /**3344 * Conditionally add slashes to a string or array of strings. When GPCS3345 * slashing is turned on, slashes are added. When GPCS slashing is turned off,3346 * slashes are not added.3347 *3348 * This should be used when preparing data for core API that deal directly with GPCS data.3349 * Outside of unit tests, this should be rare. At a future date GPCS will no longer3350 * be slashed and this function will noop. Do not use it in situations where adding slashes3351 * is always required regardless of whether GPCS is slashed.3352 *3353 * @since 3.6.03354 *3355 * @param string|array $value String or array of strings to slash.3356 * @return string|array Slashed $value3357 */3358 function wp_slash( $value ) {3359 if ( is_array( $value ) ) {3360 foreach ( $value as $k => $v ) {3361 if ( is_array( $v ) ) {3362 $value[$k] = wp_slash( $v );3363 } else {3364 $value[$k] = addslashes( $v );3365 }3366 }3367 } else {3368 $value = addslashes( $value );3369 }3370 3371 return $value;3372 }3373 3374 /**3375 * Conditionally removes slashes from a string or array of strings. When GPCS3376 * slashing is turned on, slashes are stripped. When GPCS slashing is turned off,3377 * slashes are not stripped.3378 *3379 * This should be used for GPCS data before passing it along to core API. At a future3380 * date GPCS will no longer be slashed and this function will noop. Do not use it3381 * in situations where slash stripping is always required regardless of whether GPCS3382 * is slashed.3383 *3384 * @since 3.6.03385 *3386 * @param string|array $value String or array of strings to unslash.3387 * @return string|array Unslashed $value3388 */3389 function wp_unslash( $value ) {3390 return stripslashes_deep( $value );3391 }
Note: See TracChangeset
for help on using the changeset viewer.