cvs: php-src /ext/mysql php_mysql.c
| From: | Johannes Schlüter | Date: | Tue, 12 Feb 2008 20:43:29 +0000 |
| Subject: | cvs: php-src /ext/mysql php_mysql.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-48488@lists.php.net to get a copy of this message | ||
johannes Tue Feb 12 20:43:29 2008 UTC
Modified files:
/php-src/ext/mysql php_mysql.c
Log:
- Make clear what's going on and avoid overwriting parameters
http://cvs.php.net/viewvc.cgi/php-src/ext/mysql/php_mysql.c?r1=1.250&r2=1.251&diff_format=u
Index: php-src/ext/mysql/php_mysql.c
diff -u php-src/ext/mysql/php_mysql.c:1.250 php-src/ext/mysql/php_mysql.c:1.251
--- php-src/ext/mysql/php_mysql.c:1.250 Tue Feb 12 10:15:16 2008
+++ php-src/ext/mysql/php_mysql.c Tue Feb 12 20:43:28 2008
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_mysql.c,v 1.250 2008/02/12 10:15:16 felipe Exp $ */
+/* $Id: php_mysql.c,v 1.251 2008/02/12 20:43:28 johannes Exp $ */
/* TODO:
*
@@ -642,16 +642,20 @@
host_and_port = MySG(default_host);
user = MySG(default_user);
passwd = MySG(default_password);
-
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s&s&s&bl",
&host_and_port, &host_len, UG(utf8_conv),
+
+ /* mysql_pconnect does not support new_link parameter */
+ if (persistent) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s&s&s&l",
&host_and_port, &host_len, UG(utf8_conv),
+ &user, &user_len, UG(utf8_conv), &passwd, &passwd_len, UG(utf8_conv),
+ &client_flags)==FAILURE) {
+ return;
+ }
+ } else {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s&s&s&bl",
&host_and_port, &host_len, UG(utf8_conv),
&user, &user_len, UG(utf8_conv), &passwd, &passwd_len, UG(utf8_conv),
&new_link, &client_flags)==FAILURE) {
- return;
- }
-
- /* mysql_pconnect does not support new_link parameter */
- if (persistent) {
- client_flags= new_link;
+ return;
+ }
}
/* disable local infile option for open_basedir */