Code Duplication    Length = 15-15 lines in 2 locations

Sources/Subs-Db-postgresql.php 1 location

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

Sources/Subs-Db-mysql.php 1 location

@@ 915-929 (lines=15) @@
912
 * @param bool $translate_human_wildcards If true, turns human readable wildcards into SQL wildcards.
913
 * @return string The escaped string
914
 */
915
function smf_db_escape_wildcard_string($string, $translate_human_wildcards = false)
916
{
917
	$replacements = array(
918
		'%' => '\%',
919
		'_' => '\_',
920
		'\\' => '\\\\',
921
	);
922
923
	if ($translate_human_wildcards)
924
		$replacements += array(
925
			'*' => '%',
926
		);
927
928
	return strtr($string, $replacements);
929
}
930
931
/**
932
 * Validates whether the resource is a valid mysqli instance.