cvs: php4 /ext/dbx dbx_fbsql.c dbx_mssql.c dbx_mysql.c dbx_oci8.c dbx_odbc.c dbx_pgsql.c dbx_sybasect.c
| From: | Marc Boeren | Date: | Wed, 30 Oct 2002 12:02:51 +0000 |
| Subject: | cvs: php4 /ext/dbx dbx_fbsql.c dbx_mssql.c dbx_mysql.c dbx_oci8.c dbx_odbc.c dbx_pgsql.c dbx_sybasect.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-15636@lists.php.net to get a copy of this message | ||
mboeren Wed Oct 30 07:02:51 2002 EDT
Modified files:
/php4/ext/dbx dbx_fbsql.c dbx_mssql.c dbx_mysql.c dbx_oci8.c
dbx_odbc.c dbx_pgsql.c dbx_sybasect.c
Log:
escape_string functions will now return empty string directly.
Index: php4/ext/dbx/dbx_fbsql.c
diff -u php4/ext/dbx/dbx_fbsql.c:1.7 php4/ext/dbx/dbx_fbsql.c:1.8
--- php4/ext/dbx/dbx_fbsql.c:1.7 Tue Oct 29 09:08:39 2002
+++ php4/ext/dbx/dbx_fbsql.c Wed Oct 30 07:02:49 2002
@@ -21,7 +21,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: dbx_fbsql.c,v 1.7 2002/10/29 14:08:39 mboeren Exp $ */
+/* $Id: dbx_fbsql.c,v 1.8 2002/10/30 12:02:49 mboeren Exp $ */
#include "dbx.h"
#include "dbx_fbsql.h"
@@ -259,6 +259,10 @@
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: php4/ext/dbx/dbx_mssql.c
diff -u php4/ext/dbx/dbx_mssql.c:1.10 php4/ext/dbx/dbx_mssql.c:1.11
--- php4/ext/dbx/dbx_mssql.c:1.10 Tue Oct 29 09:08:39 2002
+++ php4/ext/dbx/dbx_mssql.c Wed Oct 30 07:02:49 2002
@@ -20,7 +20,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: dbx_mssql.c,v 1.10 2002/10/29 14:08:39 mboeren Exp $ */
+/* $Id: dbx_mssql.c,v 1.11 2002/10/30 12:02:49 mboeren Exp $ */
#include "dbx.h"
#include "dbx_mssql.h"
@@ -258,6 +258,10 @@
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: php4/ext/dbx/dbx_mysql.c
diff -u php4/ext/dbx/dbx_mysql.c:1.15 php4/ext/dbx/dbx_mysql.c:1.16
--- php4/ext/dbx/dbx_mysql.c:1.15 Tue Oct 29 09:08:39 2002
+++ php4/ext/dbx/dbx_mysql.c Wed Oct 30 07:02:50 2002
@@ -20,7 +20,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: dbx_mysql.c,v 1.15 2002/10/29 14:08:39 mboeren Exp $ */
+/* $Id: dbx_mysql.c,v 1.16 2002/10/30 12:02:50 mboeren Exp $ */
#include "dbx.h"
#include "dbx_mysql.h"
@@ -266,6 +266,10 @@
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: php4/ext/dbx/dbx_oci8.c
diff -u php4/ext/dbx/dbx_oci8.c:1.10 php4/ext/dbx/dbx_oci8.c:1.11
--- php4/ext/dbx/dbx_oci8.c:1.10 Tue Oct 29 09:08:39 2002
+++ php4/ext/dbx/dbx_oci8.c Wed Oct 30 07:02:50 2002
@@ -20,7 +20,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: dbx_oci8.c,v 1.10 2002/10/29 14:08:39 mboeren Exp $ */
+/* $Id: dbx_oci8.c,v 1.11 2002/10/30 12:02:50 mboeren Exp $ */
#include "dbx.h"
#include "dbx_oci8.h"
@@ -276,6 +276,10 @@
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: php4/ext/dbx/dbx_odbc.c
diff -u php4/ext/dbx/dbx_odbc.c:1.17 php4/ext/dbx/dbx_odbc.c:1.18
--- php4/ext/dbx/dbx_odbc.c:1.17 Tue Oct 29 09:08:39 2002
+++ php4/ext/dbx/dbx_odbc.c Wed Oct 30 07:02:50 2002
@@ -20,7 +20,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: dbx_odbc.c,v 1.17 2002/10/29 14:08:39 mboeren Exp $ */
+/* $Id: dbx_odbc.c,v 1.18 2002/10/30 12:02:50 mboeren Exp $ */
#include "dbx.h"
#include "dbx_odbc.h"
@@ -281,6 +281,10 @@
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: php4/ext/dbx/dbx_pgsql.c
diff -u php4/ext/dbx/dbx_pgsql.c:1.18 php4/ext/dbx/dbx_pgsql.c:1.19
--- php4/ext/dbx/dbx_pgsql.c:1.18 Tue Oct 29 09:08:40 2002
+++ php4/ext/dbx/dbx_pgsql.c Wed Oct 30 07:02:50 2002
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: dbx_pgsql.c,v 1.18 2002/10/29 14:08:40 mboeren Exp $ */
+/* $Id: dbx_pgsql.c,v 1.19 2002/10/30 12:02:50 mboeren Exp $ */
#include "dbx.h"
#include "php_dbx.h"
@@ -285,6 +285,10 @@
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: php4/ext/dbx/dbx_sybasect.c
diff -u php4/ext/dbx/dbx_sybasect.c:1.4 php4/ext/dbx/dbx_sybasect.c:1.5
--- php4/ext/dbx/dbx_sybasect.c:1.4 Tue Oct 29 09:08:40 2002
+++ php4/ext/dbx/dbx_sybasect.c Wed Oct 30 07:02:51 2002
@@ -20,7 +20,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: dbx_sybasect.c,v 1.4 2002/10/29 14:08:40 mboeren Exp $ */
+/* $Id: dbx_sybasect.c,v 1.5 2002/10/30 12:02:51 mboeren Exp $ */
#include "dbx.h"
#include "dbx_sybasect.h"
@@ -283,6 +283,10 @@
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 */