- 8F357ED8C80C0CA11D8F4C97243F23AE535672FD5D9C83E43DDFE14B6D1BA191B920801ED8C9AC0168E61F6E626634D0041985DE3AFC69FFE6AF6AE2FBDED7C7
+ 8A1954E0681A8C454FAA3583568B572BA75B27FD048649AD65BF1FF8CB1CD92452980EB0F26B818C635C1F8398197EA4570C461A8358866672004448E6DE4BC4
mp-wp/wp-includes/formatting.php
(8 . 76)(8 . 6)
36757 **/^M
36758 ^M
36759 /**^M
36760 * Replaces common plain text characters into formatted entities^M
36761 *^M
36762 * As an example,^M
36763 * <code>^M
36764 * 'cause today's effort makes it worth tomorrow's "holiday"...^M
36765 * </code>^M
36766 * Becomes:^M
36767 * <code>^M
36768 * ’cause today’s effort makes it worth tomorrow’s “holiday”…^M
36769 * </code>^M
36770 * Code within certain html blocks are skipped.^M
36771 *^M
36772 * @since 0.71^M
36773 * @uses $wp_cockneyreplace Array of formatted entities for certain common phrases^M
36774 *^M
36775 * @param string $text The text to be formatted^M
36776 * @return string The string replaced with html entities^M
36777 */^M
36778 function wptexturize($text) {^M
36779 /* global $wp_cockneyreplace;^M
36780 $next = true;^M
36781 $has_pre_parent = false;^M
36782 $output = '';^M
36783 $curl = '';^M
36784 $textarr = preg_split('/(<.*>|\[.*\])/Us', $text, -1, PREG_SPLIT_DELIM_CAPTURE);^M
36785 $stop = count($textarr);^M
36786 ^M
36787 // if a plugin has provided an autocorrect array, use it^M
36788 if ( isset($wp_cockneyreplace) ) {^M
36789 $cockney = array_keys($wp_cockneyreplace);^M
36790 $cockneyreplace = array_values($wp_cockneyreplace);^M
36791 } else {^M
36792 $cockney = array("'tain't","'twere","'twas","'tis","'twill","'til","'bout","'nuff","'round","'cause");^M
36793 $cockneyreplace = array("’tain’t","’twere","’twas","’tis","’twill","’til","’bout","’nuff","’round","’cause");^M
36794 }^M
36795 ^M
36796 $static_characters = array_merge(array('---', ' -- ', '--', 'xn–', '...', '``', '\'s', '\'\'', ' (tm)'), $cockney);^M
36797 $static_replacements = array_merge(array('—', ' — ', '–', 'xn--', '…', '“', '’s', '”', ' ™'), $cockneyreplace);^M
36798 ^M
36799 $dynamic_characters = array('/\'(\d\d(?:’|\')?s)/', '/(\s|\A|")\'/', '/(\d+)"/', '/(\d+)\'/', '/(\S)\'([^\'\s])/', '/(\s|\A)"(?!\s)/', '/"(\s|\S|\Z)/', '/\'([\s.]|\Z)/', '/(\d+)x(\d+)/');^M
36800 $dynamic_replacements = array('’$1','$1‘', '$1″', '$1′', '$1’$2', '$1“$2', '”$1', '’$1', '$1×$2');^M
36801 ^M
36802 for ( $i = 0; $i < $stop; $i++ ) {^M
36803 $curl = $textarr[$i];^M
36804 ^M
36805 if ( !empty($curl) && '<' != $curl{0} && '[' != $curl{0} && $next && !$has_pre_parent) { // If it's not a tag^M
36806 // static strings^M
36807 $curl = str_replace($static_characters, $static_replacements, $curl);^M
36808 // regular expressions^M
36809 $curl = preg_replace($dynamic_characters, $dynamic_replacements, $curl);^M
36810 } elseif (strpos($curl, '<code') !== false || strpos($curl, '<kbd') !== false || strpos($curl, '<style') !== false || strpos($curl, '<script') !== false) {^M
36811 $next = false;^M
36812 } elseif (strpos($curl, '<pre') !== false) {^M
36813 $has_pre_parent = true;^M
36814 } elseif (strpos($curl, '</pre>') !== false) {^M
36815 $has_pre_parent = false;^M
36816 } else {^M
36817 $next = true;^M
36818 }^M
36819 ^M
36820 $curl = preg_replace('/&([^#])(?![a-zA-Z1-4]{1,8};)/', '&$1', $curl);^M
36821 $output .= $curl;^M
36822 }^M
36823 ^M
36824 return $output;^M
36825 */^M
36826 return $text; ^M
36827 }^M
36828 ^M
36829 /**^M
36830 * Accepts matches array from preg_replace_callback in wpautop() or a string.^M
36831 *^M
36832 * Ensures that the contents of a <<pre>>...<</pre>> HTML block are not^M