Code Duplication    Length = 7-10 lines in 3 locations

Sources/Load.php 1 location

@@ 175-184 (lines=10) @@
172
			$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);
173
			return $length === null ? implode('', array_slice($ent_arr, $start)) : implode('', array_slice($ent_arr, $start, $length));
174
		},
175
		'strtolower' => $utf8 ? function ($string) use ($sourcedir)
176
		{
177
			if (!function_exists('mb_strtolower'))
178
			{
179
				require_once($sourcedir . '/Subs-Charset.php');
180
				return utf8_strtolower($string);
181
			}
182
183
			return mb_strtolower($string, 'UTF-8');
184
		} : 'strtolower',
185
		'strtoupper' => $utf8 ? function ($string)
186
		{
187
			global $sourcedir;

other/install.php 2 locations

@@ 1337-1343 (lines=7) @@
1334
1335
	// We need this to properly hash the password for Admin
1336
	$smcFunc['strtolower'] = $db_character_set != 'utf8' && $txt['lang_character_set'] != 'UTF-8' ? 'strtolower' :
1337
		function($string){
1338
			global $sourcedir;
1339
			if (function_exists('mb_strtolower'))
1340
				return mb_strtolower($string, 'UTF-8');
1341
			require_once($sourcedir . '/Subs-Charset.php');
1342
			return utf8_strtolower($string);
1343
		};
1344
1345
	if (!isset($_POST['username']))
1346
		$_POST['username'] = '';
@@ 1602-1608 (lines=7) @@
1599
1600
	// This function is needed to do the updateStats('subject') call.
1601
	$smcFunc['strtolower'] = $db_character_set != 'utf8' && $txt['lang_character_set'] != 'UTF-8' ? 'strtolower' :
1602
		function($string){
1603
			global $sourcedir;
1604
			if (function_exists('mb_strtolower'))
1605
				return mb_strtolower($string, 'UTF-8');
1606
			require_once($sourcedir . '/Subs-Charset.php');
1607
			return utf8_strtolower($string);
1608
		};
1609
1610
	$request = $smcFunc['db_query']('', '
1611
		SELECT id_msg