iliaa           Mon May 28 23:43:25 2007 UTC

  Modified files:              
    /php-src/ext/xmlrpc/libxmlrpc       xml_to_xmlrpc.c xml_to_soap.c 
                                        xml_to_dandarpc.c 
    /php-src/ext/soap   php_http.c 
    /php-src/ext/pdo_mysql      mysql_statement.c 
    /php-src/ext/pdo    pdo_sql_parser.re pdo_sql_parser.c pdo_dbh.c 
    /php-src/ext/mysql  php_mysql.c 
  Log:
  
  MFB
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/xmlrpc/libxmlrpc/xml_to_xmlrpc.c?r1=1.7&r2=1.8&diff_format=u
Index: php-src/ext/xmlrpc/libxmlrpc/xml_to_xmlrpc.c
diff -u php-src/ext/xmlrpc/libxmlrpc/xml_to_xmlrpc.c:1.7 
php-src/ext/xmlrpc/libxmlrpc/xml_to_xmlrpc.c:1.8
--- php-src/ext/xmlrpc/libxmlrpc/xml_to_xmlrpc.c:1.7    Thu May  3 04:17:18 2007
+++ php-src/ext/xmlrpc/libxmlrpc/xml_to_xmlrpc.c        Mon May 28 23:43:24 2007
@@ -31,7 +31,7 @@
 */
 
 
-static const char rcsid[] = "#(@) $Id: xml_to_xmlrpc.c,v 1.7 2007/05/03 
04:17:18 edink Exp $";
+static const char rcsid[] = "#(@) $Id: xml_to_xmlrpc.c,v 1.8 2007/05/28 
23:43:24 iliaa Exp $";
 
 #include "php.h"
 #include "main/snprintf.h"
@@ -139,7 +139,7 @@
                }
                else if (!strcmp(el->name, ELEM_BASE64)) {
          struct buffer_st buf;
-         base64_decode(&buf, el->text.str, el->text.len);
+         base64_decode_xmlrpc(&buf, el->text.str, el->text.len);
          XMLRPC_SetValueBase64(current_val, buf.data, buf.offset);
          buffer_delete(&buf);
                }
@@ -242,7 +242,7 @@
             {
                struct buffer_st buf;
                elem_val->name = strdup(ELEM_BASE64);
-               base64_encode(&buf, XMLRPC_GetValueBase64(node), 
XMLRPC_GetValueStringLen(node));
+               base64_encode_xmlrpc(&buf, XMLRPC_GetValueBase64(node), 
XMLRPC_GetValueStringLen(node));
                simplestring_addn(&elem_val->text, buf.data, buf.offset );
                buffer_delete(&buf);
             }
http://cvs.php.net/viewvc.cgi/php-src/ext/xmlrpc/libxmlrpc/xml_to_soap.c?r1=1.5&r2=1.6&diff_format=u
Index: php-src/ext/xmlrpc/libxmlrpc/xml_to_soap.c
diff -u php-src/ext/xmlrpc/libxmlrpc/xml_to_soap.c:1.5 
php-src/ext/xmlrpc/libxmlrpc/xml_to_soap.c:1.6
--- php-src/ext/xmlrpc/libxmlrpc/xml_to_soap.c:1.5      Sun Dec 18 21:17:42 2005
+++ php-src/ext/xmlrpc/libxmlrpc/xml_to_soap.c  Mon May 28 23:43:24 2007
@@ -363,7 +363,7 @@
                        }
                        else if (!strcmp(type, TOKEN_BASE64)) {
                                struct buffer_st buf;
-                               base64_decode(&buf, el->text.str, el->text.len);
+                               base64_decode_xmlrpc(&buf, el->text.str, 
el->text.len);
                                XMLRPC_SetValueBase64(xCurrent, buf.data, 
buf.offset);
                                buffer_delete(&buf);
                        }
@@ -529,7 +529,7 @@
                        {
                                struct buffer_st buf;
                                pAttrType = TOKEN_BASE64;
-                               base64_encode(&buf, 
XMLRPC_GetValueBase64(node), XMLRPC_GetValueStringLen(node));
+                               base64_encode_xmlrpc(&buf, 
XMLRPC_GetValueBase64(node), XMLRPC_GetValueStringLen(node));
                                simplestring_addn(&elem_val->text, buf.data, 
buf.offset );
                                buffer_delete(&buf);
                        }
http://cvs.php.net/viewvc.cgi/php-src/ext/xmlrpc/libxmlrpc/xml_to_dandarpc.c?r1=1.3&r2=1.4&diff_format=u
Index: php-src/ext/xmlrpc/libxmlrpc/xml_to_dandarpc.c
diff -u php-src/ext/xmlrpc/libxmlrpc/xml_to_dandarpc.c:1.3 
php-src/ext/xmlrpc/libxmlrpc/xml_to_dandarpc.c:1.4
--- php-src/ext/xmlrpc/libxmlrpc/xml_to_dandarpc.c:1.3  Mon Dec  3 22:33:31 2001
+++ php-src/ext/xmlrpc/libxmlrpc/xml_to_dandarpc.c      Mon May 28 23:43:24 2007
@@ -104,7 +104,7 @@
          }
          else if(!strcmp(type, ATTR_BASE64)) {
             struct buffer_st buf;
-            base64_decode(&buf, el->text.str, el->text.len);
+            base64_decode_xmlrpc(&buf, el->text.str, el->text.len);
             XMLRPC_SetValueBase64(xCurrent, buf.data, buf.offset);
             buffer_delete(&buf);
          }
@@ -227,7 +227,7 @@
             {
                struct buffer_st buf;
                pAttrType = ATTR_BASE64;
-               base64_encode(&buf, XMLRPC_GetValueBase64(node), 
XMLRPC_GetValueStringLen(node));
+               base64_encode_xmlrpc(&buf, XMLRPC_GetValueBase64(node), 
XMLRPC_GetValueStringLen(node));
                simplestring_addn(&elem_val->text, buf.data, buf.offset );
                buffer_delete(&buf);
             }
http://cvs.php.net/viewvc.cgi/php-src/ext/soap/php_http.c?r1=1.106&r2=1.107&diff_format=u
Index: php-src/ext/soap/php_http.c
diff -u php-src/ext/soap/php_http.c:1.106 php-src/ext/soap/php_http.c:1.107
--- php-src/ext/soap/php_http.c:1.106   Fri May 11 07:19:57 2007
+++ php-src/ext/soap/php_http.c Mon May 28 23:43:24 2007
@@ -17,7 +17,7 @@
   |          Dmitry Stogov <[EMAIL PROTECTED]>                             |
   +----------------------------------------------------------------------+
 */
-/* $Id: php_http.c,v 1.106 2007/05/11 07:19:57 dmitry Exp $ */
+/* $Id: php_http.c,v 1.107 2007/05/28 23:43:24 iliaa Exp $ */
 
 #include "php_soap.h"
 #include "ext/standard/base64.h"
@@ -916,19 +916,20 @@
                                efree(http_body);
                                efree(loc);
                                if (new_url->scheme == NULL && new_url->path != 
NULL) {
-                                       new_url->scheme = 
estrdup(phpurl->scheme);
-                                       new_url->host = estrdup(phpurl->host);
+                                       new_url->scheme = NULL;
+                                       new_url->host = phpurl->host ? 
estrdup(phpurl->host) : NULL;
                                        new_url->port = phpurl->port;
                                        if (new_url->path && new_url->path[0] 
!= '/') {
-                                               char *t = 
phpurl->path?phpurl->path:"/";
+                                               char *t = phpurl->path;
                                                char *p = strrchr(t, '/');
-                                               char *s = emalloc((p - t) + 
strlen(new_url->path) + 2);
-
-                                               strncpy(s, t, (p - t) + 1);
-                                               s[(p - t) + 1] = 0;
-                                               strcat(s, new_url->path);
-                                               efree(new_url->path);
-                                               new_url->path = s;
+                                               if (p) {
+                                                       char *s = emalloc((p - 
t) + strlen(new_url->path) + 2);
+                                                       strncpy(s, t, (p - t) + 
1);
+                                                       s[(p - t) + 1] = 0;
+                                                       strcat(s, 
new_url->path);
+                                                       efree(new_url->path);
+                                                       new_url->path = s;
+                                               }
                                        }
                                }
                                phpurl = new_url;
http://cvs.php.net/viewvc.cgi/php-src/ext/pdo_mysql/mysql_statement.c?r1=1.60&r2=1.61&diff_format=u
Index: php-src/ext/pdo_mysql/mysql_statement.c
diff -u php-src/ext/pdo_mysql/mysql_statement.c:1.60 
php-src/ext/pdo_mysql/mysql_statement.c:1.61
--- php-src/ext/pdo_mysql/mysql_statement.c:1.60        Tue Apr 10 07:08:51 2007
+++ php-src/ext/pdo_mysql/mysql_statement.c     Mon May 28 23:43:24 2007
@@ -17,7 +17,7 @@
   +----------------------------------------------------------------------+
 */
 
-/* $Id: mysql_statement.c,v 1.60 2007/04/10 07:08:51 tony2001 Exp $ */
+/* $Id: mysql_statement.c,v 1.61 2007/05/28 23:43:24 iliaa Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -363,6 +363,7 @@
 #endif
 
        if (!S->result) {
+               strcpy(stmt->error_code, "HY000");
                return 0;       
        }
        if ((S->current_data = mysql_fetch_row(S->result)) == NULL) {
http://cvs.php.net/viewvc.cgi/php-src/ext/pdo/pdo_sql_parser.re?r1=1.38&r2=1.39&diff_format=u
Index: php-src/ext/pdo/pdo_sql_parser.re
diff -u php-src/ext/pdo/pdo_sql_parser.re:1.38 
php-src/ext/pdo/pdo_sql_parser.re:1.39
--- php-src/ext/pdo/pdo_sql_parser.re:1.38      Wed Jan  3 22:02:43 2007
+++ php-src/ext/pdo/pdo_sql_parser.re   Mon May 28 23:43:24 2007
@@ -16,7 +16,7 @@
   +----------------------------------------------------------------------+
 */
 
-/* $Id: pdo_sql_parser.re,v 1.38 2007/01/03 22:02:43 nlopess Exp $ */
+/* $Id: pdo_sql_parser.re,v 1.39 2007/05/28 23:43:24 iliaa Exp $ */
 
 #include "php.h"
 #include "php_pdo_driver.h"
@@ -154,13 +154,25 @@
        }
 
        if (params && bindno != zend_hash_num_elements(params) && 
stmt->supports_placeholders == PDO_PLACEHOLDER_NONE) {
+               /* extra bit of validation for instances when same params are 
bound more then once */
+               if (query_type != PDO_PLACEHOLDER_POSITIONAL && bindno > 
zend_hash_num_elements(params)) {
+                       int ok = 1;
+                       for (plc = placeholders; plc; plc = plc->next) {
+                               if (zend_hash_find(params, plc->pos, plc->len, 
(void**) &param) == FAILURE) {
+                                       ok = 0;
+                                       break;
+                               }
+                       }
+                       if (ok) {
+                               goto safe;
+                       }
+               }
                pdo_raise_impl_error(stmt->dbh, stmt, "HY093", "number of bound 
variables does not match number of tokens" TSRMLS_CC);
                ret = -1;
                goto clean_up;
        }
-
+safe:
        /* what are we going to do ? */
-       
        if (stmt->supports_placeholders == PDO_PLACEHOLDER_NONE) {
                /* query generation */
 
http://cvs.php.net/viewvc.cgi/php-src/ext/pdo/pdo_sql_parser.c?r1=1.52&r2=1.53&diff_format=u
Index: php-src/ext/pdo/pdo_sql_parser.c
diff -u php-src/ext/pdo/pdo_sql_parser.c:1.52 
php-src/ext/pdo/pdo_sql_parser.c:1.53
--- php-src/ext/pdo/pdo_sql_parser.c:1.52       Wed Jan  3 22:02:43 2007
+++ php-src/ext/pdo/pdo_sql_parser.c    Mon May 28 23:43:24 2007
@@ -18,7 +18,7 @@
   +----------------------------------------------------------------------+
 */
 
-/* $Id: pdo_sql_parser.c,v 1.52 2007/01/03 22:02:43 nlopess Exp $ */
+/* $Id: pdo_sql_parser.c,v 1.53 2007/05/28 23:43:24 iliaa Exp $ */
 
 #include "php.h"
 #include "php_pdo_driver.h"
@@ -327,13 +327,25 @@
        }
 
        if (params && bindno != zend_hash_num_elements(params) && 
stmt->supports_placeholders == PDO_PLACEHOLDER_NONE) {
+               /* extra bit of validation for instances when same params are 
bound more then once */
+               if (query_type != PDO_PLACEHOLDER_POSITIONAL && bindno > 
zend_hash_num_elements(params)) {
+                       int ok = 1;
+                       for (plc = placeholders; plc; plc = plc->next) {
+                               if (zend_hash_find(params, plc->pos, plc->len, 
(void**) &param) == FAILURE) {
+                                       ok = 0;
+                                       break;
+                               }
+                       }
+                       if (ok) {
+                               goto safe;
+                       }
+               }
                pdo_raise_impl_error(stmt->dbh, stmt, "HY093", "number of bound 
variables does not match number of tokens" TSRMLS_CC);
                ret = -1;
                goto clean_up;
        }
-
+safe:
        /* what are we going to do ? */
-       
        if (stmt->supports_placeholders == PDO_PLACEHOLDER_NONE) {
                /* query generation */
 
http://cvs.php.net/viewvc.cgi/php-src/ext/pdo/pdo_dbh.c?r1=1.140&r2=1.141&diff_format=u
Index: php-src/ext/pdo/pdo_dbh.c
diff -u php-src/ext/pdo/pdo_dbh.c:1.140 php-src/ext/pdo/pdo_dbh.c:1.141
--- php-src/ext/pdo/pdo_dbh.c:1.140     Wed May 16 19:58:58 2007
+++ php-src/ext/pdo/pdo_dbh.c   Mon May 28 23:43:24 2007
@@ -18,7 +18,7 @@
   +----------------------------------------------------------------------+
 */
 
-/* $Id: pdo_dbh.c,v 1.140 2007/05/16 19:58:58 iliaa Exp $ */
+/* $Id: pdo_dbh.c,v 1.141 2007/05/28 23:43:24 iliaa Exp $ */
 
 /* The PDO Database Handle Class */
 
@@ -830,7 +830,7 @@
 
        PDO_CONSTRUCT_CHECK;
 
-       if (pdo_dbh_attribute_set(dbh, attr, value TSRMLS_CC)) {
+       if (pdo_dbh_attribute_set(dbh, attr, value TSRMLS_CC) != FAILURE) {
                RETURN_TRUE;
        }
        RETURN_FALSE;
http://cvs.php.net/viewvc.cgi/php-src/ext/mysql/php_mysql.c?r1=1.235&r2=1.236&diff_format=u
Index: php-src/ext/mysql/php_mysql.c
diff -u php-src/ext/mysql/php_mysql.c:1.235 php-src/ext/mysql/php_mysql.c:1.236
--- php-src/ext/mysql/php_mysql.c:1.235 Mon May 14 18:10:10 2007
+++ php-src/ext/mysql/php_mysql.c       Mon May 28 23:43:24 2007
@@ -18,7 +18,7 @@
    +----------------------------------------------------------------------+
 */
  
-/* $Id: php_mysql.c,v 1.235 2007/05/14 18:10:10 scottmac Exp $ */
+/* $Id: php_mysql.c,v 1.236 2007/05/28 23:43:24 iliaa Exp $ */
 
 /* TODO:
  *
@@ -542,7 +542,7 @@
                        client_flags ^= CLIENT_LOCAL_FILES;
                }
 
-               hashed_details_length = spprintf(&hashed_details, 0, 
"mysql_%s_%s_%s", SAFE_STRING(host_and_port), SAFE_STRING(user), 
SAFE_STRING(passwd));
+               hashed_details_length = spprintf(&hashed_details, 0, 
"mysql_%s_%s_%s_%d", SAFE_STRING(host_and_port), SAFE_STRING(user), 
SAFE_STRING(passwd), client_flags);
        }
 
        /* We cannot use mysql_port anymore in windows, need to use

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

Reply via email to