Code Duplication    Length = 16-16 lines in 2 locations

Sources/QueryString.php 2 locations

@@ 468-483 (lines=16) @@
465
 * @param array|string $var A string or array of strings to escape
466
 * @return array|string The escaped string or array of escaped strings
467
 */
468
function escapestring__recursive($var)
469
{
470
	global $smcFunc;
471
472
	if (!is_array($var))
473
		return $smcFunc['db_escape_string']($var);
474
475
	// Reindex the array with slashes.
476
	$new_var = array();
477
478
	// Add slashes to every element, even the indexes!
479
	foreach ($var as $k => $v)
480
		$new_var[$smcFunc['db_escape_string']($k)] = escapestring__recursive($v);
481
482
	return $new_var;
483
}
484
485
/**
486
 * Adds html entities to the array/variable.  Uses two underscores to guard against overloading.
@@ 545-560 (lines=16) @@
542
 * @param array|string $var The string or array of strings to unescape
543
 * @return array|string The unescaped string or array of unescaped strings
544
 */
545
function unescapestring__recursive($var)
546
{
547
	global $smcFunc;
548
549
	if (!is_array($var))
550
		return $smcFunc['db_unescape_string']($var);
551
552
	// Reindex the array without slashes, this time.
553
	$new_var = array();
554
555
	// Strip the slashes from every element.
556
	foreach ($var as $k => $v)
557
		$new_var[$smcFunc['db_unescape_string']($k)] = unescapestring__recursive($v);
558
559
	return $new_var;
560
}
561
562
/**
563
 * Remove slashes recursively.  Uses two underscores to guard against overloading.