| @@ 179-188 (lines=10) @@ | ||
| 176 | $ent_arr = preg_split('~(&#' . (empty($modSettings['disableEntityCheck']) ? '\d{1,7}' : '021') . ';|"|&|<|>| |.)~' . ($utf8 ? 'u' : '') . '', $ent_check($string), -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY); |
|
| 177 | return $length === null ? implode('', array_slice($ent_arr, $start)) : implode('', array_slice($ent_arr, $start, $length)); |
|
| 178 | }, |
|
| 179 | 'strtolower' => $utf8 ? function ($string) use ($sourcedir) |
|
| 180 | { |
|
| 181 | if (!function_exists('mb_strtolower')) |
|
| 182 | { |
|
| 183 | require_once($sourcedir . '/Subs-Charset.php'); |
|
| 184 | return utf8_strtolower($string); |
|
| 185 | } |
|
| 186 | ||
| 187 | return mb_strtolower($string, 'UTF-8'); |
|
| 188 | } : 'strtolower', |
|
| 189 | 'strtoupper' => $utf8 ? function ($string) |
|
| 190 | { |
|
| 191 | global $sourcedir; |
|
| @@ 1362-1368 (lines=7) @@ | ||
| 1359 | ||
| 1360 | // We need this to properly hash the password for Admin |
|
| 1361 | $smcFunc['strtolower'] = $db_character_set != 'utf8' && $txt['lang_character_set'] != 'UTF-8' ? 'strtolower' : |
|
| 1362 | function($string){ |
|
| 1363 | global $sourcedir; |
|
| 1364 | if (function_exists('mb_strtolower')) |
|
| 1365 | return mb_strtolower($string, 'UTF-8'); |
|
| 1366 | require_once($sourcedir . '/Subs-Charset.php'); |
|
| 1367 | return utf8_strtolower($string); |
|
| 1368 | }; |
|
| 1369 | ||
| 1370 | if (!isset($_POST['username'])) |
|
| 1371 | $_POST['username'] = ''; |
|
| @@ 1627-1633 (lines=7) @@ | ||
| 1624 | ||
| 1625 | // This function is needed to do the updateStats('subject') call. |
|
| 1626 | $smcFunc['strtolower'] = $db_character_set != 'utf8' && $txt['lang_character_set'] != 'UTF-8' ? 'strtolower' : |
|
| 1627 | function($string){ |
|
| 1628 | global $sourcedir; |
|
| 1629 | if (function_exists('mb_strtolower')) |
|
| 1630 | return mb_strtolower($string, 'UTF-8'); |
|
| 1631 | require_once($sourcedir . '/Subs-Charset.php'); |
|
| 1632 | return utf8_strtolower($string); |
|
| 1633 | }; |
|
| 1634 | ||
| 1635 | $request = $smcFunc['db_query']('', ' |
|
| 1636 | SELECT id_msg |
|