571 | | /** |
572 | | * Callback for wp_kses_split for fixing malformed HTML tags. |
573 | | * |
574 | | * This function does a lot of work. It rejects some very malformed things like |
575 | | * <:::>. It returns an empty string, if the element isn't allowed (look ma, no |
576 | | * strip_tags()!). Otherwise it splits the tag into an element and an attribute |
577 | | * list. |
578 | | * |
579 | | * After the tag is split into an element and an attribute list, it is run |
580 | | * through another filter which will remove illegal attributes and once that is |
581 | | * completed, will be returned. |
582 | | * |
583 | | * @access private |
584 | | * @since 1.0.0 |
585 | | * @uses wp_kses_attr() |
586 | | * |
587 | | * @param string $string Content to filter |
588 | | * @param array $allowed_html Allowed HTML elements |
589 | | * @param array $allowed_protocols Allowed protocols to keep |
590 | | * @return string Fixed HTML element |
591 | | */ |
592 | | function wp_kses_split2($string, $allowed_html, $allowed_protocols) { |
593 | | $string = wp_kses_stripslashes($string); |
594 | | |
| 606 | * Callback for wp_kses_split for fixing malformed HTML tags. |
| 607 | * |
| 608 | * This function does a lot of work. It rejects some very malformed things like |
| 609 | * <:::>. It returns an empty string, if the element isn't allowed (look ma, no |
| 610 | * strip_tags()!). Otherwise it splits the tag into an element and an attribute |
| 611 | * list. |
| 612 | * |
| 613 | * After the tag is split into an element and an attribute list, it is run |
| 614 | * through another filter which will remove illegal attributes and once that is |
| 615 | * completed, will be returned. |
| 616 | * |
| 617 | * @access private |
| 618 | * @since 1.0.0 |
| 619 | * @uses wp_kses_attr() |
| 620 | * |
| 621 | * @param string $string Content to filter |
| 622 | * @param array $allowed_html Allowed HTML elements |
| 623 | * @param array $allowed_protocols Allowed protocols to keep |
| 624 | * @return string Fixed HTML element |
| 625 | */ |
| 626 | function wp_kses_split2($string, $allowed_html, $allowed_protocols) { |
| 627 | $GLOBALS['pass_allowed'] = array( $allowed_html, $allowed_protocols ); |
| 628 | $match = array( 1 => $string); |
| 629 | _deprecated_function( 'wp_kses_split2', '3.0' ); |
| 630 | return _wp_kses_split_callback( $match ); |
| 631 | } |
| 632 | |
| 633 | /** |