Make WordPress Core


Ignore:
Timestamp:
03/01/2013 04:28:40 PM (12 years ago)
Author:
ryan
Message:

Revert 23416, 23419, 23445 except for wp_reset_vars() changes. We are going a different direction with the slashing cleanup, so resetting to a clean slate. see #21767

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/formatting.php

    r23466 r23554  
    17171717 */
    17181718function wp_rel_nofollow( $text ) {
     1719    // This is a pre save filter, so text is already escaped.
     1720    $text = stripslashes($text);
    17191721    $text = preg_replace_callback('|<a (.+?)>|i', 'wp_rel_nofollow_callback', $text);
     1722    $text = esc_sql($text);
    17201723    return $text;
    17211724}
     
    33403343    return apply_filters( 'sanitize_trackback_urls', $urls_to_ping, $to_ping );
    33413344}
    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.