Ticket #14245: 14245.diff
File 14245.diff, 3.4 KB (added by , 14 years ago) |
---|
-
wp-includes/post-template.php
225 225 226 226 } 227 227 if ( $preview ) // preview fix for javascript bug with foreign languages 228 $output = preg_replace_callback('/\%u([0-9A-F]{4})/', create_function('$match', 'return "&#" . base_convert($match[1], 16, 10) . ";";'), $output);228 $output = preg_replace_callback( '/\%u([0-9A-F]{4})/', 'funky_javascript_callback', $output ); 229 229 230 230 return $output; 231 231 } 232 232 233 233 /** 234 * Callback used to change %uXXXX to &#YYY; syntax 235 * 236 * @since 2.8.0 237 * @access private 238 * 239 * @param array $matches Single Match 240 * @return string An HTML entity 241 */ 242 function funky_javascript_callback( $matches ) { 243 return '&#' . base_convert( $matches[1], 16, 10 ) . ';'; 244 } 245 246 /** 234 247 * Display the post excerpt. 235 248 * 236 249 * @since 0.71 -
wp-includes/deprecated.php
2462 2462 } 2463 2463 2464 2464 /** 2465 * Callback used to change %uXXXX to &#YYY; syntax2466 *2467 * @since 2.8.02468 * @access private2469 * @deprecated 3.0.02470 *2471 * @param array $matches Single Match2472 * @return string An HTML entity2473 */2474 function funky_javascript_callback($matches) {2475 return "&#".base_convert($matches[1],16,10).";";2476 }2477 2478 /**2479 2465 * Fixes javascript bugs in browsers. 2480 2466 * 2481 2467 * Converts unicode characters to HTML numbered entities. … … 2495 2481 2496 2482 if ( $is_winIE || $is_macIE ) 2497 2483 $text = preg_replace_callback("/\%u([0-9A-F]{4,4})/", 2498 "funky_javascript_callback",2484 'funky_javascript_callback', 2499 2485 $text); 2500 2486 2501 2487 return $text; -
wp-includes/kses.php
546 546 global $pass_allowed_html, $pass_allowed_protocols; 547 547 $pass_allowed_html = $allowed_html; 548 548 $pass_allowed_protocols = $allowed_protocols; 549 return preg_replace_callback('%((<!--.*?(-->|$))|(<[^>]*(>|$)|>))%', 550 create_function('$match', 'global $pass_allowed_html, $pass_allowed_protocols; return wp_kses_split2($match[1], $pass_allowed_html, $pass_allowed_protocols);'), $string); 549 return preg_replace_callback( '%((<!--.*?(-->|$))|(<[^>]*(>|$)|>))%', 'wp_kses_split2', $string ); 551 550 } 552 551 553 552 /** … … 566 565 * @since 1.0.0 567 566 * @uses wp_kses_attr() 568 567 * 569 * @param string $string Content to filter570 * @param array $allowed_html Allowed HTML elements 571 * @param array $allowed_protocols Allowed protocols to keep 568 * @param mixed $string Content to filter. If array, then takes $string[1]. 569 * @param array $allowed_html Allowed HTML elements. Defaults to $pass_allowed_html global. 570 * @param array $allowed_protocols Allowed protocols to keep. Defaults to $pass_allowed_protocols global. 572 571 * @return string Fixed HTML element 573 572 */ 574 function wp_kses_split2($string, $allowed_html, $allowed_protocols) { 573 function wp_kses_split2($string, $allowed_html = null, $allowed_protocols = null ) { 574 if ( is_array( $string ) ) 575 $string = $string[1]; 576 if ( null === $allowed_html ) 577 $allowed_html = $GLOBALS['pass_allowed_html']; 578 if ( null === $allowed_protocols ) 579 $allowed_protocols = $GLOBALS['pass_allowed_protocols']; 580 575 581 $string = wp_kses_stripslashes($string); 576 582 577 583 if (substr($string, 0, 1) != '<')