Code Duplication    Length = 17-17 lines in 2 locations

Sources/Subs.php 2 locations

@@ 5216-5232 (lines=17) @@
5213
 * @param mixed $value
5214
 * @return string
5215
 */
5216
function safe_serialize($value)
5217
{
5218
	// Make sure we use the byte count for strings even when strlen() is overloaded by mb_strlen()
5219
	if (function_exists('mb_internal_encoding') &&
5220
		(((int) ini_get('mbstring.func_overload')) & 2))
5221
	{
5222
		$mbIntEnc = mb_internal_encoding();
5223
		mb_internal_encoding('ASCII');
5224
	}
5225
5226
	$out = _safe_serialize($value);
5227
5228
	if (isset($mbIntEnc))
5229
		mb_internal_encoding($mbIntEnc);
5230
5231
	return $out;
5232
}
5233
5234
/**
5235
 * Safe unserialize() replacement
@@ 5393-5409 (lines=17) @@
5390
 * @param string $str
5391
 * @return mixed
5392
 */
5393
function safe_unserialize($str)
5394
{
5395
	// Make sure we use the byte count for strings even when strlen() is overloaded by mb_strlen()
5396
	if (function_exists('mb_internal_encoding') &&
5397
		(((int) ini_get('mbstring.func_overload')) & 0x02))
5398
	{
5399
		$mbIntEnc = mb_internal_encoding();
5400
		mb_internal_encoding('ASCII');
5401
	}
5402
5403
	$out = _safe_unserialize($str);
5404
5405
	if (isset($mbIntEnc))
5406
		mb_internal_encoding($mbIntEnc);
5407
5408
	return $out;
5409
}
5410
5411
/**
5412
 * Tries different modes to make file/dirs writable. Wrapper function for chmod()