Code Duplication    Length = 15-15 lines in 2 locations

Sources/Subs-Db-postgresql.php 1 location

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

Sources/Subs-Db-mysql.php 1 location

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