WordPress.org

Make WordPress Core


Ignore:
Timestamp:
02/22/2010 06:25:51 PM (10 years ago)
Author:
nacin
Message:

Deprecate clean_url() for esc_url(). Fixes #12309

File:
1 edited

Legend:

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

    r13297 r13299  
    20752075
    20762076/**
     2077 * Checks and cleans a URL.
     2078 *
     2079 * A number of characters are removed from the URL. If the URL is for displaying
     2080 * (the default behaviour) amperstands are also replaced. The 'clean_url' filter
     2081 * is applied to the returned cleaned URL.
     2082 *
     2083 * @since 1.2.0
     2084 * @deprecated 3.0.0
     2085 * @deprecated Use esc_url()
     2086 * @see Alias for esc_url()
     2087 *
     2088 * @param string $url The URL to be cleaned.
     2089 * @param array $protocols Optional. An array of acceptable protocols.
     2090 * @param string $context Optional. How the URL will be used. Default is 'display'.
     2091 * @return string The cleaned $url after the 'clean_url' filter is applied.
     2092 */
     2093function clean_url( $url, $protocols = null, $context = 'display' ) {
     2094    if ( $context == 'db' )
     2095        _deprecated_function( 'clean_url( $context = \'db\' )', '3.0', 'esc_url_raw()' );
     2096    else
     2097        _deprecated_function( __FUNCTION__, '3.0', 'esc_url()' );
     2098    return esc_url( $url, $protocols, $context );
     2099}
     2100
     2101/**
    20772102 * Escape single quotes, specialchar double quotes, and fix line endings.
    20782103 *
Note: See TracChangeset for help on using the changeset viewer.