Make WordPress Core


Ignore:
Timestamp:
02/13/2010 07:28:19 AM (14 years ago)
Author:
nacin
Message:

Deprecate old l10n and sanitization APIs. Deprecate ngettext() for _n(), ngettext_noop() for _n_noop(), translate_with_context() for _x(). Deprecate sanitize_url for esc_url_raw, js_escape for esc_js, wp_specialchars for esc_html, attribute_escape for esc_attr. See #11388

File:
1 edited

Legend:

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

    r13089 r13096  
    13991399}
    14001400
    1401 
    14021401/**
    14031402 * Convert one smiley code to the icon graphic file equivalent.
     
    14291428    return " <img src='$srcurl' alt='$smiley_masked' class='wp-smiley' /> ";
    14301429}
    1431 
    14321430
    14331431/**
     
    22272225}
    22282226
    2229 
    22302227/**
    22312228 * Checks and cleans a URL.
     
    22622259 */
    22632260function esc_url_raw( $url, $protocols = null ) {
    2264     return clean_url( $url, $protocols, 'db' );
    2265 }
    2266 
    2267 /**
    2268  * Performs esc_url() for database or redirect usage.
    2269  *
    2270  * @see esc_url()
    2271  * @deprecated 2.8.0
    2272  *
    2273  * @since 2.3.1
    2274  *
    2275  * @param string $url The URL to be cleaned.
    2276  * @param array $protocols An array of acceptable protocols.
    2277  * @return string The cleaned URL.
    2278  */
    2279 function sanitize_url( $url, $protocols = null ) {
    22802261    return clean_url( $url, $protocols, 'db' );
    22812262}
     
    23192300
    23202301/**
    2321  * Escape single quotes, specialchar double quotes, and fix line endings.
    2322  *
    2323  * The filter 'js_escape' is also applied by esc_js()
    2324  *
    2325  * @since 2.0.4
    2326  *
    2327  * @deprecated 2.8.0
    2328  * @see esc_js()
    2329  *
    2330  * @param string $text The text to be escaped.
    2331  * @return string Escaped text.
    2332  */
    2333 function js_escape( $text ) {
    2334     return esc_js( $text );
    2335 }
    2336 
    2337 /**
    23382302 * Escaping for HTML blocks.
    23392303 *
     
    23502314
    23512315/**
    2352  * Escaping for HTML blocks
    2353  * @deprecated 2.8.0
    2354  * @see esc_html()
    2355  */
    2356 function wp_specialchars( $string, $quote_style = ENT_NOQUOTES, $charset = false, $double_encode = false ) {
    2357     if ( func_num_args() > 1 ) { // Maintain backwards compat for people passing additional args
    2358         $args = func_get_args();
    2359         return call_user_func_array( '_wp_specialchars', $args );
    2360     } else {
    2361         return esc_html( $string );
    2362     }
    2363 }
    2364 
    2365 /**
    23662316 * Escaping for HTML attributes.
    23672317 *
     
    23752325    $safe_text = _wp_specialchars( $safe_text, ENT_QUOTES );
    23762326    return apply_filters( 'attribute_escape', $safe_text, $text );
    2377 }
    2378 
    2379 /**
    2380  * Escaping for HTML attributes.
    2381  *
    2382  * @since 2.0.6
    2383  *
    2384  * @deprecated 2.8.0
    2385  * @see esc_attr()
    2386  *
    2387  * @param string $text
    2388  * @return string
    2389  */
    2390 function attribute_escape( $text ) {
    2391     return esc_attr( $text );
    23922327}
    23932328
Note: See TracChangeset for help on using the changeset viewer.