Code Duplication    Length = 15-15 lines in 2 locations

Sources/Subs-Db-postgresql.php 1 location

@@ 944-958 (lines=15) @@
941
 * @param bool $translate_human_wildcards If true, turns human readable wildcards into SQL wildcards.
942
 * @return string The escaped string
943
 */
944
function smf_db_escape_wildcard_string($string, $translate_human_wildcards = false)
945
{
946
	$replacements = array(
947
		'%' => '\%',
948
		'_' => '\_',
949
		'\\' => '\\\\',
950
	);
951
952
	if ($translate_human_wildcards)
953
		$replacements += array(
954
			'*' => '%',
955
		);
956
957
	return strtr($string, $replacements);
958
}
959
960
?>

Sources/Subs-Db-mysql.php 1 location

@@ 967-981 (lines=15) @@
964
 * @param bool $translate_human_wildcards If true, turns human readable wildcards into SQL wildcards.
965
 * @return string The escaped string
966
 */
967
function smf_db_escape_wildcard_string($string, $translate_human_wildcards = false)
968
{
969
	$replacements = array(
970
		'%' => '\%',
971
		'_' => '\_',
972
		'\\' => '\\\\',
973
	);
974
975
	if ($translate_human_wildcards)
976
		$replacements += array(
977
			'*' => '%',
978
		);
979
980
	return strtr($string, $replacements);
981
}
982
983
/**
984
 * Validates whether the resource is a valid mysqli instance.