Code Duplication    Length = 16-16 lines in 2 locations

Sources/QueryString.php 2 locations

@@ 475-490 (lines=16) @@
472
 * @param array|string $var A string or array of strings to escape
473
 * @return array|string The escaped string or array of escaped strings
474
 */
475
function escapestring__recursive($var)
476
{
477
	global $smcFunc;
478
479
	if (!is_array($var))
480
		return $smcFunc['db_escape_string']($var);
481
482
	// Reindex the array with slashes.
483
	$new_var = array();
484
485
	// Add slashes to every element, even the indexes!
486
	foreach ($var as $k => $v)
487
		$new_var[$smcFunc['db_escape_string']($k)] = escapestring__recursive($v);
488
489
	return $new_var;
490
}
491
492
/**
493
 * Adds html entities to the array/variable.  Uses two underscores to guard against overloading.
@@ 552-567 (lines=16) @@
549
 * @param array|string $var The string or array of strings to unescape
550
 * @return array|string The unescaped string or array of unescaped strings
551
 */
552
function unescapestring__recursive($var)
553
{
554
	global $smcFunc;
555
556
	if (!is_array($var))
557
		return $smcFunc['db_unescape_string']($var);
558
559
	// Reindex the array without slashes, this time.
560
	$new_var = array();
561
562
	// Strip the slashes from every element.
563
	foreach ($var as $k => $v)
564
		$new_var[$smcFunc['db_unescape_string']($k)] = unescapestring__recursive($v);
565
566
	return $new_var;
567
}
568
569
/**
570
 * Remove slashes recursively.  Uses two underscores to guard against overloading.