Changeset 11245 for trunk/wp-includes/formatting.php
- Timestamp:
- 05/09/2009 07:27:22 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/formatting.php
r11215 r11245 2055 2055 * The filter 'js_escape' is also applied here. 2056 2056 * 2057 * @since 2. 0.42057 * @since 2.8.0 2058 2058 * 2059 2059 * @param string $text The text to be escaped. 2060 2060 * @return string Escaped text. 2061 2061 */ 2062 function js_escape($text) {2062 function esc_js( $text ) { 2063 2063 $safe_text = wp_check_invalid_utf8( $text ); 2064 2064 $safe_text = wp_specialchars( $safe_text, ENT_COMPAT ); … … 2066 2066 $safe_text = preg_replace( "/\r?\n/", "\\n", addslashes( $safe_text ) ); 2067 2067 return apply_filters( 'js_escape', $safe_text, $text ); 2068 } 2069 2070 /** 2071 * Escape single quotes, specialchar double quotes, and fix line endings. 2072 * 2073 * The filter 'js_escape' is also applied by esc_js() 2074 * 2075 * @since 2.0.4 2076 * 2077 * @deprecated 2.8.0 2078 * @see esc_js() 2079 * 2080 * @param string $text The text to be escaped. 2081 * @return string Escaped text. 2082 */ 2083 function js_escape( $text ) { 2084 return esc_js( $text ); 2068 2085 } 2069 2086
Note: See TracChangeset
for help on using the changeset viewer.