Sources/Subs-Db-postgresql.php 1 location
|
@@ 909-923 (lines=15) @@
|
| 906 |
|
* @param bool $translate_human_wildcards If true, turns human readable wildcards into SQL wildcards. |
| 907 |
|
* @return string The escaped string |
| 908 |
|
*/ |
| 909 |
|
function smf_db_escape_wildcard_string($string, $translate_human_wildcards = false) |
| 910 |
|
{ |
| 911 |
|
$replacements = array( |
| 912 |
|
'%' => '\%', |
| 913 |
|
'_' => '\_', |
| 914 |
|
'\\' => '\\\\', |
| 915 |
|
); |
| 916 |
|
|
| 917 |
|
if ($translate_human_wildcards) |
| 918 |
|
$replacements += array( |
| 919 |
|
'*' => '%', |
| 920 |
|
); |
| 921 |
|
|
| 922 |
|
return strtr($string, $replacements); |
| 923 |
|
} |
| 924 |
|
|
| 925 |
|
?> |
Sources/Subs-Db-mysql.php 1 location
|
@@ 892-906 (lines=15) @@
|
| 889 |
|
* @param bool $translate_human_wildcards If true, turns human readable wildcards into SQL wildcards. |
| 890 |
|
* @return string The escaped string |
| 891 |
|
*/ |
| 892 |
|
function smf_db_escape_wildcard_string($string, $translate_human_wildcards = false) |
| 893 |
|
{ |
| 894 |
|
$replacements = array( |
| 895 |
|
'%' => '\%', |
| 896 |
|
'_' => '\_', |
| 897 |
|
'\\' => '\\\\', |
| 898 |
|
); |
| 899 |
|
|
| 900 |
|
if ($translate_human_wildcards) |
| 901 |
|
$replacements += array( |
| 902 |
|
'*' => '%', |
| 903 |
|
); |
| 904 |
|
|
| 905 |
|
return strtr($string, $replacements); |
| 906 |
|
} |
| 907 |
|
|
| 908 |
|
/** |
| 909 |
|
* Validates whether the resource is a valid mysqli instance. |