]> granicus.if.org Git - php/commitdiff
escape_string functions will now return empty string directly.
authorMarc Boeren <mboeren@php.net>
Wed, 30 Oct 2002 12:02:51 +0000 (12:02 +0000)
committerMarc Boeren <mboeren@php.net>
Wed, 30 Oct 2002 12:02:51 +0000 (12:02 +0000)
ext/dbx/dbx_fbsql.c
ext/dbx/dbx_mssql.c
ext/dbx/dbx_mysql.c
ext/dbx/dbx_oci8.c
ext/dbx/dbx_odbc.c
ext/dbx/dbx_pgsql.c
ext/dbx/dbx_sybasect.c

index 56c3764f0ffb15f06dd3794905b742b6c7659e1f..f12ed0870d36e1b51377f0226b12d59ba88065d2 100644 (file)
@@ -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 */
index 9ea38ca1eb592291d51e723d43327a9d103ec566..69ae42ba1967230d3211420ccfb054d06ffac77a 100644 (file)
@@ -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 */
index 3efd427038e6c60321aae8a0bded1ebc35d0ac3d..b8149eae9d2efc0d691847a6d7f6eaef283c6ec0 100644 (file)
@@ -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);
index da50844334c577f23bd6e379a04f31f340ff9c1d..bc69ee4553490f166e0a676e3dd5ba3be3a76724 100644 (file)
@@ -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 */
index 139855026bafd3ee6c908d44856e09e758829723..ef3d5752099acb57a1d7607c9a0032555d6f26a4 100644 (file)
@@ -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 */
index c8cac1908c6962c74911b19d9e9e1db8f83e546b..7642ee64881e280816a38058b368b0529b917c0a 100644 (file)
@@ -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 */
index 3cc48301650cc34b75973d5eb1c96094cbaff676..b5da1056513504f5237a932db142016b185652e9 100644 (file)
@@ -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 */