Ticket #43224: 43224.patch
File 43224.patch, 1.1 KB (added by , 7 years ago) |
---|
-
src/wp-includes/formatting.php
1094 1094 } 1095 1095 1096 1096 /** 1097 * Checks support for utf8 in the installed PCRE library. 1098 * 1099 * @since 5.0.0 1100 * 1101 * @staticvar bool $can 1102 * 1103 * @return bool True if installed PCRE library supports the `/u` flag. 1104 */ 1105 function wp_can_utf8_pcre() { 1106 static $can = null; 1107 1108 if ( ! isset( $can ) ) { 1109 $can = (bool) @preg_match( '/^./u', 'a' ); 1110 } 1111 1112 return $can; 1113 } 1114 1115 /** 1097 1116 * Checks for invalid UTF8 in a string. 1098 1117 * 1099 1118 * @since 2.8.0 … … 1121 1140 return $string; 1122 1141 } 1123 1142 1124 // Check for support for utf8 in the installed PCRE library once and store the result in a static1125 static $utf8_pcre = null;1126 if ( ! isset( $utf8_pcre ) ) {1127 $utf8_pcre = @preg_match( '/^./u', 'a' );1128 }1129 1143 // We can't demand utf8 in the PCRE installation, so just return the string in those cases 1130 if ( ! $utf8_pcre) {1144 if ( ! wp_can_utf8_pcre() ) { 1131 1145 return $string; 1132 1146 } 1133 1147