[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/Zend/zend_exceptions.c trunk/Zend/zend_exceptions.c

2010-08-16 Thread Dmitry Stogov
dmitry   Mon, 16 Aug 2010 08:11:08 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=302311

Log:
Fixed memory leaks (related to bug #52361)

Bug: http://bugs.php.net/52361 (Assigned) Throwing an exception in a destructor 
causes invalid catching
  
Changed paths:
U   php/php-src/branches/PHP_5_3/Zend/zend_exceptions.c
U   php/php-src/trunk/Zend/zend_exceptions.c

Modified: php/php-src/branches/PHP_5_3/Zend/zend_exceptions.c
===
--- php/php-src/branches/PHP_5_3/Zend/zend_exceptions.c 2010-08-16 06:06:38 UTC 
(rev 302310)
+++ php/php-src/branches/PHP_5_3/Zend/zend_exceptions.c 2010-08-16 08:11:08 UTC 
(rev 302311)
@@ -572,6 +572,7 @@
zend_call_function(fci, NULL TSRMLS_CC);

if (Z_TYPE_P(trace) != IS_STRING) {
+   zval_ptr_dtor(trace);
trace = NULL;
}

@@ -592,6 +593,10 @@
zval_dtor(line);

exception = zend_read_property(default_exception_ce, exception, 
previous, sizeof(previous)-1, 0 TSRMLS_CC);
+
+   if (trace) {
+   zval_ptr_dtor(trace);
+   }
}
zval_dtor(fname);

@@ -599,10 +604,6 @@
 * the result in uncaught exception handlers without memleaks. */
zend_update_property_string(default_exception_ce, getThis(), string, 
sizeof(string)-1, str TSRMLS_CC);

-   if (trace) {
-   zval_ptr_dtor(trace);
-   }
-
RETURN_STRINGL(str, len, 0);
 }
 /* }}} */

Modified: php/php-src/trunk/Zend/zend_exceptions.c
===
--- php/php-src/trunk/Zend/zend_exceptions.c2010-08-16 06:06:38 UTC (rev 
302310)
+++ php/php-src/trunk/Zend/zend_exceptions.c2010-08-16 08:11:08 UTC (rev 
302311)
@@ -81,7 +81,7 @@
 }
 /* }}} */

-void zend_throw_exception_internal(zval *exception TSRMLS_DC) /* {{{ */
+ZEND_API void zend_throw_exception_internal(zval *exception TSRMLS_DC) /* {{{ 
*/
 {
 #ifdef HAVE_DTRACE
if (DTRACE_EXCEPTION_THROWN_ENABLED()) {
@@ -580,6 +580,7 @@
zend_call_function(fci, NULL TSRMLS_CC);

if (Z_TYPE_P(trace) != IS_STRING) {
+   zval_ptr_dtor(trace);
trace = NULL;
}

@@ -600,6 +601,11 @@
zval_dtor(line);

exception = zend_read_property(default_exception_ce, exception, 
previous, sizeof(previous)-1, 0 TSRMLS_CC);
+
+   if (trace) {
+   zval_ptr_dtor(trace);
+   }
+
}
zval_dtor(fname);

@@ -607,10 +613,6 @@
 * the result in uncaught exception handlers without memleaks. */
zend_update_property_string(default_exception_ce, getThis(), string, 
sizeof(string)-1, str TSRMLS_CC);

-   if (trace) {
-   zval_ptr_dtor(trace);
-   }
-
RETURN_STRINGL(str, len, 0);
 }
 /* }}} */

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

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/NEWS branches/PHP_5_3/Zend/tests/bug52361.phpt branches/PHP_5_3/Zend/zend_objects.c trunk/Zend/tests/bug52361.phpt trunk/Zend/zend_objects.c

2010-08-16 Thread Dmitry Stogov
dmitry   Mon, 16 Aug 2010 09:20:46 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=302323

Log:
Bug #52361 (Throwing an exception in a destructor causes invalid catching)

Bug: http://bugs.php.net/52361 (Assigned) Throwing an exception in a destructor 
causes invalid catching
  
Changed paths:
U   php/php-src/branches/PHP_5_3/NEWS
A   php/php-src/branches/PHP_5_3/Zend/tests/bug52361.phpt
U   php/php-src/branches/PHP_5_3/Zend/zend_objects.c
A   php/php-src/trunk/Zend/tests/bug52361.phpt
U   php/php-src/trunk/Zend/zend_objects.c

Modified: php/php-src/branches/PHP_5_3/NEWS
===
--- php/php-src/branches/PHP_5_3/NEWS   2010-08-16 09:13:21 UTC (rev 302322)
+++ php/php-src/branches/PHP_5_3/NEWS   2010-08-16 09:20:46 UTC (rev 302323)
@@ -24,6 +24,8 @@
   (Andrey)
 - Fixed bug #52413 (MySQLi/libmysql build failure on OS X, FreeBSD). (Andrey)
 - Fixed bug #52390 (mysqli_report() should be per-request setting). (Kalle)
+- Fixed bug #52361 (Throwing an exception in a destructor causes invalid
+  catching). (Dmitry)
 - Fixed bug #52302 (mysqli_fetch_all does not work with MYSQLI_USE_RESULT).
   (Andrey)
 - Fixed bug #51610 (Using oci_connect causes PHP to take a long time to

Added: php/php-src/branches/PHP_5_3/Zend/tests/bug52361.phpt
===
--- php/php-src/branches/PHP_5_3/Zend/tests/bug52361.phpt   
(rev 0)
+++ php/php-src/branches/PHP_5_3/Zend/tests/bug52361.phpt   2010-08-16 
09:20:46 UTC (rev 302323)
@@ -0,0 +1,35 @@
+--TEST--
+Bug #52361 (Throwing an exception in a destructor causes invalid catching)
+--FILE--
+?php
+class aaa {
+   public function __destruct() {
+   try {
+   throw new Exception(__CLASS__);
+   } catch(Exception $ex) {
+   echo 1. $ex\n;
+   }
+   }
+}
+function bbb() {
+   $a = new aaa();
+   throw new Exception(__FUNCTION__);
+}
+try {
+   bbb();
+   echo must be skipped !!!;
+} catch(Exception $ex) {
+   echo 2. $ex\n;
+}
+?
+--EXPECTF--
+1. exception 'Exception' with message 'aaa' in %sbug52361.php:5
+Stack trace:
+#0 %sbug52361.php(16): aaa-__destruct()
+#1 %sbug52361.php(16): bbb()
+#2 {main}
+2. exception 'Exception' with message 'bbb' in %sbug52361.php:13
+Stack trace:
+#0 %sbug52361.php(16): bbb()
+#1 {main}
+

Modified: php/php-src/branches/PHP_5_3/Zend/zend_objects.c
===
--- php/php-src/branches/PHP_5_3/Zend/zend_objects.c2010-08-16 09:13:21 UTC 
(rev 302322)
+++ php/php-src/branches/PHP_5_3/Zend/zend_objects.c2010-08-16 09:20:46 UTC 
(rev 302323)
@@ -106,15 +106,13 @@
zend_error(E_ERROR, Attempt to destruct 
pending exception);
} else {
old_exception = EG(exception);
-   Z_ADDREF_P(old_exception);
+   EG(exception) = NULL;
}
}
-   zend_exception_save(TSRMLS_C);
zend_call_method_with_0_params(obj, object-ce, destructor, 
ZEND_DESTRUCTOR_FUNC_NAME, NULL);
-   zend_exception_restore(TSRMLS_C);
if (old_exception) {
if (EG(exception)) {
-   zval_ptr_dtor(old_exception);
+   zend_exception_set_previous(EG(exception), 
old_exception TSRMLS_CC);
} else {
EG(exception) = old_exception;
}

Added: php/php-src/trunk/Zend/tests/bug52361.phpt
===
--- php/php-src/trunk/Zend/tests/bug52361.phpt  (rev 0)
+++ php/php-src/trunk/Zend/tests/bug52361.phpt  2010-08-16 09:20:46 UTC (rev 
302323)
@@ -0,0 +1,35 @@
+--TEST--
+Bug #52361 (Throwing an exception in a destructor causes invalid catching)
+--FILE--
+?php
+class aaa {
+   public function __destruct() {
+   try {
+   throw new Exception(__CLASS__);
+   } catch(Exception $ex) {
+   echo 1. $ex\n;
+   }
+   }
+}
+function bbb() {
+   $a = new aaa();
+   throw new Exception(__FUNCTION__);
+}
+try {
+   bbb();
+   echo must be skipped !!!;
+} catch(Exception $ex) {
+   echo 2. $ex\n;
+}
+?
+--EXPECTF--
+1. exception 'Exception' with message 'aaa' in %sbug52361.php:5
+Stack trace:
+#0 %sbug52361.php(16): aaa-__destruct()
+#1 %sbug52361.php(16): bbb()
+#2 {main}
+2. exception 'Exception' with message 'bbb' in %sbug52361.php:13
+Stack trace:
+#0 %sbug52361.php(16): bbb()
+#1 {main}
+

Modified: php/php-src/trunk/Zend/zend_objects.c

[PHP-CVS] svn: /php/php-src/branches/PHP_5_3/ext/mysqlnd/ mysqlnd.h mysqlnd_portability.h

2010-08-16 Thread Andrey Hristov
andrey   Mon, 16 Aug 2010 09:44:13 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=302331

Log:
Sync with trunk, fixes build failure on MacOSX.
Fix for Bug #52417 MySQLi build failure with mysqlnd

Bug: http://bugs.php.net/52417 (Assigned) MySQLi build failure with mysqlnd
  
Changed paths:
U   php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd.h
U   php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_portability.h

Modified: php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd.h
===
--- php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd.h  2010-08-16 09:34:11 UTC 
(rev 302330)
+++ php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd.h  2010-08-16 09:44:13 UTC 
(rev 302331)
@@ -286,7 +286,7 @@
longdebug_realloc_fail_threshold;
 ZEND_END_MODULE_GLOBALS(mysqlnd)

-PHPAPI ZEND_DECLARE_MODULE_GLOBALS(mysqlnd);
+PHPAPI ZEND_EXTERN_MODULE_GLOBALS(mysqlnd);

 #ifdef ZTS
 #define MYSQLND_G(v) TSRMG(mysqlnd_globals_id, zend_mysqlnd_globals *, v)

Modified: php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_portability.h
===
--- php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_portability.h  
2010-08-16 09:34:11 UTC (rev 302330)
+++ php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_portability.h  
2010-08-16 09:44:13 UTC (rev 302331)
@@ -12,6 +12,8 @@
 #ifndef MYSQLND_PORTABILITY_H
 #define MYSQLND_PORTABILITY_H

+
+
 /* Comes from global.h as OFFSET, renamed to STRUCT_OFFSET */
 #define STRUCT_OFFSET(t, f)   ((size_t)(char *)((t *)0)-f)


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

[PHP-CVS] svn: /php/php-src/branches/PHP_5_3/ NEWS

2010-08-16 Thread Andrey Hristov
andrey   Mon, 16 Aug 2010 09:45:26 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=302332

Log:
Here comes the news

Changed paths:
U   php/php-src/branches/PHP_5_3/NEWS

Modified: php/php-src/branches/PHP_5_3/NEWS
===
--- php/php-src/branches/PHP_5_3/NEWS   2010-08-16 09:44:13 UTC (rev 302331)
+++ php/php-src/branches/PHP_5_3/NEWS   2010-08-16 09:45:26 UTC (rev 302332)
@@ -22,6 +22,7 @@
   (Sriram Natarajan)
 - Fixed bug #52433 (Call to undefined method mysqli::poll() - must be static).
   (Andrey)
+- Fixed bug #52417 (MySQLi build failure with mysqlnd on MacOS X). (Andrey)
 - Fixed bug #52413 (MySQLi/libmysql build failure on OS X, FreeBSD). (Andrey)
 - Fixed bug #52390 (mysqli_report() should be per-request setting). (Kalle)
 - Fixed bug #52361 (Throwing an exception in a destructor causes invalid

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

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/standard/http_fopen_wrapper.c trunk/ext/standard/http_fopen_wrapper.c

2010-08-16 Thread Pierre Joye
pajoye   Mon, 16 Aug 2010 10:29:01 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=302334

Log:
- WS

Changed paths:
U   php/php-src/branches/PHP_5_3/ext/standard/http_fopen_wrapper.c
U   php/php-src/trunk/ext/standard/http_fopen_wrapper.c

Modified: php/php-src/branches/PHP_5_3/ext/standard/http_fopen_wrapper.c
===
--- php/php-src/branches/PHP_5_3/ext/standard/http_fopen_wrapper.c  
2010-08-16 09:57:38 UTC (rev 302333)
+++ php/php-src/branches/PHP_5_3/ext/standard/http_fopen_wrapper.c  
2010-08-16 10:29:01 UTC (rev 302334)
@@ -213,7 +213,7 @@
char header_line[HTTP_HEADER_BLOCK_SIZE];

/* get response header */
-   while (php_stream_gets(stream, header_line, 
HTTP_HEADER_BLOCK_SIZE-1) != NULL)  {
+   while (php_stream_gets(stream, header_line, 
HTTP_HEADER_BLOCK_SIZE-1) != NULL) {
if (header_line[0] == '\n' ||
header_line[0] == '\r' ||
header_line[0] == '\0') {
@@ -233,7 +233,7 @@
}
}

-   if (stream == NULL)
+   if (stream == NULL)
goto out;

/* avoid buffering issues while reading header */
@@ -309,7 +309,7 @@
}

/* query string */
-   if (resource-query){
+   if (resource-query) {
strlcat(scratch, ?, scratch_len);
strlcat(scratch, resource-query, scratch_len);
}
@@ -442,7 +442,7 @@
}

/* if the user has configured who they are, send a From: line */
-   if (((have_header  HTTP_HEADER_FROM) == 0)  cfg_get_string(from, 
tmp) == SUCCESS) {
+   if (((have_header  HTTP_HEADER_FROM) == 0)  cfg_get_string(from, 
tmp) == SUCCESS) {
if (snprintf(scratch, scratch_len, From: %s\r\n, tmp)  0)
php_stream_write(stream, scratch, strlen(scratch));
}
@@ -450,7 +450,7 @@
/* Send Host: header so name-based virtual hosts work */
if ((have_header  HTTP_HEADER_HOST) == 0) {
if ((use_ssl  resource-port != 443  resource-port != 0) ||
-   (!use_ssl  resource-port != 80  resource-port != 
0))  {
+   (!use_ssl  resource-port != 80  resource-port != 
0)) {
if (snprintf(scratch, scratch_len, Host: %s:%i\r\n, 
resource-host, resource-port)  0)
php_stream_write(stream, scratch, 
strlen(scratch));
} else {
@@ -685,7 +685,7 @@
php_stream_close(stream);
stream = NULL;

-   if (location[0] != '\0'){
+   if (location[0] != '\0') {

char new_path[HTTP_HEADER_BLOCK_SIZE];
char loc_path[HTTP_HEADER_BLOCK_SIZE];
@@ -697,7 +697,7 @@
strncasecmp(location, 
ftps://, sizeof(ftps://)-1)))
{
if (*location != '/') {
-   if (*(location+1) != '\0'  
resource-path) {
+   if (*(location+1) != '\0'  
resource-path) {
char *s = 
strrchr(resource-path, '/');
if (!s) {
s = resource-path;
@@ -839,7 +839,7 @@
NULL  /* rmdir */
 };

-PHPAPI php_stream_wrapper php_stream_http_wrapper ={
+PHPAPI php_stream_wrapper php_stream_http_wrapper = {
http_stream_wops,
NULL,
1 /* is_url */

Modified: php/php-src/trunk/ext/standard/http_fopen_wrapper.c
===
--- php/php-src/trunk/ext/standard/http_fopen_wrapper.c 2010-08-16 09:57:38 UTC 
(rev 302333)
+++ php/php-src/trunk/ext/standard/http_fopen_wrapper.c 2010-08-16 10:29:01 UTC 
(rev 302334)
@@ -213,7 +213,7 @@
char header_line[HTTP_HEADER_BLOCK_SIZE];

/* get response header */
-   while (php_stream_gets(stream, header_line, 
HTTP_HEADER_BLOCK_SIZE-1) != NULL)  {
+   while (php_stream_gets(stream, header_line, 
HTTP_HEADER_BLOCK_SIZE-1) != NULL) {
if (header_line[0] == '\n' ||
header_line[0] == '\r' ||
header_line[0] == '\0') {
@@ -233,7 +233,7 @@
}
}

-   if (stream == NULL)
+   if (stream == NULL)
goto out;

/* avoid buffering issues while reading header */
@@ -309,7 +309,7 @@
}

/* query string */
-   

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/date/lib/timezonedb.h trunk/ext/date/lib/timezonedb.h

2010-08-16 Thread Derick Rethans
derick   Mon, 16 Aug 2010 12:48:53 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=302342

Log:
- Updated to version 2010.12 (2010l)

Changed paths:
U   php/php-src/branches/PHP_5_3/ext/date/lib/timezonedb.h
U   php/php-src/trunk/ext/date/lib/timezonedb.h

Modified: php/php-src/branches/PHP_5_3/ext/date/lib/timezonedb.h
===
--- php/php-src/branches/PHP_5_3/ext/date/lib/timezonedb.h	2010-08-16 12:45:30 UTC (rev 302341)
+++ php/php-src/branches/PHP_5_3/ext/date/lib/timezonedb.h	2010-08-16 12:48:53 UTC (rev 302342)
@@ -730,7 +730,7 @@
 0x3F, 0x73, 0x57, 0x50, 0x40, 0x91, 0x7A, 0xE0, 0x41, 0x5C, 0x73, 0xD0, 0x42, 0x71, 0x5C, 0xE0,
 0x43, 0x3C, 0x55, 0xD0, 0x44, 0x51, 0x3E, 0xE0, 0x45, 0x12, 0xFD, 0x50, 0x46, 0x31, 0x20, 0xE0,
 0x46, 0xE0, 0x6A, 0x50, 0x48, 0x11, 0x02, 0xE0, 0x48, 0xB7, 0x11, 0xD0, 0x49, 0xF0, 0xE4, 0xE0,
-0x4A, 0x8D, 0xB9, 0x50, 0x4B, 0xDA, 0x01, 0x60, 0x4C, 0x61, 0xBD, 0xD0, 0x4C, 0x88, 0x07, 0x60,
+0x4A, 0x8D, 0xB9, 0x50, 0x4B, 0xDA, 0x01, 0x60, 0x4C, 0x61, 0xBD, 0xD0, 0x4C, 0x89, 0x58, 0xE0,
 0x4C, 0xA4, 0xFA, 0x50, 0x4D, 0xB9, 0xE3, 0x60, 0x4E, 0x84, 0xDC, 0x50, 0x4F, 0x99, 0xC5, 0x60,
 0x50, 0x64, 0xBE, 0x50, 0x51, 0x79, 0xA7, 0x60, 0x52, 0x44, 0xA0, 0x50, 0x53, 0x59, 0x89, 0x60,
 0x54, 0x24, 0x82, 0x50, 0x55, 0x39, 0x6B, 0x60, 0x56, 0x04, 0x64, 0x50, 0x57, 0x22, 0x87, 0xE0,
@@ -752,9 +752,9 @@
 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
 0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x01, 0x00, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
-0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x00, 0x00, 0x2A, 0x30,
 0x01, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x05, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x00, 0x00, 0x00,
 0x1C, 0x20, 0x00, 0x05, 0x45, 0x45, 0x53, 0x54, 0x00, 0x45, 0x45, 0x54, 0x00, 0x00, 0x00, 0x01,
@@ -7882,7 +7882,7 @@
 0x41, 0x5C, 0x81, 0xE0, 0x42, 0x5E, 0xE7, 0xE0, 0x43, 0x41, 0xB7, 0xF0, 0x44, 0x2D, 0xA6, 0x60,
 0x45, 0x12, 0xFD, 0x50, 0x46, 0x0E, 0xD9, 0xE0, 0x46, 0xE8, 0x6F, 0x70, 0x47, 0xF1, 0x5E, 0xE0,
 0x48, 0xB7, 0x2D, 0xF0, 0x49, 0xCB, 0xFA, 0xE0, 0x4A, 0xA0, 0x4A, 0x70, 0x4B, 0xAD, 0x2E, 0x9C,
-0x4C, 0x80, 0x2C, 0x70, 0x4D, 0x8D, 0x10, 0x9C, 0x4E, 0x60, 0x0E, 0x70, 0x4F, 0x76, 0x2D, 0x1C,
+0x4C, 0x61, 0xBD, 0xD0, 0x4D, 0x8D, 0x10, 0x9C, 0x4E, 0x60, 0x0E, 0x70, 0x4F, 0x76, 0x2D, 0x1C,
 0x50, 0x49, 0x2A, 0xF0, 0x51, 0x56, 0x0F, 0x1C, 0x52, 0x29, 0x0C, 0xF0, 0x53, 0x35, 0xF1, 0x1C,
 0x54, 0x08, 0xEE, 0xF0, 0x55, 0x15, 0xD3, 0x1C, 0x55, 0xE8, 0xD0, 0xF0, 0x56, 0xF5, 0xB5, 0x1C,
 0x57, 0xC8, 0xB2, 0xF0, 0x58, 0xD5, 0x97, 0x1C, 0x59, 0xA8, 0x94, 0xF0, 0x5A, 0xBE, 0xB3, 0x9C,
@@ -11857,7 +11857,7 @@
 0x3F, 0x73, 0x57, 0x50, 0x40, 0x91, 0x7A, 0xE0, 0x41, 0x5C, 0x73, 0xD0, 0x42, 0x71, 0x5C, 0xE0,
 0x43, 0x3C, 0x55, 0xD0, 0x44, 0x51, 0x3E, 0xE0, 0x45, 0x12, 0xFD, 0x50, 0x46, 0x31, 0x20, 0xE0,
 0x46, 0xE0, 0x6A, 0x50, 0x48, 0x11, 0x02, 0xE0, 0x48, 0xB7, 0x11, 0xD0, 0x49, 0xF0, 0xE4, 0xE0,
-0x4A, 0x8D, 0xB9, 0x50, 0x4B, 0xDA, 0x01, 0x60, 0x4C, 0x61, 0xBD, 0xD0, 0x4C, 0x88, 0x07, 0x60,
+0x4A, 0x8D, 0xB9, 0x50, 0x4B, 0xDA, 0x01, 0x60, 0x4C, 0x61, 0xBD, 0xD0, 0x4C, 0x89, 0x58, 0xE0,
 0x4C, 0xA4, 0xFA, 0x50, 0x4D, 0xB9, 0xE3, 0x60, 0x4E, 0x84, 0xDC, 0x50, 0x4F, 0x99, 0xC5, 0x60,
 0x50, 0x64, 0xBE, 0x50, 0x51, 0x79, 0xA7, 0x60, 0x52, 0x44, 0xA0, 0x50, 0x53, 0x59, 0x89, 0x60,
 0x54, 0x24, 0x82, 0x50, 0x55, 0x39, 0x6B, 0x60, 0x56, 0x04, 0x64, 0x50, 0x57, 0x22, 0x87, 0xE0,
@@ -11879,9 +11879,9 @@
 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
 0x00, 0x01, 0x00, 0x01, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x01, 0x00, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
-0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x00, 0x00, 0x2A, 0x30,
 0x01, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x05, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x00, 0x00, 0x00,
 0x1C, 0x20, 0x00, 0x05, 0x45, 0x45, 0x53, 0x54, 0x00, 0x45, 0x45, 0x54, 0x00, 

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/mysqli/tests/mysqli_character_set.phpt trunk/ext/mysqli/tests/mysqli_character_set.phpt

2010-08-16 Thread Andrey Hristov
andrey   Mon, 16 Aug 2010 16:13:55 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=302358

Log:
detect easily which charset doesn't work

Changed paths:
U   php/php-src/branches/PHP_5_3/ext/mysqli/tests/mysqli_character_set.phpt
U   php/php-src/trunk/ext/mysqli/tests/mysqli_character_set.phpt

Modified: 
php/php-src/branches/PHP_5_3/ext/mysqli/tests/mysqli_character_set.phpt
===
--- php/php-src/branches/PHP_5_3/ext/mysqli/tests/mysqli_character_set.phpt 
2010-08-16 16:10:49 UTC (rev 302357)
+++ php/php-src/branches/PHP_5_3/ext/mysqli/tests/mysqli_character_set.phpt 
2010-08-16 16:13:55 UTC (rev 302358)
@@ -44,23 +44,24 @@
$charsets[] = $row;
mysqli_free_result($res);

-   foreach ($charsets as $k = $charset) {
+   foreach ($charsets as $charset) {
+   $k = $charset['Charset'];
/* The server currently 17.07.2007 can't handle data sent in 
ucs2 */
if ($charset['Charset'] == 'ucs2') {
continue;
}

if (!mysqli_query($link, DROP TABLE IF EXISTS test))
-   printf([006 + %d] [%d] %s\n, $k, mysqli_errno($link), 
mysqli_error($link));
+   printf([006 + %s] [%d] %s\n, $k, mysqli_errno($link), 
mysqli_error($link));

$sql = sprintf(CREATE TABLE test(id INT, label CHAR(1)) 
CHARACTER SET '%s' , $charset['Charset']);
if (!mysqli_query($link, $sql)) {
-   printf([007 + %d] %s [%d] %s\n, $k, $sql, 
mysqli_errno($link), mysqli_error($link));
+   printf([007 + %s] %s [%d] %s\n, $k, $sql, 
mysqli_errno($link), mysqli_error($link));
continue;
}

if (!mysqli_set_charset($link, $charset['Charset'])) {
-   printf([008 + %d] [%d] %s\n, $k, mysqli_errno($link), 
mysqli_error($link));
+   printf([008 + %s] [%d] %s\n, $k, mysqli_errno($link), 
mysqli_error($link));
continue;
}

@@ -69,26 +70,26 @@
$i, 
mysqli_real_escape_string($link, chr(ord(a) + $i)
{
var_dump($charset['Charset']);
-   printf([009 + %d] [%d] %s\n, $k, 
mysqli_errno($link), mysqli_error($link));
+   printf([009 + %s] [%d] %s\n, $k, 
mysqli_errno($link), mysqli_error($link));
continue;
}
}

if (!$res = mysqli_query($link, SELECT id, label FROM test))
-   printf([010 + %d] [%d] %s\n, $k, mysqli_errno($link), 
mysqli_error($link));
+   printf([010 + %s] [%d] %s\n, $k, mysqli_errno($link), 
mysqli_error($link));

for ($i = 1; $i = 3; $i++) {

if (!$tmp = mysqli_fetch_assoc($res))
-   printf([011 + %d] [%d] %s\n, $k, 
mysqli_errno($link), mysqli_error($link));
+   printf([011 + %s] [%d] %s\n, $k, 
mysqli_errno($link), mysqli_error($link));

if ($tmp['id'] != $i)
-   printf([012 + %d] Expecting %d, got %s, [%d] 
%s\n, $k,
+   printf([012 + %s] Expecting %d, got %s, [%d] 
%s\n, $k,
$i, $tmp['id'],
mysqli_errno($link), 
mysqli_error($link));

if ($tmp['label'] != chr(ord(a) + $i))
-   printf([013 + %d] Expecting %d, got %s, [%d] 
%s\n, $k,
+   printf([013 + %s] Expecting %d, got %s, [%d] 
%s\n, $k,
chr(ord(a) + $i), $tmp['label'],
mysqli_errno($link), 
mysqli_error($link));


Modified: php/php-src/trunk/ext/mysqli/tests/mysqli_character_set.phpt
===
--- php/php-src/trunk/ext/mysqli/tests/mysqli_character_set.phpt
2010-08-16 16:10:49 UTC (rev 302357)
+++ php/php-src/trunk/ext/mysqli/tests/mysqli_character_set.phpt
2010-08-16 16:13:55 UTC (rev 302358)
@@ -44,23 +44,24 @@
$charsets[] = $row;
mysqli_free_result($res);

-   foreach ($charsets as $k = $charset) {
+   foreach ($charsets as $charset) {
+   $k = $charset['Charset'];
/* The server currently 17.07.2007 can't handle data sent in 
ucs2 */
if ($charset['Charset'] == 'ucs2') {
continue;
}

if (!mysqli_query($link, DROP TABLE IF EXISTS test))
-   printf([006 + %d] 

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/mysqli/tests/bug35759.phpt trunk/ext/mysqli/tests/bug35759.phpt

2010-08-16 Thread Andrey Hristov
andrey   Mon, 16 Aug 2010 16:15:15 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=302360

Log:
Fix test, so it doesn't fail with MySQL 5.5, where InnoDB
is the default engine

Changed paths:
U   php/php-src/branches/PHP_5_3/ext/mysqli/tests/bug35759.phpt
U   php/php-src/trunk/ext/mysqli/tests/bug35759.phpt

Modified: php/php-src/branches/PHP_5_3/ext/mysqli/tests/bug35759.phpt
===
--- php/php-src/branches/PHP_5_3/ext/mysqli/tests/bug35759.phpt 2010-08-16 
16:15:08 UTC (rev 302359)
+++ php/php-src/branches/PHP_5_3/ext/mysqli/tests/bug35759.phpt 2010-08-16 
16:15:15 UTC (rev 302360)
@@ -18,7 +18,7 @@
while (++$i  $col_num) {
$create .= , a$i MEDIUMBLOB NOT NULL DEFAULT '';
}
-   $create .= );
+   $create .= ) ENGINE=MyISAM; // doesn't work with InnoDB, which is 
default in 5.5

if (!$mysql-query($create)) {
if (1101 == $mysql-errno) {

Modified: php/php-src/trunk/ext/mysqli/tests/bug35759.phpt
===
--- php/php-src/trunk/ext/mysqli/tests/bug35759.phpt2010-08-16 16:15:08 UTC 
(rev 302359)
+++ php/php-src/trunk/ext/mysqli/tests/bug35759.phpt2010-08-16 16:15:15 UTC 
(rev 302360)
@@ -18,7 +18,7 @@
while (++$i  $col_num) {
$create .= , a$i MEDIUMBLOB NOT NULL DEFAULT '';
}
-   $create .= );
+   $create .= ) ENGINE=MyISAM; // doesn't work with InnoDB, which is 
default in 5.5

if (!$mysql-query($create)) {
if (1101 == $mysql-errno) {

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

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_2/run-tests.php branches/PHP_5_3/run-tests.php trunk/run-tests.php

2010-08-16 Thread Kalle Sommer Nielsen
kalleMon, 16 Aug 2010 20:56:00 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=302373

Log:
Fixed bug #50836 (run_tests.php alerts syntax errors while testing session)

Bug: http://bugs.php.net/50836 (Assigned) run_tests.php alerts syntax errors 
while testing session
  
Changed paths:
U   php/php-src/branches/PHP_5_2/run-tests.php
U   php/php-src/branches/PHP_5_3/run-tests.php
U   php/php-src/trunk/run-tests.php

Modified: php/php-src/branches/PHP_5_2/run-tests.php
===
--- php/php-src/branches/PHP_5_2/run-tests.php  2010-08-16 19:41:48 UTC (rev 
302372)
+++ php/php-src/branches/PHP_5_2/run-tests.php  2010-08-16 20:56:00 UTC (rev 
302373)
@@ -2161,7 +2161,17 @@
$settings .=  -d \$name=$val\;
}
} else {
-   $value = addslashes($value);
+   if (substr(PHP_OS, 0, 3) == WIN  !empty($value)  
$value{0} == '') {
+   $len = strlen($value);
+
+   if ($value{$len - 1} == '') {
+   $value{0} = ';
+   $value{$len - 1} = ';
+   }
+   } else {
+   $value = addslashes($value);
+   }
+
$settings .=  -d \$name=$value\;
}
}

Modified: php/php-src/branches/PHP_5_3/run-tests.php
===
--- php/php-src/branches/PHP_5_3/run-tests.php  2010-08-16 19:41:48 UTC (rev 
302372)
+++ php/php-src/branches/PHP_5_3/run-tests.php  2010-08-16 20:56:00 UTC (rev 
302373)
@@ -2161,7 +2161,17 @@
$settings .=  -d \$name=$val\;
}
} else {
-   $value = addslashes($value);
+   if (substr(PHP_OS, 0, 3) == WIN  !empty($value)  
$value{0} == '') {
+   $len = strlen($value);
+
+   if ($value{$len - 1} == '') {
+   $value{0} = ';
+   $value{$len - 1} = ';
+   }
+   } else {
+   $value = addslashes($value);
+   }
+
$settings .=  -d \$name=$value\;
}
}

Modified: php/php-src/trunk/run-tests.php
===
--- php/php-src/trunk/run-tests.php 2010-08-16 19:41:48 UTC (rev 302372)
+++ php/php-src/trunk/run-tests.php 2010-08-16 20:56:00 UTC (rev 302373)
@@ -2161,7 +2161,17 @@
$settings .=  -d \$name=$val\;
}
} else {
-   $value = addslashes($value);
+   if (substr(PHP_OS, 0, 3) == WIN  !empty($value)  
$value{0} == '') {
+   $len = strlen($value);
+
+   if ($value{$len - 1} == '') {
+   $value{0} = ';
+   $value{$len - 1} = ';
+   }
+   } else {
+   $value = addslashes($value);
+   }
+
$settings .=  -d \$name=$value\;
}
}

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

[PHP-CVS] svn: /php/php-src/trunk/ext/standard/ basic_functions.c file.c file.h

2010-08-16 Thread Kalle Sommer Nielsen
kalleMon, 16 Aug 2010 21:56:35 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=302376

Log:
Fixed the context parameter on copy() to actually have an effect

# After looking at the logs, Jani did a bad merge into 5.3, so that
# the context parameter sent to copy() actually isn't used at all. This
# relatively simple patch fixes that for trunk.
#
# See FR #42965

# internals:
# This changes the php_copy_*() decls to contain an additional parameter for 
stream contexts

Bug: http://bugs.php.net/42965 (Open) copy() should support context parameters 
for URLs
  
Changed paths:
U   php/php-src/trunk/ext/standard/basic_functions.c
U   php/php-src/trunk/ext/standard/file.c
U   php/php-src/trunk/ext/standard/file.h

Modified: php/php-src/trunk/ext/standard/basic_functions.c
===
--- php/php-src/trunk/ext/standard/basic_functions.c2010-08-16 21:43:19 UTC 
(rev 302375)
+++ php/php-src/trunk/ext/standard/basic_functions.c2010-08-16 21:56:35 UTC 
(rev 302376)
@@ -1206,6 +1206,7 @@
 ZEND_BEGIN_ARG_INFO(arginfo_copy, 0)
ZEND_ARG_INFO(0, source_file)
ZEND_ARG_INFO(0, destination_file)
+   ZEND_ARG_INFO(0, context)
 ZEND_END_ARG_INFO()

 ZEND_BEGIN_ARG_INFO(arginfo_fread, 0)
@@ -5715,7 +5716,7 @@
php_error_docref(NULL TSRMLS_CC, E_WARNING, %s, 
strerror(errno));
}
 #endif
-   } else if (php_copy_file_ex(path, new_path, STREAM_DISABLE_OPEN_BASEDIR 
TSRMLS_CC) == SUCCESS) {
+   } else if (php_copy_file_ex(path, new_path, 
STREAM_DISABLE_OPEN_BASEDIR, NULL TSRMLS_CC) == SUCCESS) {
VCWD_UNLINK(path);
successful = 1;
}

Modified: php/php-src/trunk/ext/standard/file.c
===
--- php/php-src/trunk/ext/standard/file.c   2010-08-16 21:43:19 UTC (rev 
302375)
+++ php/php-src/trunk/ext/standard/file.c   2010-08-16 21:56:35 UTC (rev 
302376)
@@ -1646,7 +1646,7 @@

context = php_stream_context_from_zval(zcontext, 0);

-   if (php_copy_file(source, target TSRMLS_CC) == SUCCESS) {
+   if (php_copy_file_ex(source, target, 0, context TSRMLS_CC) == SUCCESS) {
RETURN_TRUE;
} else {
RETURN_FALSE;
@@ -1656,19 +1656,19 @@

 PHPAPI int php_copy_file(char *src, char *dest TSRMLS_DC) /* {{{ */
 {
-   return php_copy_file_ex(src, dest, 0 TSRMLS_CC);
+   return php_copy_file_ex(src, dest, 0, NULL TSRMLS_CC);
 }
 /* }}} */

 /* {{{ php_copy_file
  */
-PHPAPI int php_copy_file_ex(char *src, char *dest, int src_flg TSRMLS_DC)
+PHPAPI int php_copy_file_ex(char *src, char *dest, int src_flg, 
php_stream_context *ctx TSRMLS_DC)
 {
php_stream *srcstream = NULL, *deststream = NULL;
int ret = FAILURE;
php_stream_statbuf src_s, dest_s;

-   switch (php_stream_stat_path_ex(src, 0, src_s, NULL)) {
+   switch (php_stream_stat_path_ex(src, 0, src_s, ctx)) {
case -1:
/* non-statable stream */
goto safe_to_copy;
@@ -1683,7 +1683,7 @@
return FAILURE;
}

-   switch (php_stream_stat_path_ex(dest, PHP_STREAM_URL_STAT_QUIET, 
dest_s, NULL)) {
+   switch (php_stream_stat_path_ex(dest, PHP_STREAM_URL_STAT_QUIET, 
dest_s, ctx)) {
case -1:
/* non-statable stream */
goto safe_to_copy;
@@ -1733,13 +1733,13 @@
}
 safe_to_copy:

-   srcstream = php_stream_open_wrapper(src, rb, src_flg | REPORT_ERRORS, 
NULL);
+   srcstream = php_stream_open_wrapper_ex(src, rb, src_flg | 
REPORT_ERRORS, NULL, ctx);

if (!srcstream) {
return ret;
}

-   deststream = php_stream_open_wrapper(dest, wb, REPORT_ERRORS, NULL);
+   deststream = php_stream_open_wrapper_ex(dest, wb, REPORT_ERRORS, 
NULL, ctx);

if (srcstream  deststream) {
ret = php_stream_copy_to_stream_ex(srcstream, deststream, 
PHP_STREAM_COPY_ALL, NULL);

Modified: php/php-src/trunk/ext/standard/file.h
===
--- php/php-src/trunk/ext/standard/file.h   2010-08-16 21:43:19 UTC (rev 
302375)
+++ php/php-src/trunk/ext/standard/file.h   2010-08-16 21:56:35 UTC (rev 
302376)
@@ -75,7 +75,7 @@
 PHPAPI int php_le_stream_context(void);
 PHPAPI int php_set_sock_blocking(int socketd, int block TSRMLS_DC);
 PHPAPI int php_copy_file(char *src, char *dest TSRMLS_DC);
-PHPAPI int php_copy_file_ex(char *src, char *dest, int src_chk TSRMLS_DC);
+PHPAPI int php_copy_file_ex(char *src, char *dest, int src_chk, 
php_stream_context *ctx TSRMLS_DC);
 PHPAPI int php_mkdir_ex(char *dir, long mode, int options TSRMLS_DC);
 PHPAPI int php_mkdir(char *dir, long mode TSRMLS_DC);
 PHPAPI void php_fgetcsv(php_stream *stream, char delimiter, char 

[PHP-CVS] svn: /php/php-src/branches/PHP_5_3/ext/standard/ basic_functions.c

2010-08-16 Thread Kalle Sommer Nielsen
kalleMon, 16 Aug 2010 21:59:42 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=302377

Log:
Fix arginfo for copy(), see r302376 for more info

Changed paths:
U   php/php-src/branches/PHP_5_3/ext/standard/basic_functions.c

Modified: php/php-src/branches/PHP_5_3/ext/standard/basic_functions.c
===
--- php/php-src/branches/PHP_5_3/ext/standard/basic_functions.c 2010-08-16 
21:56:35 UTC (rev 302376)
+++ php/php-src/branches/PHP_5_3/ext/standard/basic_functions.c 2010-08-16 
21:59:42 UTC (rev 302377)
@@ -1209,9 +1209,11 @@
 ZEND_BEGIN_ARG_INFO(arginfo_fstat, 0)
ZEND_ARG_INFO(0, fp)
 ZEND_END_ARG_INFO()
+
 ZEND_BEGIN_ARG_INFO(arginfo_copy, 0)
ZEND_ARG_INFO(0, source_file)
ZEND_ARG_INFO(0, destination_file)
+   ZEND_ARG_INFO(0, context)
 ZEND_END_ARG_INFO()

 ZEND_BEGIN_ARG_INFO(arginfo_fread, 0)

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

Re: [PHP-CVS] svn: /php/php-src/trunk/ext/standard/ basic_functions.c file.c file.h

2010-08-16 Thread Kalle Sommer Nielsen
Hi Johannes

2010/8/16 Kalle Sommer Nielsen ka...@php.net:
 kalle                                    Mon, 16 Aug 2010 21:56:35 +

 Revision: http://svn.php.net/viewvc?view=revisionrevision=302376

 Log:
 Fixed the context parameter on copy() to actually have an effect

 # After looking at the logs, Jani did a bad merge into 5.3, so that
 # the context parameter sent to copy() actually isn't used at all. This
 # relatively simple patch fixes that for trunk.
 #
 # See FR #42965

 # internals:
 # This changes the php_copy_*() decls to contain an additional parameter for 
 stream contexts

Could you please review this commit for being merged into 5.3, the
commit message explains most of the reasons :)

-- 
regards,

Kalle Sommer Nielsen
ka...@php.net

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