Code Duplication    Length = 7-10 lines in 3 locations

Sources/Load.php 1 location

@@ 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;

other/install.php 2 locations

@@ 1623-1629 (lines=7) @@
1620
1621
	// This function is needed to do the updateStats('subject') call.
1622
	$smcFunc['strtolower'] = $db_character_set != 'utf8' && $txt['lang_character_set'] != 'UTF-8' ? 'strtolower' :
1623
		function($string){
1624
			global $sourcedir;
1625
			if (function_exists('mb_strtolower'))
1626
				return mb_strtolower($string, 'UTF-8');
1627
			require_once($sourcedir . '/Subs-Charset.php');
1628
			return utf8_strtolower($string);
1629
		};
1630
1631
	$request = $smcFunc['db_query']('', '
1632
		SELECT id_msg
@@ 1368-1374 (lines=7) @@
1365
	require_once($sourcedir . '/Subs.php');
1366
1367
	// We need this to properly hash the password for Admin
1368
	$smcFunc['strtolower'] = $db_character_set != 'utf8' && $txt['lang_character_set'] != 'UTF-8' ? 'strtolower' : function($string) {
1369
			global $sourcedir;
1370
			if (function_exists('mb_strtolower'))
1371
				return mb_strtolower($string, 'UTF-8');
1372
			require_once($sourcedir . '/Subs-Charset.php');
1373
			return utf8_strtolower($string);
1374
		};
1375
1376
	if (!isset($_POST['username']))
1377
		$_POST['username'] = '';