iliaa           Thu Dec 20 00:26:22 2007 UTC

  Modified files:              (Branch: PHP_5_3)
    /php-src/ext/mysql  php_mysql.c 
  Log:
  Fixed bug #43635 (mysql extension ingores INI settings on NULL values passed
  to mysql_connect())
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/mysql/php_mysql.c?r1=1.213.2.6.2.16.2.5&r2=1.213.2.6.2.16.2.6&diff_format=u
Index: php-src/ext/mysql/php_mysql.c
diff -u php-src/ext/mysql/php_mysql.c:1.213.2.6.2.16.2.5 
php-src/ext/mysql/php_mysql.c:1.213.2.6.2.16.2.6
--- php-src/ext/mysql/php_mysql.c:1.213.2.6.2.16.2.5    Thu Nov  8 13:29:06 2007
+++ php-src/ext/mysql/php_mysql.c       Thu Dec 20 00:26:21 2007
@@ -18,7 +18,7 @@
    +----------------------------------------------------------------------+
 */
  
-/* $Id: php_mysql.c,v 1.213.2.6.2.16.2.5 2007/11/08 13:29:06 tony2001 Exp $ */
+/* $Id: php_mysql.c,v 1.213.2.6.2.16.2.6 2007/12/20 00:26:21 iliaa Exp $ */
 
 /* TODO:
  *
@@ -643,16 +643,22 @@
                hashed_details_length = spprintf(&hashed_details, 0, 
"mysql__%s_", user);
                client_flags = CLIENT_INTERACTIVE;
        } else {
-               host_and_port = MySG(default_host);
-               user = MySG(default_user);
-               passwd = MySG(default_password);
-               
-               if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|sssll", 
&host_and_port, &host_len,
+               if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, 
"|s!s!s!ll", &host_and_port, &host_len,
                                                                        &user, 
&user_len, &passwd, &passwd_len, 
                                                                        
&new_link, &client_flags)==FAILURE) {
                        WRONG_PARAM_COUNT;
                }
 
+               if (!host_and_port) {
+                       host_and_port = MySG(default_host);
+               }
+               if (!user) {
+                       user = MySG(default_user);
+               }
+               if (!passwd) {
+                       passwd = MySG(default_password);
+               }
+
                /* mysql_pconnect does not support new_link parameter */
                if (persistent) {
                        client_flags= new_link;

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to