Resources
1 year ago
Mbstring.php
6 months ago
bootstrap.php
1 year ago
bootstrap80.php
1 year ago
index.php
3 years ago
bootstrap.php
255 lines
| 1 | <?php |
| 2 | if (!defined('ABSPATH')) exit; |
| 3 | use MailPoetVendor\Symfony\Polyfill\Mbstring as p; |
| 4 | if (\PHP_VERSION_ID >= 80000) { |
| 5 | return require __DIR__ . '/bootstrap80.php'; |
| 6 | } |
| 7 | if (!\function_exists('mb_convert_encoding')) { |
| 8 | function mb_convert_encoding($string, $to_encoding, $from_encoding = null) |
| 9 | { |
| 10 | return p\Mbstring::mb_convert_encoding($string, $to_encoding, $from_encoding); |
| 11 | } |
| 12 | } |
| 13 | if (!\function_exists('mb_decode_mimeheader')) { |
| 14 | function mb_decode_mimeheader($string) |
| 15 | { |
| 16 | return p\Mbstring::mb_decode_mimeheader($string); |
| 17 | } |
| 18 | } |
| 19 | if (!\function_exists('mb_encode_mimeheader')) { |
| 20 | function mb_encode_mimeheader($string, $charset = null, $transfer_encoding = null, $newline = "\r\n", $indent = 0) |
| 21 | { |
| 22 | return p\Mbstring::mb_encode_mimeheader($string, $charset, $transfer_encoding, $newline, $indent); |
| 23 | } |
| 24 | } |
| 25 | if (!\function_exists('mb_decode_numericentity')) { |
| 26 | function mb_decode_numericentity($string, $map, $encoding = null) |
| 27 | { |
| 28 | return p\Mbstring::mb_decode_numericentity($string, $map, $encoding); |
| 29 | } |
| 30 | } |
| 31 | if (!\function_exists('mb_encode_numericentity')) { |
| 32 | function mb_encode_numericentity($string, $map, $encoding = null, $hex = \false) |
| 33 | { |
| 34 | return p\Mbstring::mb_encode_numericentity($string, $map, $encoding, $hex); |
| 35 | } |
| 36 | } |
| 37 | if (!\function_exists('mb_convert_case')) { |
| 38 | function mb_convert_case($string, $mode, $encoding = null) |
| 39 | { |
| 40 | return p\Mbstring::mb_convert_case($string, $mode, $encoding); |
| 41 | } |
| 42 | } |
| 43 | if (!\function_exists('mb_internal_encoding')) { |
| 44 | function mb_internal_encoding($encoding = null) |
| 45 | { |
| 46 | return p\Mbstring::mb_internal_encoding($encoding); |
| 47 | } |
| 48 | } |
| 49 | if (!\function_exists('mb_language')) { |
| 50 | function mb_language($language = null) |
| 51 | { |
| 52 | return p\Mbstring::mb_language($language); |
| 53 | } |
| 54 | } |
| 55 | if (!\function_exists('mb_list_encodings')) { |
| 56 | function mb_list_encodings() |
| 57 | { |
| 58 | return p\Mbstring::mb_list_encodings(); |
| 59 | } |
| 60 | } |
| 61 | if (!\function_exists('mb_encoding_aliases')) { |
| 62 | function mb_encoding_aliases($encoding) |
| 63 | { |
| 64 | return p\Mbstring::mb_encoding_aliases($encoding); |
| 65 | } |
| 66 | } |
| 67 | if (!\function_exists('mb_check_encoding')) { |
| 68 | function mb_check_encoding($value = null, $encoding = null) |
| 69 | { |
| 70 | return p\Mbstring::mb_check_encoding($value, $encoding); |
| 71 | } |
| 72 | } |
| 73 | if (!\function_exists('mb_detect_encoding')) { |
| 74 | function mb_detect_encoding($string, $encodings = null, $strict = \false) |
| 75 | { |
| 76 | return p\Mbstring::mb_detect_encoding($string, $encodings, $strict); |
| 77 | } |
| 78 | } |
| 79 | if (!\function_exists('mb_detect_order')) { |
| 80 | function mb_detect_order($encoding = null) |
| 81 | { |
| 82 | return p\Mbstring::mb_detect_order($encoding); |
| 83 | } |
| 84 | } |
| 85 | if (!\function_exists('mb_parse_str')) { |
| 86 | function mb_parse_str($string, &$result = []) |
| 87 | { |
| 88 | \parse_str($string, $result); |
| 89 | return (bool) $result; |
| 90 | } |
| 91 | } |
| 92 | if (!\function_exists('mb_strlen')) { |
| 93 | function mb_strlen($string, $encoding = null) |
| 94 | { |
| 95 | return p\Mbstring::mb_strlen($string, $encoding); |
| 96 | } |
| 97 | } |
| 98 | if (!\function_exists('mb_strpos')) { |
| 99 | function mb_strpos($haystack, $needle, $offset = 0, $encoding = null) |
| 100 | { |
| 101 | return p\Mbstring::mb_strpos($haystack, $needle, $offset, $encoding); |
| 102 | } |
| 103 | } |
| 104 | if (!\function_exists('mb_strtolower')) { |
| 105 | function mb_strtolower($string, $encoding = null) |
| 106 | { |
| 107 | return p\Mbstring::mb_strtolower($string, $encoding); |
| 108 | } |
| 109 | } |
| 110 | if (!\function_exists('mb_strtoupper')) { |
| 111 | function mb_strtoupper($string, $encoding = null) |
| 112 | { |
| 113 | return p\Mbstring::mb_strtoupper($string, $encoding); |
| 114 | } |
| 115 | } |
| 116 | if (!\function_exists('mb_substitute_character')) { |
| 117 | function mb_substitute_character($substitute_character = null) |
| 118 | { |
| 119 | return p\Mbstring::mb_substitute_character($substitute_character); |
| 120 | } |
| 121 | } |
| 122 | if (!\function_exists('mb_substr')) { |
| 123 | function mb_substr($string, $start, $length = 2147483647, $encoding = null) |
| 124 | { |
| 125 | return p\Mbstring::mb_substr($string, $start, $length, $encoding); |
| 126 | } |
| 127 | } |
| 128 | if (!\function_exists('mb_stripos')) { |
| 129 | function mb_stripos($haystack, $needle, $offset = 0, $encoding = null) |
| 130 | { |
| 131 | return p\Mbstring::mb_stripos($haystack, $needle, $offset, $encoding); |
| 132 | } |
| 133 | } |
| 134 | if (!\function_exists('mb_stristr')) { |
| 135 | function mb_stristr($haystack, $needle, $before_needle = \false, $encoding = null) |
| 136 | { |
| 137 | return p\Mbstring::mb_stristr($haystack, $needle, $before_needle, $encoding); |
| 138 | } |
| 139 | } |
| 140 | if (!\function_exists('mb_strrchr')) { |
| 141 | function mb_strrchr($haystack, $needle, $before_needle = \false, $encoding = null) |
| 142 | { |
| 143 | return p\Mbstring::mb_strrchr($haystack, $needle, $before_needle, $encoding); |
| 144 | } |
| 145 | } |
| 146 | if (!\function_exists('mb_strrichr')) { |
| 147 | function mb_strrichr($haystack, $needle, $before_needle = \false, $encoding = null) |
| 148 | { |
| 149 | return p\Mbstring::mb_strrichr($haystack, $needle, $before_needle, $encoding); |
| 150 | } |
| 151 | } |
| 152 | if (!\function_exists('mb_strripos')) { |
| 153 | function mb_strripos($haystack, $needle, $offset = 0, $encoding = null) |
| 154 | { |
| 155 | return p\Mbstring::mb_strripos($haystack, $needle, $offset, $encoding); |
| 156 | } |
| 157 | } |
| 158 | if (!\function_exists('mb_strrpos')) { |
| 159 | function mb_strrpos($haystack, $needle, $offset = 0, $encoding = null) |
| 160 | { |
| 161 | return p\Mbstring::mb_strrpos($haystack, $needle, $offset, $encoding); |
| 162 | } |
| 163 | } |
| 164 | if (!\function_exists('mb_strstr')) { |
| 165 | function mb_strstr($haystack, $needle, $before_needle = \false, $encoding = null) |
| 166 | { |
| 167 | return p\Mbstring::mb_strstr($haystack, $needle, $before_needle, $encoding); |
| 168 | } |
| 169 | } |
| 170 | if (!\function_exists('mb_get_info')) { |
| 171 | function mb_get_info($type = 'all') |
| 172 | { |
| 173 | return p\Mbstring::mb_get_info($type); |
| 174 | } |
| 175 | } |
| 176 | if (!\function_exists('mb_http_output')) { |
| 177 | function mb_http_output($encoding = null) |
| 178 | { |
| 179 | return p\Mbstring::mb_http_output($encoding); |
| 180 | } |
| 181 | } |
| 182 | if (!\function_exists('mb_strwidth')) { |
| 183 | function mb_strwidth($string, $encoding = null) |
| 184 | { |
| 185 | return p\Mbstring::mb_strwidth($string, $encoding); |
| 186 | } |
| 187 | } |
| 188 | if (!\function_exists('mb_substr_count')) { |
| 189 | function mb_substr_count($haystack, $needle, $encoding = null) |
| 190 | { |
| 191 | return p\Mbstring::mb_substr_count($haystack, $needle, $encoding); |
| 192 | } |
| 193 | } |
| 194 | if (!\function_exists('mb_output_handler')) { |
| 195 | function mb_output_handler($string, $status) |
| 196 | { |
| 197 | return p\Mbstring::mb_output_handler($string, $status); |
| 198 | } |
| 199 | } |
| 200 | if (!\function_exists('mb_http_input')) { |
| 201 | function mb_http_input($type = null) |
| 202 | { |
| 203 | return p\Mbstring::mb_http_input($type); |
| 204 | } |
| 205 | } |
| 206 | if (!\function_exists('mb_convert_variables')) { |
| 207 | function mb_convert_variables($to_encoding, $from_encoding, &...$vars) |
| 208 | { |
| 209 | return p\Mbstring::mb_convert_variables($to_encoding, $from_encoding, ...$vars); |
| 210 | } |
| 211 | } |
| 212 | if (!\function_exists('mb_ord')) { |
| 213 | function mb_ord($string, $encoding = null) |
| 214 | { |
| 215 | return p\Mbstring::mb_ord($string, $encoding); |
| 216 | } |
| 217 | } |
| 218 | if (!\function_exists('mb_chr')) { |
| 219 | function mb_chr($codepoint, $encoding = null) |
| 220 | { |
| 221 | return p\Mbstring::mb_chr($codepoint, $encoding); |
| 222 | } |
| 223 | } |
| 224 | if (!\function_exists('mb_scrub')) { |
| 225 | function mb_scrub($string, $encoding = null) |
| 226 | { |
| 227 | $encoding = null === $encoding ? \mb_internal_encoding() : $encoding; |
| 228 | return \mb_convert_encoding($string, $encoding, $encoding); |
| 229 | } |
| 230 | } |
| 231 | if (!\function_exists('mb_str_split')) { |
| 232 | function mb_str_split($string, $length = 1, $encoding = null) |
| 233 | { |
| 234 | return p\Mbstring::mb_str_split($string, $length, $encoding); |
| 235 | } |
| 236 | } |
| 237 | if (!\function_exists('mb_str_pad')) { |
| 238 | function mb_str_pad(string $string, int $length, string $pad_string = ' ', int $pad_type = \STR_PAD_RIGHT, ?string $encoding = null) : string |
| 239 | { |
| 240 | return p\Mbstring::mb_str_pad($string, $length, $pad_string, $pad_type, $encoding); |
| 241 | } |
| 242 | } |
| 243 | if (\extension_loaded('mbstring')) { |
| 244 | return; |
| 245 | } |
| 246 | if (!\defined('MB_CASE_UPPER')) { |
| 247 | \define('MB_CASE_UPPER', 0); |
| 248 | } |
| 249 | if (!\defined('MB_CASE_LOWER')) { |
| 250 | \define('MB_CASE_LOWER', 1); |
| 251 | } |
| 252 | if (!\defined('MB_CASE_TITLE')) { |
| 253 | \define('MB_CASE_TITLE', 2); |
| 254 | } |
| 255 |