Changeset 23416 for trunk/wp-includes/formatting.php
- Timestamp:
- 02/14/2013 10:51:06 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/formatting.php
r23368 r23416 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);1721 1719 $text = preg_replace_callback('|<a (.+?)>|i', 'wp_rel_nofollow_callback', $text); 1722 $text = esc_sql($text);1723 1720 return $text; 1724 1721 } … … 3343 3340 return apply_filters( 'sanitize_trackback_urls', $urls_to_ping, $to_ping ); 3344 3341 } 3342 3343 /** 3344 * Conditionally add slashes to a string or array of strings. When GPCS 3345 * 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 longer 3350 * be slashed and this function will noop. Do not use it in situations where adding slashes 3351 * is always required regardless of whether GPCS is slashed. 3352 * 3353 * @since 3.6.0 3354 * 3355 * @param string|array $value String or array of strings to slash. 3356 * @return string|array Slashed $value 3357 */ 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 GPCS 3376 * 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 future 3380 * date GPCS will no longer be slashed and this function will noop. Do not use it 3381 * in situations where slash stripping is always required regardless of whether GPCS 3382 * is slashed. 3383 * 3384 * @since 3.6.0 3385 * 3386 * @param string|array $value String or array of strings to unslash. 3387 * @return string|array Unslashed $value 3388 */ 3389 function wp_unslash( $value ) { 3390 return stripslashes_deep( $value ); 3391 }
Note: See TracChangeset
for help on using the changeset viewer.