Changeset 32860 for trunk/src/wp-includes/kses.php
- Timestamp:
- 06/19/2015 06:46:11 PM (11 years ago)
- File:
-
- 1 edited
-
trunk/src/wp-includes/kses.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/kses.php
r32733 r32860 522 522 if ( empty( $allowed_protocols ) ) 523 523 $allowed_protocols = wp_allowed_protocols(); 524 $string = wp_kses_no_null( $string);524 $string = wp_kses_no_null( $string, array( 'slash_zero' => 'keep' ) ); 525 525 $string = wp_kses_js_entities($string); 526 526 $string = wp_kses_normalize_entities($string); … … 1045 1045 * 1046 1046 * @param string $string 1047 * @param array $options Set 'slash_zero' => 'keep' when '\0' is allowed. Default is 'remove'. 1047 1048 * @return string 1048 1049 */ 1049 function wp_kses_no_null($string) { 1050 $string = preg_replace('/[\x00-\x08\x0B\x0C\x0E-\x1F]/', '', $string); 1051 $string = preg_replace('/(\\\\0)+/', '', $string); 1050 function wp_kses_no_null( $string, $options = null ) { 1051 if ( ! isset( $options['slash_zero'] ) ) { 1052 $options = array( 'slash_zero' => 'remove' ); 1053 } 1054 1055 $string = preg_replace( '/[\x00-\x08\x0B\x0C\x0E-\x1F]/', '', $string ); 1056 if ( 'remove' == $options['slash_zero'] ) { 1057 $string = preg_replace( '/\\\\+0+/', '', $string ); 1058 } 1052 1059 1053 1060 return $string;
Note: See TracChangeset
for help on using the changeset viewer.