Code Duplication    Length = 15-15 lines in 2 locations

Sources/Subs-Db-postgresql.php 1 location

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

Sources/Subs-Db-mysql.php 1 location

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