| 31 | | static $static_setup = false, $opening_quote, $closing_quote, $default_no_texturize_tags, $default_no_texturize_shortcodes, $static_characters, $static_replacements, $dynamic_characters, $dynamic_replacements; |
| 32 | | $output = ''; |
| 33 | | $curl = ''; |
| 34 | | $textarr = preg_split('/(<.*>|\[.*\])/Us', $text, -1, PREG_SPLIT_DELIM_CAPTURE); |
| 35 | | $stop = count($textarr); |
| | 31 | static $opening_quote, $closing_quote, $default_no_texturize_tags, $default_no_texturize_shortcodes, $static_characters, $static_replacements, $dynamic_characters, $dynamic_replacements; |
| 58 | 54 | |
| 59 | 55 | $dynamic_characters = array('/\'(\d\d(?:’|\')?s)/', '/\'(\d)/', '/(\s|\A|[([{<]|")\'/', '/(\d)"/', '/(\d)\'/', '/(\S)\'([^\'\s])/', '/(\s|\A|[([{<])"(?!\s)/', '/"(\s|\S|\Z)/', '/\'([\s.]|\Z)/', '/\b(\d+)x(\d+)\b/'); |
| 60 | 56 | $dynamic_replacements = array('’$1','’$1', '$1‘', '$1″', '$1′', '$1’$2', '$1' . $opening_quote . '$2', $closing_quote . '$1', '’$1', '$1×$2'); |
| 76 | | if ( !empty($curl) && '<' != $curl[0] && '[' != $curl[0] |
| 77 | | && empty($no_texturize_shortcodes_stack) && empty($no_texturize_tags_stack)) { |
| 78 | | // This is not a tag, nor is the texturization disabled |
| 79 | | // static strings |
| | 69 | foreach( $textarr as &$curl ) { |
| | 70 | if ( empty( $curl ) ) |
| | 71 | continue; |
| | 72 | |
| | 73 | // Only call _wptexturize_pushpop_element if first char is correct tag opening |
| | 74 | $first = $curl[0]; |
| | 75 | if ('<' === $first) { |
| | 76 | _wptexturize_pushpop_element($curl, $no_texturize_tags_stack, $no_texturize_tags, '<', '>'); |
| | 77 | } elseif ('[' === $first) { |
| | 78 | _wptexturize_pushpop_element($curl, $no_texturize_shortcodes_stack, $no_texturize_shortcodes, '[', ']'); |
| | 79 | } elseif (empty($no_texturize_shortcodes_stack) && empty($no_texturize_tags_stack)) { |
| | 80 | // This is not a tag, nor is the texturization disabled static strings |