Changeset 11383 for trunk/wp-includes/formatting.php
- Timestamp:
- 05/18/2009 04:00:33 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/formatting.php
r11380 r11383 1150 1150 function _make_url_clickable_cb($matches) { 1151 1151 $url = $matches[2]; 1152 $url = clean_url($url);1152 $url = esc_url($url); 1153 1153 if ( empty($url) ) 1154 1154 return $matches[0]; … … 1172 1172 $dest = $matches[2]; 1173 1173 $dest = 'http://' . $dest; 1174 $dest = clean_url($dest);1174 $dest = esc_url($dest); 1175 1175 if ( empty($dest) ) 1176 1176 return $matches[0]; … … 1989 1989 * 1990 1990 * A number of characters are removed from the URL. If the URL is for displaying 1991 * (the default behaviour) amperstands are also replaced. The ' clean_url' filter1991 * (the default behaviour) amperstands are also replaced. The 'esc_url' filter 1992 1992 * is applied to the returned cleaned URL. 1993 1993 * … … 2033 2033 2034 2034 /** 2035 * Performs clean_url() for database usage. 2036 * 2037 * @see clean_url() 2035 * Checks and cleans a URL. 2036 * 2037 * A number of characters are removed from the URL. If the URL is for displaying 2038 * (the default behaviour) amperstands are also replaced. The 'esc_url' filter 2039 * is applied to the returned cleaned URL. 2040 * 2041 * @since 2.8.0 2042 * @uses esc_url() 2043 * @uses wp_kses_bad_protocol() To only permit protocols in the URL set 2044 * via $protocols or the common ones set in the function. 2045 * 2046 * @param string $url The URL to be cleaned. 2047 * @param array $protocols Optional. An array of acceptable protocols. 2048 * Defaults to 'http', 'https', 'ftp', 'ftps', 'mailto', 'news', 'irc', 'gopher', 'nntp', 'feed', 'telnet' if not set. 2049 * @return string The cleaned $url after the 'cleaned_url' filter is applied. 2050 */ 2051 function esc_url( $url, $protocols = null ) { 2052 return clean_url( $url, $protocols, 'display' ); 2053 } 2054 2055 /** 2056 * Performs esc_url() for database usage. 2057 * 2058 * @see esc_url() 2059 * @see esc_url() 2060 * 2061 * @since 2.8.0 2062 * 2063 * @param string $url The URL to be cleaned. 2064 * @param array $protocols An array of acceptable protocols. 2065 * @return string The cleaned URL. 2066 */ 2067 function esc_url_raw( $url, $protocols = null ) { 2068 return clean_url( $url, $protocols, 'db' ); 2069 } 2070 2071 /** 2072 * Performs esc_url() for database or redirect usage. 2073 * 2074 * @see esc_url() 2075 * @deprecated 2.8.0 2038 2076 * 2039 2077 * @since 2.3.1 … … 2281 2319 case 'home': 2282 2320 $value = stripslashes($value); 2283 $value = clean_url($value);2321 $value = esc_url($value); 2284 2322 break; 2285 2323 default :
Note: See TracChangeset
for help on using the changeset viewer.