Changeset 37646 for trunk/src/wp-includes/functions.php
- Timestamp:
- 06/06/2016 09:33:30 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/functions.php
r37543 r37646 3106 3106 3107 3107 /** 3108 * Check that a JSONP callback is a valid JavaScript callback. 3109 * 3110 * Only allows alphanumeric characters and the dot character in callback 3111 * function names. This helps to mitigate XSS attacks caused by directly 3112 * outputting user input. 3113 * 3114 * @since 4.6.0 3115 * 3116 * @param string $callback Supplied JSONP callback function. 3117 * @return bool True if valid callback, otherwise false. 3118 */ 3119 function wp_check_jsonp_callback( $callback ) { 3120 if ( ! is_string( $callback ) ) { 3121 return false; 3122 } 3123 3124 $jsonp_callback = preg_replace( '/[^\w\.]/', '', $callback, -1, $illegal_char_count ); 3125 3126 return 0 === $illegal_char_count; 3127 } 3128 3129 /** 3108 3130 * Retrieve the WordPress home page URL. 3109 3131 *
Note: See TracChangeset
for help on using the changeset viewer.