diff options
| author | Marc Boeren <mboeren@php.net> | 2002-10-30 12:02:51 +0000 |
|---|---|---|
| committer | Marc Boeren <mboeren@php.net> | 2002-10-30 12:02:51 +0000 |
| commit | 7b9eae0e6eb2f180d8c727493d4730a7951af891 (patch) | |
| tree | b597873f2a3077bd78df2099aff9a6b93e3a4386 | |
| parent | 939a5870cff702d00ab06ecd1448d46aca0ea58a (diff) | |
| download | php-git-7b9eae0e6eb2f180d8c727493d4730a7951af891.tar.gz | |
escape_string functions will now return empty string directly.
| -rw-r--r-- | ext/dbx/dbx_fbsql.c | 4 | ||||
| -rw-r--r-- | ext/dbx/dbx_mssql.c | 4 | ||||
| -rw-r--r-- | ext/dbx/dbx_mysql.c | 4 | ||||
| -rw-r--r-- | ext/dbx/dbx_oci8.c | 4 | ||||
| -rw-r--r-- | ext/dbx/dbx_odbc.c | 4 | ||||
| -rw-r--r-- | ext/dbx/dbx_pgsql.c | 4 | ||||
| -rw-r--r-- | ext/dbx/dbx_sybasect.c | 4 |
7 files changed, 28 insertions, 0 deletions
diff --git a/ext/dbx/dbx_fbsql.c b/ext/dbx/dbx_fbsql.c index 56c3764f0f..f12ed0870d 100644 --- a/ext/dbx/dbx_fbsql.c +++ b/ext/dbx/dbx_fbsql.c @@ -259,6 +259,10 @@ int dbx_fbsql_esc(zval **rv, zval **dbx_handle, zval **string, INTERNAL_FUNCTION char * tmpstr; int tmplen; + if (Z_STRLEN_PP(string) == 0) { + ZVAL_EMPTY_STRING(*rv); + return 1; + } tmpstr = estrdup(Z_STRVAL_PP(string)); tmplen = Z_STRLEN_PP(string); /* php_str_to_str uses a smart_str that allocates memory */ diff --git a/ext/dbx/dbx_mssql.c b/ext/dbx/dbx_mssql.c index 9ea38ca1eb..69ae42ba19 100644 --- a/ext/dbx/dbx_mssql.c +++ b/ext/dbx/dbx_mssql.c @@ -258,6 +258,10 @@ int dbx_mssql_esc(zval **rv, zval **dbx_handle, zval **string, INTERNAL_FUNCTION char * tmpstr; int tmplen; + if (Z_STRLEN_PP(string) == 0) { + ZVAL_EMPTY_STRING(*rv); + return 1; + } tmpstr = estrdup(Z_STRVAL_PP(string)); tmplen = Z_STRLEN_PP(string); /* php_str_to_str uses a smart_str that allocates memory */ diff --git a/ext/dbx/dbx_mysql.c b/ext/dbx/dbx_mysql.c index 3efd427038..b8149eae9d 100644 --- a/ext/dbx/dbx_mysql.c +++ b/ext/dbx/dbx_mysql.c @@ -266,6 +266,10 @@ int dbx_mysql_esc(zval **rv, zval **dbx_handle, zval **string, INTERNAL_FUNCTION char * tmpstr; int tmplen; + if (Z_STRLEN_PP(string) == 0) { + ZVAL_EMPTY_STRING(*rv); + return 1; + } arguments[0]=string; arguments[1]=dbx_handle; dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "mysql_real_escape_string", &returned_zval, number_of_arguments, arguments); diff --git a/ext/dbx/dbx_oci8.c b/ext/dbx/dbx_oci8.c index da50844334..bc69ee4553 100644 --- a/ext/dbx/dbx_oci8.c +++ b/ext/dbx/dbx_oci8.c @@ -276,6 +276,10 @@ int dbx_oci8_esc(zval **rv, zval **dbx_handle, zval **string, INTERNAL_FUNCTION_ char * tmpstr; int tmplen; + if (Z_STRLEN_PP(string) == 0) { + ZVAL_EMPTY_STRING(*rv); + return 1; + } tmpstr = estrdup(Z_STRVAL_PP(string)); tmplen = Z_STRLEN_PP(string); /* php_str_to_str uses a smart_str that allocates memory */ diff --git a/ext/dbx/dbx_odbc.c b/ext/dbx/dbx_odbc.c index 139855026b..ef3d575209 100644 --- a/ext/dbx/dbx_odbc.c +++ b/ext/dbx/dbx_odbc.c @@ -281,6 +281,10 @@ int dbx_odbc_esc(zval **rv, zval **dbx_handle, zval **string, INTERNAL_FUNCTION_ char * tmpstr; int tmplen; + if (Z_STRLEN_PP(string) == 0) { + ZVAL_EMPTY_STRING(*rv); + return 1; + } tmpstr = estrdup(Z_STRVAL_PP(string)); tmplen = Z_STRLEN_PP(string); /* php_str_to_str uses a smart_str that allocates memory */ diff --git a/ext/dbx/dbx_pgsql.c b/ext/dbx/dbx_pgsql.c index c8cac1908c..7642ee6488 100644 --- a/ext/dbx/dbx_pgsql.c +++ b/ext/dbx/dbx_pgsql.c @@ -285,6 +285,10 @@ int dbx_pgsql_esc(zval **rv, zval **dbx_handle, zval **string, INTERNAL_FUNCTION char * tmpstr; int tmplen; + if (Z_STRLEN_PP(string) == 0) { + ZVAL_EMPTY_STRING(*rv); + return 1; + } tmpstr = estrdup(Z_STRVAL_PP(string)); tmplen = Z_STRLEN_PP(string); /* php_str_to_str uses a smart_str that allocates memory */ diff --git a/ext/dbx/dbx_sybasect.c b/ext/dbx/dbx_sybasect.c index 3cc4830165..b5da105651 100644 --- a/ext/dbx/dbx_sybasect.c +++ b/ext/dbx/dbx_sybasect.c @@ -283,6 +283,10 @@ int dbx_sybasect_esc(zval **rv, zval **dbx_handle, zval **string, INTERNAL_FUNCT char * tmpstr; int tmplen; + if (Z_STRLEN_PP(string) == 0) { + ZVAL_EMPTY_STRING(*rv); + return 1; + } tmpstr = estrdup(Z_STRVAL_PP(string)); tmplen = Z_STRLEN_PP(string); /* php_str_to_str uses a smart_str that allocates memory */ |
