[PHP-CVS-DAILY] cvs: ZendEngine2 / ChangeLog
changelog Thu Oct 6 01:34:44 2005 EDT Modified files: /ZendEngine2ChangeLog Log: ChangeLog update http://cvs.php.net/diff.php/ZendEngine2/ChangeLog?r1=1.782r2=1.783ty=u Index: ZendEngine2/ChangeLog diff -u ZendEngine2/ChangeLog:1.782 ZendEngine2/ChangeLog:1.783 --- ZendEngine2/ChangeLog:1.782 Tue Oct 4 01:38:47 2005 +++ ZendEngine2/ChangeLog Thu Oct 6 01:34:43 2005 @@ -1,3 +1,17 @@ +2005-10-05 Marcus Boerger [EMAIL PROTECTED] + +* zend.c + zend_API.c + zend_execute.h + zend_object_handlers.c + zend_object_handlers.h + zend_operators.c: + - Have __toString() be called if available in all places an object is used +as a string. + +* zend_interfaces.c: + - Fix warnings + 2005-10-03 Marcus Boerger [EMAIL PROTECTED] * zend_execute.h: @@ -10574,7 +10588,7 @@ 2003-06-10 Jani Taskinen [EMAIL PROTECTED] * zend_multiply.h: - - Missing $Id: ChangeLog,v 1.782 2005/10/04 05:38:47 changelog Exp $ tag + - Missing $Id: ChangeLog,v 1.783 2005/10/06 05:34:43 changelog Exp $ tag 2003-06-10 James Cox [EMAIL PROTECTED] @@ -12298,7 +12312,7 @@ zend_types.h zend_variables.c zend_variables.h: - - Added some missing CVS $Id: ChangeLog,v 1.782 2005/10/04 05:38:47 changelog Exp $ tags, headers and footers. + - Added some missing CVS $Id: ChangeLog,v 1.783 2005/10/06 05:34:43 changelog Exp $ tags, headers and footers. 2003-01-30 Ilia Alshanetsky [EMAIL PROTECTED]
RE: [PHP-CVS] cvs: php-src /ext/standard array.c
Tony, Please look into ext/standard/tests/array/bug30833.phpt It is failed after your patch. Probably test file itself should be fixed. Thanks. Dmitry. -Original Message- From: Antony Dovgal [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 05, 2005 12:48 AM To: php-cvs@lists.php.net Subject: [PHP-CVS] cvs: php-src /ext/standard array.c tony2001 Tue Oct 4 16:47:50 2005 EDT Modified files: /php-src/ext/standard array.c Log: fix #34723 (array_count_values() strips leading zeroes) http://cvs.php.net/diff.php/php-src/ext/standard/array.c?r1=1. 326r2=1.327ty=u Index: php-src/ext/standard/array.c diff -u php-src/ext/standard/array.c:1.326 php-src/ext/standard/array.c:1.327 --- php-src/ext/standard/array.c:1.326Mon Oct 3 10:01:36 2005 +++ php-src/ext/standard/array.c Tue Oct 4 16:47:48 2005 @@ -21,7 +21,7 @@ +- -+ */ -/* $Id: array.c,v 1.326 2005/10/03 14:01:36 iliaa Exp $ */ +/* $Id: array.c,v 1.327 2005/10/04 20:47:48 tony2001 Exp $ */ #include php.h #include php_ini.h @@ -2726,9 +2726,10 @@ } else if (Z_TYPE_PP(entry) == IS_STRING || Z_TYPE_PP(entry) == IS_BINARY || Z_TYPE_PP(entry) == IS_UNICODE) { - /* make sure our array does not end up with numeric string keys */ - if ((Z_TYPE_PP(entry) == IS_STRING is_numeric_string(Z_STRVAL_PP(entry), Z_STRLEN_PP(entry), NULL, NULL, 0) == IS_LONG) || - (Z_TYPE_PP(entry) == IS_UNICODE is_numeric_unicode(Z_USTRVAL_PP(entry), Z_USTRLEN_PP(entry), NULL, NULL, 0) == IS_LONG)) { + /* make sure our array does not end up with numeric string keys + * but don't touch those strings that start with 0 */ + if ((Z_TYPE_PP(entry) == IS_STRING !(Z_STRLEN_PP(entry) 1 Z_STRVAL_PP(entry)[0] == '0') is_numeric_string(Z_STRVAL_PP(entry), Z_STRLEN_PP(entry), NULL, NULL, 0) == IS_LONG) || + (Z_TYPE_PP(entry) == IS_UNICODE +zend_cmp_unicode_and_literal(Z_USTRVAL_PP(entry), 1, 0, sizeof(0)-1) is_numeric_unicode(Z_USTRVAL_PP(entry), Z_USTRLEN_PP(entry), NULL, NULL, 0) == IS_LONG)) { zval tmp_entry; tmp_entry = **entry; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/soap soap.c /ext/soap/tests server022.phpt
dmitry Wed Oct 5 03:01:48 2005 EDT Added files: /php-src/ext/soap/tests server022.phpt Modified files: /php-src/ext/soap soap.c Log: Fixed throwing exceptions derived from SoapFault http://cvs.php.net/diff.php/php-src/ext/soap/soap.c?r1=1.162r2=1.163ty=u Index: php-src/ext/soap/soap.c diff -u php-src/ext/soap/soap.c:1.162 php-src/ext/soap/soap.c:1.163 --- php-src/ext/soap/soap.c:1.162 Mon Oct 3 05:52:43 2005 +++ php-src/ext/soap/soap.c Wed Oct 5 03:01:44 2005 @@ -17,7 +17,7 @@ | Dmitry Stogov [EMAIL PROTECTED] | +--+ */ -/* $Id: soap.c,v 1.162 2005/10/03 09:52:43 dmitry Exp $ */ +/* $Id: soap.c,v 1.163 2005/10/05 07:01:44 dmitry Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -110,7 +110,7 @@ EG(current_execute_data) = _old_current_execute_data; \ if (EG(exception) == NULL || \ Z_TYPE_P(EG(exception)) != IS_OBJECT || \ - Z_OBJCE_P(EG(exception)) != soap_fault_class_entry) {\ + !instanceof_function(Z_OBJCE_P(EG(exception)), soap_fault_class_entry TSRMLS_CC)) {\ _bailout = 1;\ }\ } zend_end_try();\ @@ -1540,7 +1540,7 @@ } if (EG(exception)) { if (Z_TYPE_P(EG(exception)) == IS_OBJECT - Z_OBJCE_P(EG(exception)) == soap_fault_class_entry) { + instanceof_function(Z_OBJCE_P(EG(exception)), soap_fault_class_entry TSRMLS_CC)) { soap_server_fault_ex(function, EG(exception), NULL TSRMLS_CC); } else { zval_dtor(constructor); @@ -1573,7 +1573,7 @@ #ifdef ZEND_ENGINE_2 if (EG(exception)) { if (Z_TYPE_P(EG(exception)) == IS_OBJECT - Z_OBJCE_P(EG(exception)) == soap_fault_class_entry) { + instanceof_function(Z_OBJCE_P(EG(exception)), soap_fault_class_entry TSRMLS_CC)) { soap_server_fault_ex(function, EG(exception), NULL TSRMLS_CC); } else { zval_dtor(constructor); @@ -1643,7 +1643,7 @@ php_error_docref(NULL TSRMLS_CC, E_ERROR, Function '%s' call failed, Z_STRVAL(h-function_name)); } if (Z_TYPE(h-retval) == IS_OBJECT - Z_OBJCE(h-retval) == soap_fault_class_entry) { + instanceof_function(Z_OBJCE(h-retval), soap_fault_class_entry TSRMLS_CC)) { zval *headerfault = NULL, **tmp; if (zend_hash_find(Z_OBJPROP(h-retval), headerfault, sizeof(headerfault), (void**)tmp) == SUCCESS @@ -1654,7 +1654,7 @@ #ifdef ZEND_ENGINE_2 } else if (EG(exception)) { if (Z_TYPE_P(EG(exception)) == IS_OBJECT - Z_OBJCE_P(EG(exception)) == soap_fault_class_entry) { + instanceof_function(Z_OBJCE_P(EG(exception)), soap_fault_class_entry TSRMLS_CC)) { zval *headerfault = NULL, **tmp; if (zend_hash_find(Z_OBJPROP_P(EG(exception)), headerfault, sizeof(headerfault), (void**)tmp) == SUCCESS @@ -1701,7 +1701,7 @@ #ifdef ZEND_ENGINE_2 if (EG(exception)) { if (Z_TYPE_P(EG(exception)) == IS_OBJECT - Z_OBJCE_P(EG(exception)) == soap_fault_class_entry) { + instanceof_function(Z_OBJCE_P(EG(exception)), soap_fault_class_entry TSRMLS_CC)) { soap_server_fault_ex(function, EG(exception), NULL TSRMLS_CC); } else { if (soap_obj) {zval_ptr_dtor(soap_obj);} @@ -1714,7 +1714,7 @@ char *response_name; if (Z_TYPE(retval) == IS_OBJECT - Z_OBJCE(retval) == soap_fault_class_entry) { + instanceof_function(Z_OBJCE(retval), soap_fault_class_entry TSRMLS_CC)) { soap_server_fault_ex(function, retval, NULL TSRMLS_CC); } @@ -2017,7 +2017,7 @@ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, z, fault) == SUCCESS
[PHP-CVS] cvs: php-src(PHP_5_0) /ext/soap soap.c /ext/soap/tests server022.phpt
dmitry Wed Oct 5 03:02:11 2005 EDT Added files: (Branch: PHP_5_0) /php-src/ext/soap/tests server022.phpt Modified files: /php-src/ext/soap soap.c Log: Fixed throwing exceptions derived from SoapFault http://cvs.php.net/diff.php/php-src/ext/soap/soap.c?r1=1.110.2.45r2=1.110.2.46ty=u Index: php-src/ext/soap/soap.c diff -u php-src/ext/soap/soap.c:1.110.2.45 php-src/ext/soap/soap.c:1.110.2.46 --- php-src/ext/soap/soap.c:1.110.2.45 Mon Oct 3 05:53:32 2005 +++ php-src/ext/soap/soap.c Wed Oct 5 03:02:10 2005 @@ -17,7 +17,7 @@ | Dmitry Stogov [EMAIL PROTECTED] | +--+ */ -/* $Id: soap.c,v 1.110.2.45 2005/10/03 09:53:32 dmitry Exp $ */ +/* $Id: soap.c,v 1.110.2.46 2005/10/05 07:02:10 dmitry Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -110,7 +110,7 @@ EG(current_execute_data) = _old_current_execute_data; \ if (EG(exception) == NULL || \ Z_TYPE_P(EG(exception)) != IS_OBJECT || \ - Z_OBJCE_P(EG(exception)) != soap_fault_class_entry) {\ + !instanceof_function(Z_OBJCE_P(EG(exception)), soap_fault_class_entry TSRMLS_CC)) {\ _bailout = 1;\ }\ } zend_end_try();\ @@ -1540,7 +1540,7 @@ } if (EG(exception)) { if (Z_TYPE_P(EG(exception)) == IS_OBJECT - Z_OBJCE_P(EG(exception)) == soap_fault_class_entry) { + instanceof_function(Z_OBJCE_P(EG(exception)), soap_fault_class_entry TSRMLS_CC)) { soap_server_fault_ex(function, EG(exception), NULL TSRMLS_CC); } else { zval_dtor(constructor); @@ -1573,7 +1573,7 @@ #ifdef ZEND_ENGINE_2 if (EG(exception)) { if (Z_TYPE_P(EG(exception)) == IS_OBJECT - Z_OBJCE_P(EG(exception)) == soap_fault_class_entry) { + instanceof_function(Z_OBJCE_P(EG(exception)), soap_fault_class_entry TSRMLS_CC)) { soap_server_fault_ex(function, EG(exception), NULL TSRMLS_CC); } else { zval_dtor(constructor); @@ -1643,7 +1643,7 @@ php_error_docref(NULL TSRMLS_CC, E_ERROR, Function '%s' call failed, Z_STRVAL(h-function_name)); } if (Z_TYPE(h-retval) == IS_OBJECT - Z_OBJCE(h-retval) == soap_fault_class_entry) { + instanceof_function(Z_OBJCE(h-retval), soap_fault_class_entry TSRMLS_CC)) { zval *headerfault = NULL, **tmp; if (zend_hash_find(Z_OBJPROP(h-retval), headerfault, sizeof(headerfault), (void**)tmp) == SUCCESS @@ -1654,7 +1654,7 @@ #ifdef ZEND_ENGINE_2 } else if (EG(exception)) { if (Z_TYPE_P(EG(exception)) == IS_OBJECT - Z_OBJCE_P(EG(exception)) == soap_fault_class_entry) { + instanceof_function(Z_OBJCE_P(EG(exception)), soap_fault_class_entry TSRMLS_CC)) { zval *headerfault = NULL, **tmp; if (zend_hash_find(Z_OBJPROP_P(EG(exception)), headerfault, sizeof(headerfault), (void**)tmp) == SUCCESS @@ -1701,7 +1701,7 @@ #ifdef ZEND_ENGINE_2 if (EG(exception)) { if (Z_TYPE_P(EG(exception)) == IS_OBJECT - Z_OBJCE_P(EG(exception)) == soap_fault_class_entry) { + instanceof_function(Z_OBJCE_P(EG(exception)), soap_fault_class_entry TSRMLS_CC)) { soap_server_fault_ex(function, EG(exception), NULL TSRMLS_CC); } else { if (soap_obj) {zval_ptr_dtor(soap_obj);} @@ -1714,7 +1714,7 @@ char *response_name; if (Z_TYPE(retval) == IS_OBJECT - Z_OBJCE(retval) == soap_fault_class_entry) { + instanceof_function(Z_OBJCE(retval), soap_fault_class_entry TSRMLS_CC)) { soap_server_fault_ex(function, retval, NULL TSRMLS_CC); } @@ -2017,7 +2017,7 @@ if (zend_parse_parameters(ZEND_NUM_ARGS()
[PHP-CVS] cvs: php-src(PHP_5_1) /ext/soap soap.c /ext/soap/tests server022.phpt
dmitry Wed Oct 5 03:02:31 2005 EDT Added files: (Branch: PHP_5_1) /php-src/ext/soap/tests server022.phpt Modified files: /php-src/ext/soap soap.c Log: Fixed throwing exceptions derived from SoapFault http://cvs.php.net/diff.php/php-src/ext/soap/soap.c?r1=1.156.2.5r2=1.156.2.6ty=u Index: php-src/ext/soap/soap.c diff -u php-src/ext/soap/soap.c:1.156.2.5 php-src/ext/soap/soap.c:1.156.2.6 --- php-src/ext/soap/soap.c:1.156.2.5 Mon Oct 3 05:53:12 2005 +++ php-src/ext/soap/soap.c Wed Oct 5 03:02:30 2005 @@ -17,7 +17,7 @@ | Dmitry Stogov [EMAIL PROTECTED] | +--+ */ -/* $Id: soap.c,v 1.156.2.5 2005/10/03 09:53:12 dmitry Exp $ */ +/* $Id: soap.c,v 1.156.2.6 2005/10/05 07:02:30 dmitry Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -110,7 +110,7 @@ EG(current_execute_data) = _old_current_execute_data; \ if (EG(exception) == NULL || \ Z_TYPE_P(EG(exception)) != IS_OBJECT || \ - Z_OBJCE_P(EG(exception)) != soap_fault_class_entry) {\ + !instanceof_function(Z_OBJCE_P(EG(exception)), soap_fault_class_entry TSRMLS_CC)) {\ _bailout = 1;\ }\ } zend_end_try();\ @@ -1540,7 +1540,7 @@ } if (EG(exception)) { if (Z_TYPE_P(EG(exception)) == IS_OBJECT - Z_OBJCE_P(EG(exception)) == soap_fault_class_entry) { + instanceof_function(Z_OBJCE_P(EG(exception)), soap_fault_class_entry TSRMLS_CC)) { soap_server_fault_ex(function, EG(exception), NULL TSRMLS_CC); } else { zval_dtor(constructor); @@ -1573,7 +1573,7 @@ #ifdef ZEND_ENGINE_2 if (EG(exception)) { if (Z_TYPE_P(EG(exception)) == IS_OBJECT - Z_OBJCE_P(EG(exception)) == soap_fault_class_entry) { + instanceof_function(Z_OBJCE_P(EG(exception)), soap_fault_class_entry TSRMLS_CC)) { soap_server_fault_ex(function, EG(exception), NULL TSRMLS_CC); } else { zval_dtor(constructor); @@ -1643,7 +1643,7 @@ php_error_docref(NULL TSRMLS_CC, E_ERROR, Function '%s' call failed, Z_STRVAL(h-function_name)); } if (Z_TYPE(h-retval) == IS_OBJECT - Z_OBJCE(h-retval) == soap_fault_class_entry) { + instanceof_function(Z_OBJCE(h-retval), soap_fault_class_entry TSRMLS_CC)) { zval *headerfault = NULL, **tmp; if (zend_hash_find(Z_OBJPROP(h-retval), headerfault, sizeof(headerfault), (void**)tmp) == SUCCESS @@ -1654,7 +1654,7 @@ #ifdef ZEND_ENGINE_2 } else if (EG(exception)) { if (Z_TYPE_P(EG(exception)) == IS_OBJECT - Z_OBJCE_P(EG(exception)) == soap_fault_class_entry) { + instanceof_function(Z_OBJCE_P(EG(exception)), soap_fault_class_entry TSRMLS_CC)) { zval *headerfault = NULL, **tmp; if (zend_hash_find(Z_OBJPROP_P(EG(exception)), headerfault, sizeof(headerfault), (void**)tmp) == SUCCESS @@ -1701,7 +1701,7 @@ #ifdef ZEND_ENGINE_2 if (EG(exception)) { if (Z_TYPE_P(EG(exception)) == IS_OBJECT - Z_OBJCE_P(EG(exception)) == soap_fault_class_entry) { + instanceof_function(Z_OBJCE_P(EG(exception)), soap_fault_class_entry TSRMLS_CC)) { soap_server_fault_ex(function, EG(exception), NULL TSRMLS_CC); } else { if (soap_obj) {zval_ptr_dtor(soap_obj);} @@ -1714,7 +1714,7 @@ char *response_name; if (Z_TYPE(retval) == IS_OBJECT - Z_OBJCE(retval) == soap_fault_class_entry) { + instanceof_function(Z_OBJCE(retval), soap_fault_class_entry TSRMLS_CC)) { soap_server_fault_ex(function, retval, NULL TSRMLS_CC); } @@ -2017,7 +2017,7 @@ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, z,
[PHP-CVS] cvs: php-src(PHP_5_1) /ext/date php_date.c php_date.h
derick Wed Oct 5 04:20:46 2005 EDT Modified files: (Branch: PHP_5_1) /php-src/ext/date php_date.c php_date.h Log: - Implemented tzcache - Attempt at Windows detection code http://cvs.php.net/diff.php/php-src/ext/date/php_date.c?r1=1.43.2.9r2=1.43.2.10ty=u Index: php-src/ext/date/php_date.c diff -u php-src/ext/date/php_date.c:1.43.2.9 php-src/ext/date/php_date.c:1.43.2.10 --- php-src/ext/date/php_date.c:1.43.2.9Mon Oct 3 19:37:10 2005 +++ php-src/ext/date/php_date.c Wed Oct 5 04:20:43 2005 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: php_date.c,v 1.43.2.9 2005/10/03 23:37:10 tony2001 Exp $ */ +/* $Id: php_date.c,v 1.43.2.10 2005/10/05 08:20:43 derick Exp $ */ #include php.h #include php_streams.h @@ -185,6 +185,14 @@ } /* }}} */ + +static void _php_date_tzinfo_dtor(void *tzinfo) +{ + timelib_tzinfo **tzi = (timelib_tzinfo **)tzinfo; + + timelib_tzinfo_dtor(*tzi); +} + /* {{{ PHP_RINIT_FUNCTION */ PHP_RINIT_FUNCTION(date) { @@ -192,6 +200,7 @@ efree(DATEG(timezone)); } DATEG(timezone) = NULL; + zend_hash_init(DATEG(tzcache), 4, NULL, _php_date_tzinfo_dtor, 0); return SUCCESS; } @@ -204,6 +213,7 @@ efree(DATEG(timezone)); } DATEG(timezone) = NULL; + zend_hash_destroy(DATEG(tzcache)); return SUCCESS; } @@ -267,6 +277,20 @@ } /* }}} */ +/* {{{ Timezone Cache functions */ +static timelib_tzinfo *php_date_parse_tzfile(char *tzname, timelib_tzdb *tzdb TSRMLS_CC) +{ + timelib_tzinfo *tzi, **ptzi; + + if (zend_hash_find(DATEG(tzcache), tzname, strlen(tzname) + 1, (void **) ptzi) == SUCCESS) { + return *ptzi; + } + + tzi = timelib_parse_tzfile(tzname, tzdb); + zend_hash_add(DATEG(tzcache), tzname, strlen(tzname) + 1, (void *) tzi, sizeof(timelib_tzinfo*), NULL); + return tzi; +} +/* }}} */ /* {{{ Helper functions */ static char* guess_timezone(TSRMLS_D) @@ -304,6 +328,34 @@ return tzid; } #endif +#ifdef PHP_WIN32 + { + TIME_ZONE_INFORMATION tzi; + + switch (GetTimeZoneInformation(tzi)) + { + case TIME_ZONE_ID_UNKNOWN: + /* we have no clue what it is, return UTC */ + php_error_docref(NULL TSRMLS_CC, E_STRICT, It is not safe to rely on the systems timezone settings, please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. We use 'UTC' instead.); + return UTC; + + case TIME_ZONE_ID_STANDARD: + tzid = timelib_timezone_id_from_abbr(tzi-StandardName, (tzi-Bias - tzi-StandardBias) * 60, 0); + php_error_docref(NULL TSRMLS_CC, E_STRICT, It is not safe to rely on the systems timezone settings, please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. We use '%s' for '%s/%.1f/no DST' instead., tzid, tzi-StandardName, (float) ((tzi-Bias - tzi-StandardBias) / 60)); + break; + + case TIME_ZONE_ID_STANDARD: + tzid = timelib_timezone_id_from_abbr(tzi-DaylightName, (tzi-Bias - tzi-DaylightBias) * 60, 0); + php_error_docref(NULL TSRMLS_CC, E_STRICT, It is not safe to rely on the systems timezone settings, please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. We use '%s' for '%s/%.1f/DST' instead., tzid, tzi-StandardName, (float) ((tzi-Bias - tzi-DaylightBias) / 60)); + break; + + } + + php_error_docref(NULL TSRMLS_CC, E_STRICT, Extra Debug Info: bias: %d, standard bias: %d, daylight bias: %d, s. name: %s, d. name: %s, + tzi-Bias, tzi-StandardBias, tzi-DaylightBias, tzi-StandardName, tzi-DaylightName); + return tzid; + } +#endif /* Fallback to UTC */ return UTC; } @@ -314,10 +366,10 @@ timelib_tzinfo *tzi; tz = guess_timezone(TSRMLS_C); - tzi = timelib_parse_tzfile(tz, DATE_TIMEZONEDB); + tzi = php_date_parse_tzfile(tz, DATE_TIMEZONEDB); if (! tzi) { php_error_docref(NULL TSRMLS_CC, E_NOTICE, Timezone setting (date.timezone) or TZ environment variable contains an unknown timezone.); - tzi = timelib_parse_tzfile(UTC, DATE_TIMEZONEDB); + tzi = php_date_parse_tzfile(UTC, DATE_TIMEZONEDB); if (! tzi) { php_error_docref(NULL TSRMLS_CC, E_ERROR, Timezone database is corrupt - this should *never* happen!); @@ -491,11 +543,14 @@ static void
[PHP-CVS] cvs: php-src(PHP_5_1) /ext/date php_date.c
derick Wed Oct 5 04:23:44 2005 EDT Modified files: (Branch: PHP_5_1) /php-src/ext/date php_date.c Log: - Fixed typo. http://cvs.php.net/diff.php/php-src/ext/date/php_date.c?r1=1.43.2.10r2=1.43.2.11ty=u Index: php-src/ext/date/php_date.c diff -u php-src/ext/date/php_date.c:1.43.2.10 php-src/ext/date/php_date.c:1.43.2.11 --- php-src/ext/date/php_date.c:1.43.2.10 Wed Oct 5 04:20:43 2005 +++ php-src/ext/date/php_date.c Wed Oct 5 04:23:39 2005 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: php_date.c,v 1.43.2.10 2005/10/05 08:20:43 derick Exp $ */ +/* $Id: php_date.c,v 1.43.2.11 2005/10/05 08:23:39 derick Exp $ */ #include php.h #include php_streams.h @@ -344,8 +344,8 @@ php_error_docref(NULL TSRMLS_CC, E_STRICT, It is not safe to rely on the systems timezone settings, please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. We use '%s' for '%s/%.1f/no DST' instead., tzid, tzi-StandardName, (float) ((tzi-Bias - tzi-StandardBias) / 60)); break; - case TIME_ZONE_ID_STANDARD: - tzid = timelib_timezone_id_from_abbr(tzi-DaylightName, (tzi-Bias - tzi-DaylightBias) * 60, 0); + case TIME_ZONE_ID_DAYLIGHT: + tzid = timelib_timezone_id_from_abbr(tzi-DaylightName, (tzi-Bias - tzi-DaylightBias) * 60, 1); php_error_docref(NULL TSRMLS_CC, E_STRICT, It is not safe to rely on the systems timezone settings, please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. We use '%s' for '%s/%.1f/DST' instead., tzid, tzi-StandardName, (float) ((tzi-Bias - tzi-DaylightBias) / 60)); break; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/standard/tests/array bug30833.phpt
tony2001Wed Oct 5 05:00:16 2005 EDT Modified files: /php-src/ext/standard/tests/array bug30833.phpt Log: fix test http://cvs.php.net/diff.php/php-src/ext/standard/tests/array/bug30833.phpt?r1=1.2r2=1.3ty=u Index: php-src/ext/standard/tests/array/bug30833.phpt diff -u php-src/ext/standard/tests/array/bug30833.phpt:1.2 php-src/ext/standard/tests/array/bug30833.phpt:1.3 --- php-src/ext/standard/tests/array/bug30833.phpt:1.2 Mon Aug 15 10:37:55 2005 +++ php-src/ext/standard/tests/array/bug30833.phpt Wed Oct 5 05:00:14 2005 @@ -23,7 +23,7 @@ array(2) { [abc]= int(1) - [0]= + []= int(1) } array(2) { @@ -43,7 +43,7 @@ array(2) { [uabc]= int(1) - [0]= + [u]= int(1) } array(2) { -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_0) /ext/standard/tests/array bug30833.phpt
tony2001Wed Oct 5 05:00:55 2005 EDT Modified files: (Branch: PHP_5_0) /php-src/ext/standard/tests/array bug30833.phpt Log: MFH: fix test http://cvs.php.net/diff.php/php-src/ext/standard/tests/array/bug30833.phpt?r1=1.1.2.2r2=1.1.2.3ty=u Index: php-src/ext/standard/tests/array/bug30833.phpt diff -u php-src/ext/standard/tests/array/bug30833.phpt:1.1.2.2 php-src/ext/standard/tests/array/bug30833.phpt:1.1.2.3 --- php-src/ext/standard/tests/array/bug30833.phpt:1.1.2.2 Wed Apr 13 04:23:59 2005 +++ php-src/ext/standard/tests/array/bug30833.phpt Wed Oct 5 05:00:55 2005 @@ -23,7 +23,7 @@ array(2) { [abc]= int(1) - [0]= + []= int(1) } array(2) { -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] cvs: php-src /ext/standard array.c
On 05.10.2005 10:57, Dmitry Stogov wrote: Tony, Please look into ext/standard/tests/array/bug30833.phpt It is failed after your patch. Probably test file itself should be fixed. Fixed. Thanks for noticing it =) -- Wbr, Antony Dovgal -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_1) /ext/date php_date.c
derick Wed Oct 5 07:06:57 2005 EDT Modified files: (Branch: PHP_5_1) /php-src/ext/date php_date.c Log: - Implement correct Windows timezone guessing. http://cvs.php.net/diff.php/php-src/ext/date/php_date.c?r1=1.43.2.11r2=1.43.2.12ty=u Index: php-src/ext/date/php_date.c diff -u php-src/ext/date/php_date.c:1.43.2.11 php-src/ext/date/php_date.c:1.43.2.12 --- php-src/ext/date/php_date.c:1.43.2.11 Wed Oct 5 04:23:39 2005 +++ php-src/ext/date/php_date.c Wed Oct 5 07:06:56 2005 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: php_date.c,v 1.43.2.11 2005/10/05 08:23:39 derick Exp $ */ +/* $Id: php_date.c,v 1.43.2.12 2005/10/05 11:06:56 derick Exp $ */ #include php.h #include php_streams.h @@ -278,7 +278,7 @@ /* }}} */ /* {{{ Timezone Cache functions */ -static timelib_tzinfo *php_date_parse_tzfile(char *tzname, timelib_tzdb *tzdb TSRMLS_CC) +static timelib_tzinfo *php_date_parse_tzfile(char *tzname, timelib_tzdb *tzdb TSRMLS_DC) { timelib_tzinfo *tzi, **ptzi; @@ -303,7 +303,7 @@ } /* Check environment variable */ env = getenv(TZ); - if (env *env strlen(env)) { + if (env *env) { return env; } /* Check config setting for default timezone */ @@ -330,6 +330,7 @@ #endif #ifdef PHP_WIN32 { + char *tzid; TIME_ZONE_INFORMATION tzi; switch (GetTimeZoneInformation(tzi)) @@ -337,23 +338,25 @@ case TIME_ZONE_ID_UNKNOWN: /* we have no clue what it is, return UTC */ php_error_docref(NULL TSRMLS_CC, E_STRICT, It is not safe to rely on the systems timezone settings, please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. We use 'UTC' instead.); - return UTC; + break; case TIME_ZONE_ID_STANDARD: - tzid = timelib_timezone_id_from_abbr(tzi-StandardName, (tzi-Bias - tzi-StandardBias) * 60, 0); - php_error_docref(NULL TSRMLS_CC, E_STRICT, It is not safe to rely on the systems timezone settings, please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. We use '%s' for '%s/%.1f/no DST' instead., tzid, tzi-StandardName, (float) ((tzi-Bias - tzi-StandardBias) / 60)); + tzid = timelib_timezone_id_from_abbr(, (tzi.Bias + tzi.StandardBias) * -60, 0); + if (! tzid) { + tzid = UTC; + } + php_error_docref(NULL TSRMLS_CC, E_STRICT, It is not safe to rely on the systems timezone settings, please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. We use '%s' for '%.1f/no DST' instead., tzid, (float) ((tzi.Bias + tzi.StandardBias) / -60)); break; case TIME_ZONE_ID_DAYLIGHT: - tzid = timelib_timezone_id_from_abbr(tzi-DaylightName, (tzi-Bias - tzi-DaylightBias) * 60, 1); - php_error_docref(NULL TSRMLS_CC, E_STRICT, It is not safe to rely on the systems timezone settings, please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. We use '%s' for '%s/%.1f/DST' instead., tzid, tzi-StandardName, (float) ((tzi-Bias - tzi-DaylightBias) / 60)); + tzid = timelib_timezone_id_from_abbr(, (tzi.Bias + tzi.DaylightBias) * -60, 1); + if (! tzid) { + tzid = UTC; + } + php_error_docref(NULL TSRMLS_CC, E_STRICT, It is not safe to rely on the systems timezone settings, please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. We use '%s' for '%.1f/DST' instead., tzid, (float) ((tzi.Bias + tzi.DaylightBias) / -60)); break; } - - php_error_docref(NULL TSRMLS_CC, E_STRICT, Extra Debug Info: bias: %d, standard bias: %d, daylight bias: %d, s. name: %s, d. name: %s, - tzi-Bias, tzi-StandardBias, tzi-DaylightBias, tzi-StandardName, tzi-DaylightName); - return tzid; } #endif /* Fallback to UTC */ @@ -366,10 +369,10 @@ timelib_tzinfo *tzi; tz = guess_timezone(TSRMLS_C); - tzi = php_date_parse_tzfile(tz, DATE_TIMEZONEDB); + tzi = php_date_parse_tzfile(tz, DATE_TIMEZONEDB TSRMLS_CC); if (! tzi) {
[PHP-CVS] cvs: php-src /ext/standard string.c
rolland Wed Oct 5 08:16:03 2005 EDT Modified files: /php-src/ext/standard string.c Log: - strip_tags(): some fixes, still AWiP http://cvs.php.net/diff.php/php-src/ext/standard/string.c?r1=1.492r2=1.493ty=u Index: php-src/ext/standard/string.c diff -u php-src/ext/standard/string.c:1.492 php-src/ext/standard/string.c:1.493 --- php-src/ext/standard/string.c:1.492 Tue Oct 4 02:33:10 2005 +++ php-src/ext/standard/string.c Wed Oct 5 08:16:02 2005 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: string.c,v 1.492 2005/10/04 06:33:10 dmitry Exp $ */ +/* $Id: string.c,v 1.493 2005/10/05 12:16:02 rolland Exp $ */ /* Synced with php 3.0 revision 1.193 1999-06-16 [ssb] */ @@ -4803,8 +4803,8 @@ Strips HTML and PHP tags from a string */ PHP_FUNCTION(strip_tags) { - void *str, *allow=NULL; - int32_t str_len, allow_len; + void *str, *allow = NULL; + int32_t str_len, allow_len = 0; zend_uchar str_type, allow_type; void *buf; int32_t retval_len; @@ -4982,7 +4982,8 @@ int php_u_tag_find(UChar *tag, int32_t len, UChar *set, int32_t set_len) { int32_t idx = 0; - UChar32 ch, *norm, *n; + UChar32 ch; + UChar *norm, *n; int state = 0, done = 0; if (!len) { @@ -5018,9 +5019,9 @@ } } *(n++) = ''; - *n = '\0'; + *n = 0; - if (u_strFindFirst(tag, len, set, set_len) != NULL) { + if (u_strFindFirst(set, set_len, norm, n-norm) != NULL) { done = 1; } else { done = 0; @@ -5121,7 +5122,7 @@ buf = eustrndup(rbuf, len); rp = rbuf; - if (allow) { + if (allow_len != 0) { php_u_strtolower(allow, allow_len, UG(default_locale)); tbuf = eumalloc(PHP_TAG_BUF_SIZE+1); tp = tbuf; @@ -5147,7 +5148,7 @@ if (state == 0) { last = 0x3C; state = 1; - if (allow) { + if (allow_len) { tp = ((tp-tbuf) = UBYTES(PHP_TAG_BUF_SIZE) ? tbuf: tp); *(tp++) = ch; } @@ -5162,7 +5163,7 @@ last = 0x28; br++; } - } else if (allow state == 1) { + } else if (allow_len state == 1) { tp = ((tp-tbuf) = UBYTES(PHP_TAG_BUF_SIZE) ? tbuf: tp); *(tp++) = ch; } else if (state == 0) { @@ -5176,7 +5177,7 @@ last = ch; br--; } - } else if (allow state == 1) { + } else if (allow_len state == 1) { tp = ((tp-tbuf) = UBYTES(PHP_TAG_BUF_SIZE) ? tbuf: tp); *(tp++) = ch; } else if (state == 0) { @@ -5194,7 +5195,7 @@ case 1: /* HTML/XML */ last = ch; state = 0; - if (allow) { + if (allow_len) { tp = ((tp-tbuf) = UBYTES(PHP_TAG_BUF_SIZE) ? tbuf: tp); *(tp++) = ch; *(tp) = 0; @@ -5241,7 +5242,7 @@ } } else if (state == 0) { *(rp++) = ch; - } else if (allow state == 1) { + } else if (allow_len state == 1) { tp = ((tp-tbuf) = UBYTES(PHP_TAG_BUF_SIZE) ? tbuf: tp); *(tp++) = ch; } @@ -5254,10 +5255,10 @@ last = ch; } else { if (state == 0) { - (*rp++) = 0x21; - } else if (allow state == 1) { - tp = ((tp-tbuf) = PHP_TAG_BUF_SIZE ? tbuf: tp); - *(tp++) = 0x21; + *(rp++) = ch; + } else if (allow_len state == 1) { + tp = ((tp-tbuf) = UBYTES(PHP_TAG_BUF_SIZE) ? tbuf: tp); + *(tp++) = ch; } } break; @@ -5310,7 +5311,7 @@ reg_u_char:
[PHP-CVS] cvs: php-src(PHP_5_1) /ext/pdo pdo.c
derick Wed Oct 5 09:51:49 2005 EDT Modified files: (Branch: PHP_5_1) /php-src/ext/pdopdo.c Log: - Committing some changes that make PDO+SPL not crash anymore. These are done by Marcus. and I'm committing them in order to actually use PHP 5.1 without segfaulting when apache starts. This is not necessary the best solution. http://cvs.php.net/diff.php/php-src/ext/pdo/pdo.c?r1=1.57.2.8r2=1.57.2.9ty=u Index: php-src/ext/pdo/pdo.c diff -u php-src/ext/pdo/pdo.c:1.57.2.8 php-src/ext/pdo/pdo.c:1.57.2.9 --- php-src/ext/pdo/pdo.c:1.57.2.8 Sun Oct 2 16:38:18 2005 +++ php-src/ext/pdo/pdo.c Wed Oct 5 09:51:46 2005 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: pdo.c,v 1.57.2.8 2005/10/02 20:38:18 helly Exp $ */ +/* $Id: pdo.c,v 1.57.2.9 2005/10/05 13:51:46 derick Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -33,9 +33,7 @@ #include php_pdo_int.h #include zend_exceptions.h -#if defined(HAVE_SPL) ((PHP_MAJOR_VERSION 5) || (PHP_MAJOR_VERSION == 5 PHP_MINOR_VERSION = 1)) -extern PHPAPI zend_class_entry *spl_ce_RuntimeException; -#endif +static zend_class_entry *spl_ce_RuntimeException; ZEND_DECLARE_MODULE_GLOBALS(pdo) @@ -64,7 +62,16 @@ { #if can_handle_soft_dependency_on_SPL defined(HAVE_SPL) ((PHP_MAJOR_VERSION 5) || (PHP_MAJOR_VERSION == 5 PHP_MINOR_VERSION = 1)) if (!root) { - return spl_ce_RuntimeException; + if (!spl_ce_RuntimeException) { + zend_class_entry **pce; + + if (zend_hash_find(CG(class_table), runtimeexception, sizeof(RuntimeException), (void **) pce) == SUCCESS) { + spl_ce_RuntimeException = *pce; + return *pce; + } + } else { + return spl_ce_RuntimeException; + } } #endif #if (PHP_MAJOR_VERSION 6) @@ -295,7 +302,9 @@ /* {{{ PHP_MINIT_FUNCTION */ PHP_MINIT_FUNCTION(pdo) { - zend_class_entry ce; + zend_class_entry ce, *pce; + + spl_ce_RuntimeException = NULL; ZEND_INIT_MODULE_GLOBALS(pdo, php_pdo_init_globals, NULL); REGISTER_INI_ENTRIES(); @@ -310,11 +319,9 @@ PDO persistent database, module_number); INIT_CLASS_ENTRY(ce, PDOException, NULL); -#if can_handle_soft_dependency_on_SPL defined(HAVE_SPL) ((PHP_MAJOR_VERSION 5) || (PHP_MAJOR_VERSION == 5 PHP_MINOR_VERSION = 1)) - pdo_exception_ce = zend_register_internal_class_ex(ce, spl_ce_RuntimeException, NULL TSRMLS_CC); -#else - pdo_exception_ce = zend_register_internal_class_ex(ce, zend_exception_get_default(), NULL TSRMLS_CC); -#endif + + pdo_exception_ce = zend_register_internal_class_ex(ce, php_pdo_get_exception_base(0 TSRMLS_CC), NULL TSRMLS_CC); + zend_declare_property_null(pdo_exception_ce, errorInfo, sizeof(errorInfo)-1, ZEND_ACC_PUBLIC TSRMLS_CC); pdo_dbh_init(TSRMLS_C); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/curl interface.c
iliaa Wed Oct 5 10:32:25 2005 EDT Modified files: /php-src/ext/curl interface.c Log: Missing safe_mode/open_basedir checks for file uploads. http://cvs.php.net/diff.php/php-src/ext/curl/interface.c?r1=1.63r2=1.64ty=u Index: php-src/ext/curl/interface.c diff -u php-src/ext/curl/interface.c:1.63 php-src/ext/curl/interface.c:1.64 --- php-src/ext/curl/interface.c:1.63 Tue Aug 9 10:14:55 2005 +++ php-src/ext/curl/interface.cWed Oct 5 10:32:19 2005 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: interface.c,v 1.63 2005/08/09 14:14:55 iliaa Exp $ */ +/* $Id: interface.c,v 1.64 2005/10/05 14:32:19 iliaa Exp $ */ #define ZEND_INCLUDE_FULL_WINDOWS_HEADERS @@ -1152,10 +1152,15 @@ * must be explicitly cast to long in curl_formadd * use since curl needs a long not an int. */ if (*postval == '@') { + ++postval; + /* safe_mode / open_basedir check */ + if (php_check_open_basedir(postval TSRMLS_CC) || (PG(safe_mode) !php_checkuid(postval, rb+, CHECKUID_CHECK_MODE_PARAM))) { + RETURN_FALSE; + } error = curl_formadd(first, last, CURLFORM_COPYNAME, string_key, CURLFORM_NAMELENGTH, (long)string_key_len - 1, - CURLFORM_FILE, ++postval, + CURLFORM_FILE, postval, CURLFORM_END); } else { error = curl_formadd(first, last, -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_0) /ext/curl interface.c
iliaa Wed Oct 5 10:32:57 2005 EDT Modified files: (Branch: PHP_5_0) /php-src/ext/curl interface.c Log: MFH: Missing safe_mode/open_basedir checks for file uploads. http://cvs.php.net/diff.php/php-src/ext/curl/interface.c?r1=1.46.2.8r2=1.46.2.9ty=u Index: php-src/ext/curl/interface.c diff -u php-src/ext/curl/interface.c:1.46.2.8 php-src/ext/curl/interface.c:1.46.2.9 --- php-src/ext/curl/interface.c:1.46.2.8 Thu Jun 2 17:04:43 2005 +++ php-src/ext/curl/interface.cWed Oct 5 10:32:57 2005 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: interface.c,v 1.46.2.8 2005/06/02 21:04:43 tony2001 Exp $ */ +/* $Id: interface.c,v 1.46.2.9 2005/10/05 14:32:57 iliaa Exp $ */ #define ZEND_INCLUDE_FULL_WINDOWS_HEADERS @@ -1128,10 +1128,15 @@ * must be explicitly cast to long in curl_formadd * use since curl needs a long not an int. */ if (*postval == '@') { + ++postval; + /* safe_mode / open_basedir check */ + if (php_check_open_basedir(postval TSRMLS_CC) || (PG(safe_mode) !php_checkuid(postval, rb+, CHECKUID_CHECK_MODE_PARAM))) { + RETURN_FALSE; + } error = curl_formadd(first, last, CURLFORM_COPYNAME, string_key, CURLFORM_NAMELENGTH, (long)string_key_len - 1, - CURLFORM_FILE, ++postval, + CURLFORM_FILE, postval, CURLFORM_END); } else { error = curl_formadd(first, last, -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_4_4) / NEWS /ext/curl curl.c
iliaa Wed Oct 5 10:34:41 2005 EDT Modified files: (Branch: PHP_4_4) /php-src/ext/curl curl.c /php-srcNEWS Log: MFH: Missing safe_mode/open_basedir checks for file uploads. http://cvs.php.net/diff.php/php-src/ext/curl/curl.c?r1=1.124.2.30r2=1.124.2.30.2.1ty=u Index: php-src/ext/curl/curl.c diff -u php-src/ext/curl/curl.c:1.124.2.30 php-src/ext/curl/curl.c:1.124.2.30.2.1 --- php-src/ext/curl/curl.c:1.124.2.30 Thu Jun 2 17:05:06 2005 +++ php-src/ext/curl/curl.c Wed Oct 5 10:34:36 2005 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: curl.c,v 1.124.2.30 2005/06/02 21:05:06 tony2001 Exp $ */ +/* $Id: curl.c,v 1.124.2.30.2.1 2005/10/05 14:34:36 iliaa Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -992,10 +992,15 @@ postval = Z_STRVAL_PP(current); if (*postval == '@') { + ++postval; + /* safe_mode / open_basedir check */ + if (php_check_open_basedir(postval TSRMLS_CC) || (PG(safe_mode) !php_checkuid(postval, rb+, CHECKUID_CHECK_MODE_PARAM))) { + RETURN_FALSE; + } error = curl_formadd(first, last, CURLFORM_COPYNAME, string_key, CURLFORM_NAMELENGTH, (long)string_key_len - 1, - CURLFORM_FILE, ++postval, + CURLFORM_FILE, postval, CURLFORM_END); } else { http://cvs.php.net/diff.php/php-src/NEWS?r1=1.1247.2.920.2.46r2=1.1247.2.920.2.47ty=u Index: php-src/NEWS diff -u php-src/NEWS:1.1247.2.920.2.46 php-src/NEWS:1.1247.2.920.2.47 --- php-src/NEWS:1.1247.2.920.2.46 Tue Oct 4 20:50:13 2005 +++ php-src/NEWSWed Oct 5 10:34:38 2005 @@ -1,6 +1,7 @@ PHP 4 NEWS ||| ?? ??? 2005, Version 4.4.1 +- Added missing safe_mode/open_basedir checks for file uploads. (Ilia) - Fixed possible INI setting leak via virtual() in Apache 2 sapi. (Ilia) - Fixed possible crash and/or memory corruption in import_request_variables(). (Ilia) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_1) / NEWS /ext/curl interface.c
iliaa Wed Oct 5 10:35:31 2005 EDT Modified files: (Branch: PHP_5_1) /php-src/ext/curl interface.c /php-srcNEWS Log: MFH: Missing safe_mode/open_basedir checks for file uploads. http://cvs.php.net/diff.php/php-src/ext/curl/interface.c?r1=1.62r2=1.62.2.1ty=u Index: php-src/ext/curl/interface.c diff -u php-src/ext/curl/interface.c:1.62 php-src/ext/curl/interface.c:1.62.2.1 --- php-src/ext/curl/interface.c:1.62 Wed Aug 3 10:06:44 2005 +++ php-src/ext/curl/interface.cWed Oct 5 10:35:30 2005 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: interface.c,v 1.62 2005/08/03 14:06:44 sniper Exp $ */ +/* $Id: interface.c,v 1.62.2.1 2005/10/05 14:35:30 iliaa Exp $ */ #define ZEND_INCLUDE_FULL_WINDOWS_HEADERS @@ -1146,10 +1146,15 @@ * must be explicitly cast to long in curl_formadd * use since curl needs a long not an int. */ if (*postval == '@') { + ++postval; + /* safe_mode / open_basedir check */ + if (php_check_open_basedir(postval TSRMLS_CC) || (PG(safe_mode) !php_checkuid(postval, rb+, CHECKUID_CHECK_MODE_PARAM))) { + RETURN_FALSE; + } error = curl_formadd(first, last, CURLFORM_COPYNAME, string_key, CURLFORM_NAMELENGTH, (long)string_key_len - 1, - CURLFORM_FILE, ++postval, + CURLFORM_FILE, postval, CURLFORM_END); } else { error = curl_formadd(first, last, http://cvs.php.net/diff.php/php-src/NEWS?r1=1.2027.2.93r2=1.2027.2.94ty=u Index: php-src/NEWS diff -u php-src/NEWS:1.2027.2.93 php-src/NEWS:1.2027.2.94 --- php-src/NEWS:1.2027.2.93Tue Oct 4 20:43:38 2005 +++ php-src/NEWSWed Oct 5 10:35:30 2005 @@ -30,6 +30,7 @@ . ext/oracle (Jani, Derick) . ext/ovrimos (Jani, Derick, Pierre) . ext/pfpro (Jani, Derick, Pierre) +- Added missing safe_mode/open_basedir checks for file uploads. (Ilia) - Fixed possible INI setting leak via virtual() in Apache 2 sapi. (Ilia) - Fixed potential GLOBALS overwrite via import_request_variables() and possible crash and/or memory corruption. (Ilia) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] cvs: php-src(PHP_5_1) /ext/pdo pdo.c
If I have --enable-pdo, this would break the build since I have --disable-spl.. :) --Jani On Wed, 5 Oct 2005, Derick Rethans wrote: derick Wed Oct 5 09:51:49 2005 EDT Modified files: (Branch: PHP_5_1) /php-src/ext/pdo pdo.c Log: - Committing some changes that make PDO+SPL not crash anymore. These are done by Marcus. and I'm committing them in order to actually use PHP 5.1 without segfaulting when apache starts. This is not necessary the best solution. http://cvs.php.net/diff.php/php-src/ext/pdo/pdo.c?r1=1.57.2.8r2=1.57.2.9ty=u Index: php-src/ext/pdo/pdo.c diff -u php-src/ext/pdo/pdo.c:1.57.2.8 php-src/ext/pdo/pdo.c:1.57.2.9 --- php-src/ext/pdo/pdo.c:1.57.2.8 Sun Oct 2 16:38:18 2005 +++ php-src/ext/pdo/pdo.c Wed Oct 5 09:51:46 2005 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: pdo.c,v 1.57.2.8 2005/10/02 20:38:18 helly Exp $ */ +/* $Id: pdo.c,v 1.57.2.9 2005/10/05 13:51:46 derick Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -33,9 +33,7 @@ #include php_pdo_int.h #include zend_exceptions.h -#if defined(HAVE_SPL) ((PHP_MAJOR_VERSION 5) || (PHP_MAJOR_VERSION == 5 PHP_MINOR_VERSION = 1)) -extern PHPAPI zend_class_entry *spl_ce_RuntimeException; -#endif +static zend_class_entry *spl_ce_RuntimeException; ZEND_DECLARE_MODULE_GLOBALS(pdo) @@ -64,7 +62,16 @@ { #if can_handle_soft_dependency_on_SPL defined(HAVE_SPL) ((PHP_MAJOR_VERSION 5) || (PHP_MAJOR_VERSION == 5 PHP_MINOR_VERSION = 1)) if (!root) { - return spl_ce_RuntimeException; + if (!spl_ce_RuntimeException) { + zend_class_entry **pce; + + if (zend_hash_find(CG(class_table), runtimeexception, sizeof(RuntimeException), (void **) pce) == SUCCESS) { + spl_ce_RuntimeException = *pce; + return *pce; + } + } else { + return spl_ce_RuntimeException; + } } #endif #if (PHP_MAJOR_VERSION 6) @@ -295,7 +302,9 @@ /* {{{ PHP_MINIT_FUNCTION */ PHP_MINIT_FUNCTION(pdo) { - zend_class_entry ce; + zend_class_entry ce, *pce; + + spl_ce_RuntimeException = NULL; ZEND_INIT_MODULE_GLOBALS(pdo, php_pdo_init_globals, NULL); REGISTER_INI_ENTRIES(); @@ -310,11 +319,9 @@ PDO persistent database, module_number); INIT_CLASS_ENTRY(ce, PDOException, NULL); -#if can_handle_soft_dependency_on_SPL defined(HAVE_SPL) ((PHP_MAJOR_VERSION 5) || (PHP_MAJOR_VERSION == 5 PHP_MINOR_VERSION = 1)) - pdo_exception_ce = zend_register_internal_class_ex(ce, spl_ce_RuntimeException, NULL TSRMLS_CC); -#else - pdo_exception_ce = zend_register_internal_class_ex(ce, zend_exception_get_default(), NULL TSRMLS_CC); -#endif + + pdo_exception_ce = zend_register_internal_class_ex(ce, php_pdo_get_exception_base(0 TSRMLS_CC), NULL TSRMLS_CC); + zend_declare_property_null(pdo_exception_ce, errorInfo, sizeof(errorInfo)-1, ZEND_ACC_PUBLIC TSRMLS_CC); pdo_dbh_init(TSRMLS_C); -- Give me your money at @ http://pecl.php.net/wishlist.php/sniper Donating money may make me happier and friendlier for a limited period! Death to all 4 letter abbreviations starting with P! -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/xmlrpc xmlrpc-epi-php.c
rrichards Wed Oct 5 12:39:38 2005 EDT Modified files: /php-src/ext/xmlrpc xmlrpc-epi-php.c Log: fix ZTS build http://cvs.php.net/diff.php/php-src/ext/xmlrpc/xmlrpc-epi-php.c?r1=1.40r2=1.41ty=u Index: php-src/ext/xmlrpc/xmlrpc-epi-php.c diff -u php-src/ext/xmlrpc/xmlrpc-epi-php.c:1.40 php-src/ext/xmlrpc/xmlrpc-epi-php.c:1.41 --- php-src/ext/xmlrpc/xmlrpc-epi-php.c:1.40Tue Oct 4 08:07:24 2005 +++ php-src/ext/xmlrpc/xmlrpc-epi-php.c Wed Oct 5 12:39:37 2005 @@ -51,7 +51,7 @@ +--+ */ -/* $Id: xmlrpc-epi-php.c,v 1.40 2005/10/04 12:07:24 tony2001 Exp $ */ +/* $Id: xmlrpc-epi-php.c,v 1.41 2005/10/05 16:39:37 rrichards Exp $ */ /** * BUGS: * @@ -478,7 +478,7 @@ } /* recursively convert php values into xmlrpc values */ -static XMLRPC_VALUE PHP_to_XMLRPC_worker (const char* key, zval* in_val, int depth) +static XMLRPC_VALUE PHP_to_XMLRPC_worker (const char* key, zval* in_val, int depth TSRMLS_DC) { XMLRPC_VALUE xReturn = NULL; if(in_val) { @@ -544,10 +544,10 @@ ht-nApplyCount++; } if (res == HASH_KEY_IS_LONG) { - XMLRPC_AddValueToVector(xReturn, PHP_to_XMLRPC_worker(0, *pIter, depth++)); + XMLRPC_AddValueToVector(xReturn, PHP_to_XMLRPC_worker(0, *pIter, depth++ TSRMLS_CC)); } else { - XMLRPC_AddValueToVector(xReturn, PHP_to_XMLRPC_worker(my_key, *pIter, depth++)); + XMLRPC_AddValueToVector(xReturn, PHP_to_XMLRPC_worker(my_key, *pIter, depth++ TSRMLS_CC)); } if (ht) { ht-nApplyCount--; @@ -566,9 +566,9 @@ return xReturn; } -static XMLRPC_VALUE PHP_to_XMLRPC(zval* root_val) +static XMLRPC_VALUE PHP_to_XMLRPC(zval* root_val TSRMLS_DC) { - return PHP_to_XMLRPC_worker(NULL, root_val, 0); + return PHP_to_XMLRPC_worker(NULL, root_val, 0 TSRMLS_CC); } /* recursively convert xmlrpc values into php values */ @@ -668,7 +668,7 @@ XMLRPC_RequestSetRequestType(xRequest, xmlrpc_request_call); } if (Z_TYPE_PP(vals) != IS_NULL) { - XMLRPC_RequestSetData(xRequest, PHP_to_XMLRPC(*vals)); + XMLRPC_RequestSetData(xRequest, PHP_to_XMLRPC(*vals TSRMLS_CC)); } outBuf = XMLRPC_REQUEST_ToXML(xRequest, 0); @@ -700,7 +700,7 @@ if( return_value_used ) { /* convert native php type to xmlrpc type */ - xOut = PHP_to_XMLRPC(*arg1); + xOut = PHP_to_XMLRPC(*arg1 TSRMLS_CC); /* generate raw xml from xmlrpc data */ outBuf = XMLRPC_VALUE_ToXML(xOut, 0); @@ -1102,7 +1102,7 @@ FREE_ZVAL(data.return_data); data.return_data = XMLRPC_to_PHP(xAnswer); } else if(data.php_executed !out.b_php_out) { - xAnswer = PHP_to_XMLRPC(data.return_data); + xAnswer = PHP_to_XMLRPC(data.return_data TSRMLS_CC); } /* should we return data as xml? */ @@ -1171,7 +1171,7 @@ server = zend_list_find(Z_LVAL_PP(handle), type); if (type == le_xmlrpc_server) { - XMLRPC_VALUE xDesc = PHP_to_XMLRPC(*desc); + XMLRPC_VALUE xDesc = PHP_to_XMLRPC(*desc TSRMLS_CC); if (xDesc) { int retval = XMLRPC_ServerAddIntrospectionData(server-server_ptr, xDesc); XMLRPC_CleanupValue(xDesc); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_1) /ext/xmlrpc xmlrpc-epi-php.c
rrichards Wed Oct 5 12:40:22 2005 EDT Modified files: (Branch: PHP_5_1) /php-src/ext/xmlrpc xmlrpc-epi-php.c Log: MFH: fix ZTS build http://cvs.php.net/diff.php/php-src/ext/xmlrpc/xmlrpc-epi-php.c?r1=1.39.2.1r2=1.39.2.2ty=u Index: php-src/ext/xmlrpc/xmlrpc-epi-php.c diff -u php-src/ext/xmlrpc/xmlrpc-epi-php.c:1.39.2.1 php-src/ext/xmlrpc/xmlrpc-epi-php.c:1.39.2.2 --- php-src/ext/xmlrpc/xmlrpc-epi-php.c:1.39.2.1Tue Oct 4 07:18:02 2005 +++ php-src/ext/xmlrpc/xmlrpc-epi-php.c Wed Oct 5 12:40:21 2005 @@ -51,7 +51,7 @@ +--+ */ -/* $Id: xmlrpc-epi-php.c,v 1.39.2.1 2005/10/04 11:18:02 tony2001 Exp $ */ +/* $Id: xmlrpc-epi-php.c,v 1.39.2.2 2005/10/05 16:40:21 rrichards Exp $ */ /** * BUGS: * @@ -478,7 +478,7 @@ } /* recursively convert php values into xmlrpc values */ -static XMLRPC_VALUE PHP_to_XMLRPC_worker (const char* key, zval* in_val, int depth) +static XMLRPC_VALUE PHP_to_XMLRPC_worker (const char* key, zval* in_val, int depth TSRMLS_DC) { XMLRPC_VALUE xReturn = NULL; if(in_val) { @@ -545,10 +545,10 @@ ht-nApplyCount++; } if (res == HASH_KEY_IS_LONG) { - XMLRPC_AddValueToVector(xReturn, PHP_to_XMLRPC_worker(0, *pIter, depth++)); + XMLRPC_AddValueToVector(xReturn, PHP_to_XMLRPC_worker(0, *pIter, depth++ TSRMLS_CC)); } else { - XMLRPC_AddValueToVector(xReturn, PHP_to_XMLRPC_worker(my_key, *pIter, depth++)); + XMLRPC_AddValueToVector(xReturn, PHP_to_XMLRPC_worker(my_key, *pIter, depth++ TSRMLS_CC)); } if (ht) { ht-nApplyCount--; @@ -567,9 +567,9 @@ return xReturn; } -static XMLRPC_VALUE PHP_to_XMLRPC(zval* root_val) +static XMLRPC_VALUE PHP_to_XMLRPC(zval* root_val TSRMLS_DC) { - return PHP_to_XMLRPC_worker(NULL, root_val, 0); + return PHP_to_XMLRPC_worker(NULL, root_val, 0 TSRMLS_CC); } /* recursively convert xmlrpc values into php values */ @@ -669,7 +669,7 @@ XMLRPC_RequestSetRequestType(xRequest, xmlrpc_request_call); } if (Z_TYPE_PP(vals) != IS_NULL) { - XMLRPC_RequestSetData(xRequest, PHP_to_XMLRPC(*vals)); + XMLRPC_RequestSetData(xRequest, PHP_to_XMLRPC(*vals TSRMLS_CC)); } outBuf = XMLRPC_REQUEST_ToXML(xRequest, 0); @@ -701,7 +701,7 @@ if( return_value_used ) { /* convert native php type to xmlrpc type */ - xOut = PHP_to_XMLRPC(*arg1); + xOut = PHP_to_XMLRPC(*arg1 TSRMLS_CC); /* generate raw xml from xmlrpc data */ outBuf = XMLRPC_VALUE_ToXML(xOut, 0); @@ -1103,7 +1103,7 @@ FREE_ZVAL(data.return_data); data.return_data = XMLRPC_to_PHP(xAnswer); } else if(data.php_executed !out.b_php_out) { - xAnswer = PHP_to_XMLRPC(data.return_data); + xAnswer = PHP_to_XMLRPC(data.return_data TSRMLS_CC); } /* should we return data as xml? */ @@ -1172,7 +1172,7 @@ server = zend_list_find(Z_LVAL_PP(handle), type); if (type == le_xmlrpc_server) { - XMLRPC_VALUE xDesc = PHP_to_XMLRPC(*desc); + XMLRPC_VALUE xDesc = PHP_to_XMLRPC(*desc TSRMLS_CC); if (xDesc) { int retval = XMLRPC_ServerAddIntrospectionData(server-server_ptr, xDesc); XMLRPC_CleanupValue(xDesc); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_0) /ext/xmlrpc xmlrpc-epi-php.c
rrichards Wed Oct 5 12:40:53 2005 EDT Modified files: (Branch: PHP_5_0) /php-src/ext/xmlrpc xmlrpc-epi-php.c Log: fix ZTS build http://cvs.php.net/diff.php/php-src/ext/xmlrpc/xmlrpc-epi-php.c?r1=1.37.2.1r2=1.37.2.2ty=u Index: php-src/ext/xmlrpc/xmlrpc-epi-php.c diff -u php-src/ext/xmlrpc/xmlrpc-epi-php.c:1.37.2.1 php-src/ext/xmlrpc/xmlrpc-epi-php.c:1.37.2.2 --- php-src/ext/xmlrpc/xmlrpc-epi-php.c:1.37.2.1Tue Oct 4 07:19:11 2005 +++ php-src/ext/xmlrpc/xmlrpc-epi-php.c Wed Oct 5 12:40:53 2005 @@ -51,7 +51,7 @@ +--+ */ -/* $Id: xmlrpc-epi-php.c,v 1.37.2.1 2005/10/04 11:19:11 tony2001 Exp $ */ +/* $Id: xmlrpc-epi-php.c,v 1.37.2.2 2005/10/05 16:40:53 rrichards Exp $ */ /** * BUGS: * @@ -478,7 +478,7 @@ } /* recursively convert php values into xmlrpc values */ -static XMLRPC_VALUE PHP_to_XMLRPC_worker (const char* key, zval* in_val, int depth) +static XMLRPC_VALUE PHP_to_XMLRPC_worker (const char* key, zval* in_val, int depth TSRMLS_DC) { XMLRPC_VALUE xReturn = NULL; if(in_val) { @@ -545,10 +545,10 @@ ht-nApplyCount++; } if (res == HASH_KEY_IS_LONG) { - XMLRPC_AddValueToVector(xReturn, PHP_to_XMLRPC_worker(0, *pIter, depth++)); + XMLRPC_AddValueToVector(xReturn, PHP_to_XMLRPC_worker(0, *pIter, depth++ TSRMLS_CC)); } else { - XMLRPC_AddValueToVector(xReturn, PHP_to_XMLRPC_worker(my_key, *pIter, depth++)); + XMLRPC_AddValueToVector(xReturn, PHP_to_XMLRPC_worker(my_key, *pIter, depth++ TSRMLS_CC)); } if (ht) { ht-nApplyCount--; @@ -567,9 +567,9 @@ return xReturn; } -static XMLRPC_VALUE PHP_to_XMLRPC(zval* root_val) +static XMLRPC_VALUE PHP_to_XMLRPC(zval* root_val TSRMLS_DC) { - return PHP_to_XMLRPC_worker(NULL, root_val, 0); + return PHP_to_XMLRPC_worker(NULL, root_val, 0 TSRMLS_CC); } /* recursively convert xmlrpc values into php values */ @@ -669,7 +669,7 @@ XMLRPC_RequestSetRequestType(xRequest, xmlrpc_request_call); } if (Z_TYPE_PP(vals) != IS_NULL) { - XMLRPC_RequestSetData(xRequest, PHP_to_XMLRPC(*vals)); + XMLRPC_RequestSetData(xRequest, PHP_to_XMLRPC(*vals TSRMLS_CC)); } outBuf = XMLRPC_REQUEST_ToXML(xRequest, 0); @@ -697,7 +697,7 @@ if( return_value_used ) { /* convert native php type to xmlrpc type */ - xOut = PHP_to_XMLRPC(*arg1); + xOut = PHP_to_XMLRPC(*arg1 TSRMLS_CC); /* generate raw xml from xmlrpc data */ outBuf = XMLRPC_VALUE_ToXML(xOut, 0); @@ -1099,7 +1099,7 @@ FREE_ZVAL(data.return_data); data.return_data = XMLRPC_to_PHP(xAnswer); } else if(data.php_executed !out.b_php_out) { - xAnswer = PHP_to_XMLRPC(data.return_data); + xAnswer = PHP_to_XMLRPC(data.return_data TSRMLS_CC); } /* should we return data as xml? */ @@ -1168,7 +1168,7 @@ server = zend_list_find(Z_LVAL_PP(handle), type); if (type == le_xmlrpc_server) { - XMLRPC_VALUE xDesc = PHP_to_XMLRPC(*desc); + XMLRPC_VALUE xDesc = PHP_to_XMLRPC(*desc TSRMLS_CC); if (xDesc) { int retval = XMLRPC_ServerAddIntrospectionData(server-server_ptr, xDesc); XMLRPC_CleanupValue(xDesc); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_4_4) /ext/xmlrpc xmlrpc-epi-php.c
rrichards Wed Oct 5 12:41:18 2005 EDT Modified files: (Branch: PHP_4_4) /php-src/ext/xmlrpc xmlrpc-epi-php.c Log: fix ZTS build http://cvs.php.net/diff.php/php-src/ext/xmlrpc/xmlrpc-epi-php.c?r1=1.24.2.4.4.1r2=1.24.2.4.4.2ty=u Index: php-src/ext/xmlrpc/xmlrpc-epi-php.c diff -u php-src/ext/xmlrpc/xmlrpc-epi-php.c:1.24.2.4.4.1 php-src/ext/xmlrpc/xmlrpc-epi-php.c:1.24.2.4.4.2 --- php-src/ext/xmlrpc/xmlrpc-epi-php.c:1.24.2.4.4.1Tue Oct 4 07:19:56 2005 +++ php-src/ext/xmlrpc/xmlrpc-epi-php.c Wed Oct 5 12:41:18 2005 @@ -51,7 +51,7 @@ +--+ */ -/* $Id: xmlrpc-epi-php.c,v 1.24.2.4.4.1 2005/10/04 11:19:56 tony2001 Exp $ */ +/* $Id: xmlrpc-epi-php.c,v 1.24.2.4.4.2 2005/10/05 16:41:18 rrichards Exp $ */ /** * BUGS: * @@ -482,7 +482,7 @@ } /* recursively convert php values into xmlrpc values */ -static XMLRPC_VALUE PHP_to_XMLRPC_worker (const char* key, zval* in_val, int depth) +static XMLRPC_VALUE PHP_to_XMLRPC_worker (const char* key, zval* in_val, int depth TSRMLS_DC) { XMLRPC_VALUE xReturn = NULL; if(in_val) { @@ -549,10 +549,10 @@ ht-nApplyCount++; } if (res == HASH_KEY_IS_LONG) { - XMLRPC_AddValueToVector(xReturn, PHP_to_XMLRPC_worker(0, *pIter, depth++)); + XMLRPC_AddValueToVector(xReturn, PHP_to_XMLRPC_worker(0, *pIter, depth++ TSRMLS_CC)); } else { - XMLRPC_AddValueToVector(xReturn, PHP_to_XMLRPC_worker(my_key, *pIter, depth++)); + XMLRPC_AddValueToVector(xReturn, PHP_to_XMLRPC_worker(my_key, *pIter, depth++ TSRMLS_CC)); } if (ht) { ht-nApplyCount--; @@ -571,9 +571,9 @@ return xReturn; } -static XMLRPC_VALUE PHP_to_XMLRPC(zval* root_val) +static XMLRPC_VALUE PHP_to_XMLRPC(zval* root_val TSRMLS_DC) { - return PHP_to_XMLRPC_worker(NULL, root_val, 0); + return PHP_to_XMLRPC_worker(NULL, root_val, 0 TSRMLS_CC); } /* recursively convert xmlrpc values into php values */ @@ -675,7 +675,7 @@ XMLRPC_RequestSetRequestType(xRequest, xmlrpc_request_call); } if(Z_TYPE_P(vals) != IS_NULL) { - XMLRPC_RequestSetData(xRequest, PHP_to_XMLRPC(vals)); + XMLRPC_RequestSetData(xRequest, PHP_to_XMLRPC(vals TSRMLS_CC)); } outBuf = XMLRPC_REQUEST_ToXML(xRequest, 0); @@ -704,7 +704,7 @@ if( return_value_used ) { /* convert native php type to xmlrpc type */ - xOut = PHP_to_XMLRPC(arg1); + xOut = PHP_to_XMLRPC(arg1 TSRMLS_CC); /* generate raw xml from xmlrpc data */ outBuf = XMLRPC_VALUE_ToXML(xOut, 0); @@ -1123,7 +1123,7 @@ } else if(data.php_executed) { if(!out.b_php_out) { - xAnswer = PHP_to_XMLRPC(data.return_data); + xAnswer = PHP_to_XMLRPC(data.return_data TSRMLS_CC); } } @@ -1195,7 +1195,7 @@ server = zend_list_find(Z_LVAL_P(handle), type); if (type == le_xmlrpc_server) { - XMLRPC_VALUE xDesc = PHP_to_XMLRPC(desc); + XMLRPC_VALUE xDesc = PHP_to_XMLRPC(desc TSRMLS_CC); if (xDesc) { int retval = XMLRPC_ServerAddIntrospectionData(server-server_ptr, xDesc); XMLRPC_CleanupValue(xDesc); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /main/streams streams.c
tony2001Wed Oct 5 13:18:09 2005 EDT Modified files: /php-src/main/streams streams.c Log: fix bugs #34743 #34118 (fseek/fread unicode related problems in HEAD) patch by Alex http://cvs.php.net/diff.php/php-src/main/streams/streams.c?r1=1.87r2=1.88ty=u Index: php-src/main/streams/streams.c diff -u php-src/main/streams/streams.c:1.87 php-src/main/streams/streams.c:1.88 --- php-src/main/streams/streams.c:1.87 Mon Aug 22 10:48:25 2005 +++ php-src/main/streams/streams.c Wed Oct 5 13:18:06 2005 @@ -19,7 +19,7 @@ +--+ */ -/* $Id: streams.c,v 1.87 2005/08/22 14:48:25 dmitry Exp $ */ +/* $Id: streams.c,v 1.88 2005/10/05 17:18:06 tony2001 Exp $ */ #define _GNU_SOURCE #include php.h @@ -855,6 +855,8 @@ *pnum_chars = num_chars; *pis_unicode = is_unicode; + stream-position += num_bytes; + if (num_chars == 0 grow_mode) { efree(buf); buf = NULL; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/date php_date.c php_date.h
derick Wed Oct 5 14:38:31 2005 EDT Modified files: /php-src/ext/date php_date.c php_date.h Log: - MF51: Windows Timezone guessing code http://cvs.php.net/diff.php/php-src/ext/date/php_date.c?r1=1.57r2=1.58ty=u Index: php-src/ext/date/php_date.c diff -u php-src/ext/date/php_date.c:1.57 php-src/ext/date/php_date.c:1.58 --- php-src/ext/date/php_date.c:1.57Mon Oct 3 19:43:43 2005 +++ php-src/ext/date/php_date.c Wed Oct 5 14:38:30 2005 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: php_date.c,v 1.57 2005/10/03 23:43:43 tony2001 Exp $ */ +/* $Id: php_date.c,v 1.58 2005/10/05 18:38:30 derick Exp $ */ #include php.h #include php_streams.h @@ -187,6 +187,14 @@ } /* }}} */ + +static void _php_date_tzinfo_dtor(void *tzinfo) +{ + timelib_tzinfo **tzi = (timelib_tzinfo **)tzinfo; + + timelib_tzinfo_dtor(*tzi); +} + /* {{{ PHP_RINIT_FUNCTION */ PHP_RINIT_FUNCTION(date) { @@ -194,6 +202,7 @@ efree(DATEG(timezone)); } DATEG(timezone) = NULL; + zend_hash_init(DATEG(tzcache), 4, NULL, _php_date_tzinfo_dtor, 0); return SUCCESS; } @@ -206,6 +215,7 @@ efree(DATEG(timezone)); } DATEG(timezone) = NULL; + zend_hash_destroy(DATEG(tzcache)); return SUCCESS; } @@ -269,6 +279,20 @@ } /* }}} */ +/* {{{ Timezone Cache functions */ +static timelib_tzinfo *php_date_parse_tzfile(char *tzname, timelib_tzdb *tzdb TSRMLS_DC) +{ + timelib_tzinfo *tzi, **ptzi; + + if (zend_hash_find(DATEG(tzcache), tzname, strlen(tzname) + 1, (void **) ptzi) == SUCCESS) { + return *ptzi; + } + + tzi = timelib_parse_tzfile(tzname, tzdb); + zend_hash_add(DATEG(tzcache), tzname, strlen(tzname) + 1, (void *) tzi, sizeof(timelib_tzinfo*), NULL); + return tzi; +} +/* }}} */ /* {{{ Helper functions */ static char* guess_timezone(TSRMLS_D) @@ -281,7 +305,7 @@ } /* Check environment variable */ env = getenv(TZ); - if (env *env strlen(env)) { + if (env *env) { return env; } /* Check config setting for default timezone */ @@ -306,6 +330,37 @@ return tzid; } #endif +#ifdef PHP_WIN32 + { + char *tzid; + TIME_ZONE_INFORMATION tzi; + + switch (GetTimeZoneInformation(tzi)) + { + case TIME_ZONE_ID_UNKNOWN: + /* we have no clue what it is, return UTC */ + php_error_docref(NULL TSRMLS_CC, E_STRICT, It is not safe to rely on the systems timezone settings, please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. We use 'UTC' instead.); + break; + + case TIME_ZONE_ID_STANDARD: + tzid = timelib_timezone_id_from_abbr(, (tzi.Bias + tzi.StandardBias) * -60, 0); + if (! tzid) { + tzid = UTC; + } + php_error_docref(NULL TSRMLS_CC, E_STRICT, It is not safe to rely on the systems timezone settings, please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. We use '%s' for '%.1f/no DST' instead., tzid, (float) ((tzi.Bias + tzi.StandardBias) / -60)); + break; + + case TIME_ZONE_ID_DAYLIGHT: + tzid = timelib_timezone_id_from_abbr(, (tzi.Bias + tzi.DaylightBias) * -60, 1); + if (! tzid) { + tzid = UTC; + } + php_error_docref(NULL TSRMLS_CC, E_STRICT, It is not safe to rely on the systems timezone settings, please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. We use '%s' for '%.1f/DST' instead., tzid, (float) ((tzi.Bias + tzi.DaylightBias) / -60)); + break; + + } + } +#endif /* Fallback to UTC */ return UTC; } @@ -316,10 +371,10 @@ timelib_tzinfo *tzi; tz = guess_timezone(TSRMLS_C); - tzi = timelib_parse_tzfile(tz, DATE_TIMEZONEDB); + tzi = php_date_parse_tzfile(tz, DATE_TIMEZONEDB TSRMLS_CC); if (! tzi) { php_error_docref(NULL TSRMLS_CC, E_NOTICE, Timezone setting (date.timezone) or TZ environment variable contains an unknown timezone.); - tzi = timelib_parse_tzfile(UTC, DATE_TIMEZONEDB); + tzi = php_date_parse_tzfile(UTC, DATE_TIMEZONEDB TSRMLS_CC); if (! tzi) { php_error_docref(NULL
Re: [PHP-CVS] cvs: php-src(PHP_5_1) /ext/pdo pdo.c
Hello Jani, how does this break the build? the reason for this 'workaround' is to fetch the class dynamically from the compiler classs hash rather than using the global pointer. For some reason it seems that the global pointer is not valid during PDO's MINIT in second apache 1.* startup stage. However, if you disable SPL the class is simply not available and you fallback to Exception as PDOException base just like you did before the patch. marcus Wednesday, October 5, 2005, 6:32:58 PM, you wrote: If I have --enable-pdo, this would break the build since I have --disable-spl.. :) --Jani On Wed, 5 Oct 2005, Derick Rethans wrote: derickWed Oct 5 09:51:49 2005 EDT Modified files: (Branch: PHP_5_1) /php-src/ext/pdo pdo.c Log: - Committing some changes that make PDO+SPL not crash anymore. These are done by Marcus. and I'm committing them in order to actually use PHP 5.1 without segfaulting when apache starts. This is not necessary the best solution. http://cvs.php.net/diff.php/php-src/ext/pdo/pdo.c?r1=1.57.2.8r2=1.57.2.9ty=u Index: php-src/ext/pdo/pdo.c diff -u php-src/ext/pdo/pdo.c:1.57.2.8 php-src/ext/pdo/pdo.c:1.57.2.9 --- php-src/ext/pdo/pdo.c:1.57.2.8Sun Oct 2 16:38:18 2005 +++ php-src/ext/pdo/pdo.c Wed Oct 5 09:51:46 2005 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: pdo.c,v 1.57.2.8 2005/10/02 20:38:18 helly Exp $ */ +/* $Id: pdo.c,v 1.57.2.9 2005/10/05 13:51:46 derick Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -33,9 +33,7 @@ #include php_pdo_int.h #include zend_exceptions.h -#if defined(HAVE_SPL) ((PHP_MAJOR_VERSION 5) || (PHP_MAJOR_VERSION == 5 PHP_MINOR_VERSION = 1)) -extern PHPAPI zend_class_entry *spl_ce_RuntimeException; -#endif +static zend_class_entry *spl_ce_RuntimeException; ZEND_DECLARE_MODULE_GLOBALS(pdo) @@ -64,7 +62,16 @@ { #if can_handle_soft_dependency_on_SPL defined(HAVE_SPL) ((PHP_MAJOR_VERSION 5) || (PHP_MAJOR_VERSION == 5 PHP_MINOR_VERSION = 1)) if (!root) { - return spl_ce_RuntimeException; + if (!spl_ce_RuntimeException) { + zend_class_entry **pce; + + if (zend_hash_find(CG(class_table), runtimeexception, sizeof(RuntimeException), (void **) pce) == SUCCESS) { + spl_ce_RuntimeException = *pce; + return *pce; + } + } else { + return spl_ce_RuntimeException; + } } #endif #if (PHP_MAJOR_VERSION 6) @@ -295,7 +302,9 @@ /* {{{ PHP_MINIT_FUNCTION */ PHP_MINIT_FUNCTION(pdo) { - zend_class_entry ce; + zend_class_entry ce, *pce; + + spl_ce_RuntimeException = NULL; ZEND_INIT_MODULE_GLOBALS(pdo, php_pdo_init_globals, NULL); REGISTER_INI_ENTRIES(); @@ -310,11 +319,9 @@ PDO persistent database, module_number); INIT_CLASS_ENTRY(ce, PDOException, NULL); -#if can_handle_soft_dependency_on_SPL defined(HAVE_SPL) ((PHP_MAJOR_VERSION 5) || (PHP_MAJOR_VERSION == 5 PHP_MINOR_VERSION = 1)) - pdo_exception_ce = zend_register_internal_class_ex(ce, spl_ce_RuntimeException, NULL TSRMLS_CC); -#else - pdo_exception_ce = zend_register_internal_class_ex(ce, zend_exception_get_default(), NULL TSRMLS_CC); -#endif + + pdo_exception_ce = zend_register_internal_class_ex(ce, php_pdo_get_exception_base(0 TSRMLS_CC), NULL TSRMLS_CC); + zend_declare_property_null(pdo_exception_ce, errorInfo, sizeof(errorInfo)-1, ZEND_ACC_PUBLIC TSRMLS_CC); pdo_dbh_init(TSRMLS_C); -- Give me your money at @ http://pecl.php.net/wishlist.php/sniper Donating money may make me happier and friendlier for a limited period! Death to all 4 letter abbreviations starting with P! Best regards, Marcus -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/spl/examples recursivetreeiterator.inc
helly Wed Oct 5 15:10:23 2005 EDT Modified files: /php-src/ext/spl/examples recursivetreeiterator.inc Log: - Update example http://cvs.php.net/diff.php/php-src/ext/spl/examples/recursivetreeiterator.inc?r1=1.2r2=1.3ty=u Index: php-src/ext/spl/examples/recursivetreeiterator.inc diff -u php-src/ext/spl/examples/recursivetreeiterator.inc:1.2 php-src/ext/spl/examples/recursivetreeiterator.inc:1.3 --- php-src/ext/spl/examples/recursivetreeiterator.inc:1.2 Mon Oct 3 09:29:30 2005 +++ php-src/ext/spl/examples/recursivetreeiterator.inc Wed Oct 5 15:10:22 2005 @@ -19,68 +19,62 @@ class RecursiveTreeIterator extends RecursiveIteratorIterator { private $callToString; - - function __construct(RecursiveIterator $it, $cit_flags = CachingIterator::CATCH_GET_CHILD) - { - parent::__construct(new RecursiveCachingIterator($it, $cit_flags), 1); - $this-callToString = (bool)($cit_flags CachingIterator::CALL_TOSTRING); - } - /** @return prefix used if $level depth and hasNext($level) == true + /** +* @param it iterator to use as inner iterator +* @param flags flags passed to RecursiveIteratoIterator (parent) +* @param cit_flags flags passed to RecursiveCachingIterator (for hasNext) */ - function getPrefix1() + function __construct(RecursiveIterator $it, $flags = self::SELF_FIRST, $cit_flags = CachingIterator::CATCH_GET_CHILD) { - return '| '; + parent::__construct(new RecursiveCachingIterator($it, $cit_flags), $flags); + $this-callToString = (bool)($cit_flags CachingIterator::CALL_TOSTRING); } - /** @return prefix used if $level depth and hasNext($level) == false + /** Prefix strings used in getPrefix() +* +* 0: prefix used to start elements +* 1: prefix used if $level depth and hasNext($level) == true +* 2: prefix used if $level depth and hasNext($level) == false +* 3: prefix used if $level == depth and hasNext($level) == true +* 4: prefix used if $level == depth and hasNext($level) == false +* 5: prefix used right in front of the current element */ - function getPrefix2() - { - return ' '; - } + public $prefix = array(0='', 1='| ', 2=' ', 3='|-', 4='\-', 5=''); - /** @return prefix used if $level == depth and hasNext($level) == true + /** @return string to place in front of current element */ - function getPrefix3() + function getPrefix() { - return '|-'; + $tree = ''; + for ($level = 0; $level $this-getDepth(); $level++) + { + $tree .= $this-getSubIterator($level)-hasNext() ? $this-prefix[1] : $this-prefix[2]; + } + $tree .= $this-getSubIterator($level)-hasNext() ? $this-prefix[3] : $this-prefix[4]; + + return $this-prefix[0] . $tree . $this-prefix[5]; } - /** @return prefix used if $level == depth and hasNext($level) == false + /** @return string presentation build for current element */ - function getPrefix4() + function getEntry() { - return '\-'; + return $this-callToString ? $this-__toString() : parent::current(); } - function getPrefix($level) + /** @return string to place after the current element +*/ + function getPostfix() { - if ($level 0 || $level $this-getDepth()) - { - throw new OutOfBoundsException('Parameter $level must be = 0 and = depth'); - } - if ($level $this-getDepth()) - { - return $this-getSubIterator($level)-hasNext() ? $this-getPrefix1() : $this-getPrefix2(); - } - else - { - return $this-getSubIterator($level)-hasNext() ? $this-getPrefix3() : $this-getPrefix4(); - } + return ''; } - /** @return the current element prefixed with ASCII graphics + /** @return the current element prefixed and postfixed */ function current() - { - $tree = ''; - for ($l=0; $l = $this-getDepth(); $l++) - { - $tree .= $this-getPrefix($l); - } - - return $tree . ($this-callToString ? $this-__toString() : parent::current()); + { + return $this-getPrefix() . $this-getEntry() . $this-getPostfix(); } /** Aggregates the inner iterator @@ -90,3 +84,5 @@ return call_user_func_array(array($this-getSubIterator(), $func), $params); } } +
[PHP-CVS] cvs: php-src(PHP_5_1) /ext/spl/examples recursivetreeiterator.inc
helly Wed Oct 5 15:11:52 2005 EDT Modified files: (Branch: PHP_5_1) /php-src/ext/spl/examples recursivetreeiterator.inc Log: - MFH Update examples http://cvs.php.net/diff.php/php-src/ext/spl/examples/recursivetreeiterator.inc?r1=1.1.2.3r2=1.1.2.4ty=u Index: php-src/ext/spl/examples/recursivetreeiterator.inc diff -u php-src/ext/spl/examples/recursivetreeiterator.inc:1.1.2.3 php-src/ext/spl/examples/recursivetreeiterator.inc:1.1.2.4 --- php-src/ext/spl/examples/recursivetreeiterator.inc:1.1.2.3 Mon Oct 3 09:36:18 2005 +++ php-src/ext/spl/examples/recursivetreeiterator.inc Wed Oct 5 15:11:51 2005 @@ -19,68 +19,62 @@ class RecursiveTreeIterator extends RecursiveIteratorIterator { private $callToString; - - function __construct(RecursiveIterator $it, $cit_flags = CachingIterator::CATCH_GET_CHILD) - { - parent::__construct(new RecursiveCachingIterator($it, $cit_flags), 1); - $this-callToString = (bool)($cit_flags CachingIterator::CALL_TOSTRING); - } - /** @return prefix used if $level depth and hasNext($level) == true + /** +* @param it iterator to use as inner iterator +* @param flags flags passed to RecursiveIteratoIterator (parent) +* @param cit_flags flags passed to RecursiveCachingIterator (for hasNext) */ - function getPrefix1() + function __construct(RecursiveIterator $it, $flags = self::SELF_FIRST, $cit_flags = CachingIterator::CATCH_GET_CHILD) { - return '| '; + parent::__construct(new RecursiveCachingIterator($it, $cit_flags), $flags); + $this-callToString = (bool)($cit_flags CachingIterator::CALL_TOSTRING); } - /** @return prefix used if $level depth and hasNext($level) == false + /** Prefix strings used in getPrefix() +* +* 0: prefix used to start elements +* 1: prefix used if $level depth and hasNext($level) == true +* 2: prefix used if $level depth and hasNext($level) == false +* 3: prefix used if $level == depth and hasNext($level) == true +* 4: prefix used if $level == depth and hasNext($level) == false +* 5: prefix used right in front of the current element */ - function getPrefix2() - { - return ' '; - } + public $prefix = array(0='', 1='| ', 2=' ', 3='|-', 4='\-', 5=''); - /** @return prefix used if $level == depth and hasNext($level) == true + /** @return string to place in front of current element */ - function getPrefix3() + function getPrefix() { - return '|-'; + $tree = ''; + for ($level = 0; $level $this-getDepth(); $level++) + { + $tree .= $this-getSubIterator($level)-hasNext() ? $this-prefix[1] : $this-prefix[2]; + } + $tree .= $this-getSubIterator($level)-hasNext() ? $this-prefix[3] : $this-prefix[4]; + + return $this-prefix[0] . $tree . $this-prefix[5]; } - /** @return prefix used if $level == depth and hasNext($level) == false + /** @return string presentation build for current element */ - function getPrefix4() + function getEntry() { - return '\-'; + return $this-callToString ? $this-__toString() : parent::current(); } - function getPrefix($level) + /** @return string to place after the current element +*/ + function getPostfix() { - if ($level 0 || $level $this-getDepth()) - { - throw new OutOfBoundsException('Parameter $level must be = 0 and = depth'); - } - if ($level $this-getDepth()) - { - return $this-getSubIterator($level)-hasNext() ? $this-getPrefix1() : $this-getPrefix2(); - } - else - { - return $this-getSubIterator($level)-hasNext() ? $this-getPrefix3() : $this-getPrefix4(); - } + return ''; } - /** @return the current element prefixed with ASCII graphics + /** @return the current element prefixed and postfixed */ function current() - { - $tree = ''; - for ($l=0; $l = $this-getDepth(); $l++) - { - $tree .= $this-getPrefix($l); - } - - return $tree . ($this-callToString ? $this-__toString() : parent::current()); + { + return $this-getPrefix() . $this-getEntry() . $this-getPostfix(); } /** Aggregates the inner iterator @@ -90,3 +84,5 @@ return
[PHP-CVS] cvs: php-src /ext/simplexml simplexml.c /ext/spl spl_directory.c spl_iterators.c /ext/tidy tidy.c
helly Wed Oct 5 15:12:44 2005 EDT Modified files: /php-src/ext/simplexml simplexml.c /php-src/ext/splspl_directory.c spl_iterators.c /php-src/ext/tidy tidy.c Log: - Update cast_object handlers http://cvs.php.net/diff.php/php-src/ext/simplexml/simplexml.c?r1=1.161r2=1.162ty=u Index: php-src/ext/simplexml/simplexml.c diff -u php-src/ext/simplexml/simplexml.c:1.161 php-src/ext/simplexml/simplexml.c:1.162 --- php-src/ext/simplexml/simplexml.c:1.161 Mon Oct 3 12:04:50 2005 +++ php-src/ext/simplexml/simplexml.c Wed Oct 5 15:12:42 2005 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: simplexml.c,v 1.161 2005/10/03 16:04:50 helly Exp $ */ +/* $Id: simplexml.c,v 1.162 2005/10/05 19:12:42 helly Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -1040,20 +1040,15 @@ /* {{{ sxe_object_cast() */ static int -sxe_object_cast(zval *readobj, zval *writeobj, int type, int should_free TSRMLS_DC) +sxe_object_cast(zval *readobj, zval *writeobj, int type TSRMLS_DC) { php_sxe_object *sxe; char *contents = NULL; xmlNodePtr node; - zval free_obj; int rv; sxe = php_sxe_fetch_object(readobj TSRMLS_CC); - if (should_free) { - free_obj = *writeobj; - } - if (sxe-iter.type != SXE_ITER_NONE) { node = php_sxe_get_first_node(sxe, NULL TSRMLS_CC); if (node) { @@ -1078,9 +1073,6 @@ if (contents) { xmlFree(contents); } - if (should_free) { - zval_dtor(free_obj); - } return rv; } /* }}} */ @@ -1765,7 +1757,7 @@ { php_info_print_table_start(); php_info_print_table_header(2, Simplexml support, enabled); - php_info_print_table_row(2, Revision, $Revision: 1.161 $); + php_info_print_table_row(2, Revision, $Revision: 1.162 $); php_info_print_table_row(2, Schema support, #ifdef LIBXML_SCHEMAS_ENABLED enabled); http://cvs.php.net/diff.php/php-src/ext/spl/spl_directory.c?r1=1.48r2=1.49ty=u Index: php-src/ext/spl/spl_directory.c diff -u php-src/ext/spl/spl_directory.c:1.48 php-src/ext/spl/spl_directory.c:1.49 --- php-src/ext/spl/spl_directory.c:1.48Thu Sep 15 10:07:38 2005 +++ php-src/ext/spl/spl_directory.c Wed Oct 5 15:12:43 2005 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: spl_directory.c,v 1.48 2005/09/15 14:07:38 helly Exp $ */ +/* $Id: spl_directory.c,v 1.49 2005/10/05 19:12:43 helly Exp $ */ #ifdef HAVE_CONFIG_H # include config.h @@ -793,19 +793,12 @@ /* }}} */ /* {{{ spl_ce_dir_cast */ -static int spl_ce_dir_cast(zval *readobj, zval *writeobj, int type, int should_free TSRMLS_DC) +static int spl_ce_dir_cast(zval *readobj, zval *writeobj, int type TSRMLS_DC) { - zval free_obj; spl_ce_dir_object *dir_object = (spl_ce_dir_object*)zend_object_store_get_object(readobj TSRMLS_CC); if (type ==IS_STRING *dir_object-entry.d_name) { - if (should_free) { - free_obj = *writeobj; - } ZVAL_STRING(writeobj, dir_object-entry.d_name, 1); - if (should_free) { - zval_dtor(free_obj); - } return SUCCESS; } return FAILURE; http://cvs.php.net/diff.php/php-src/ext/spl/spl_iterators.c?r1=1.87r2=1.88ty=u Index: php-src/ext/spl/spl_iterators.c diff -u php-src/ext/spl/spl_iterators.c:1.87 php-src/ext/spl/spl_iterators.c:1.88 --- php-src/ext/spl/spl_iterators.c:1.87Mon Oct 3 06:08:56 2005 +++ php-src/ext/spl/spl_iterators.c Wed Oct 5 15:12:43 2005 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: spl_iterators.c,v 1.87 2005/10/03 10:08:56 helly Exp $ */ +/* $Id: spl_iterators.c,v 1.88 2005/10/05 19:12:43 helly Exp $ */ #ifdef HAVE_CONFIG_H # include config.h @@ -1522,46 +1522,19 @@ zval_ptr_dtor(retval); } if (intern-u.caching.flags CIT_CALL_TOSTRING) { - if (Z_TYPE_P(intern-current.data) == IS_OBJECT) { - zval expr_copy; - if (intern-current.data-value.obj.handlers-cast_object - intern-current.data-value.obj.handlers-cast_object(intern-current.data, expr_copy, IS_STRING, 0 TSRMLS_CC) == SUCCESS) - { - ALLOC_ZVAL(intern-u.caching.zstr); - *intern-u.caching.zstr = expr_copy; - INIT_PZVAL(intern-u.caching.zstr); - zval_copy_ctor(intern-u.caching.zstr); -
Re: [PHP-CVS] cvs: php-src(PHP_5_1) /ext/pdo pdo.c
Sorry, I missed this line: +static zend_class_entry *spl_ce_RuntimeException; No compile failure there then. --Jani On Wed, 5 Oct 2005, Marcus Boerger wrote: Hello Jani, how does this break the build? the reason for this 'workaround' is to fetch the class dynamically from the compiler classs hash rather than using the global pointer. For some reason it seems that the global pointer is not valid during PDO's MINIT in second apache 1.* startup stage. However, if you disable SPL the class is simply not available and you fallback to Exception as PDOException base just like you did before the patch. marcus Wednesday, October 5, 2005, 6:32:58 PM, you wrote: If I have --enable-pdo, this would break the build since I have --disable-spl.. :) --Jani On Wed, 5 Oct 2005, Derick Rethans wrote: derickWed Oct 5 09:51:49 2005 EDT Modified files: (Branch: PHP_5_1) /php-src/ext/pdo pdo.c Log: - Committing some changes that make PDO+SPL not crash anymore. These are done by Marcus. and I'm committing them in order to actually use PHP 5.1 without segfaulting when apache starts. This is not necessary the best solution. http://cvs.php.net/diff.php/php-src/ext/pdo/pdo.c?r1=1.57.2.8r2=1.57.2.9ty=u Index: php-src/ext/pdo/pdo.c diff -u php-src/ext/pdo/pdo.c:1.57.2.8 php-src/ext/pdo/pdo.c:1.57.2.9 --- php-src/ext/pdo/pdo.c:1.57.2.8Sun Oct 2 16:38:18 2005 +++ php-src/ext/pdo/pdo.c Wed Oct 5 09:51:46 2005 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: pdo.c,v 1.57.2.8 2005/10/02 20:38:18 helly Exp $ */ +/* $Id: pdo.c,v 1.57.2.9 2005/10/05 13:51:46 derick Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -33,9 +33,7 @@ #include php_pdo_int.h #include zend_exceptions.h -#if defined(HAVE_SPL) ((PHP_MAJOR_VERSION 5) || (PHP_MAJOR_VERSION == 5 PHP_MINOR_VERSION = 1)) -extern PHPAPI zend_class_entry *spl_ce_RuntimeException; -#endif +static zend_class_entry *spl_ce_RuntimeException; ZEND_DECLARE_MODULE_GLOBALS(pdo) @@ -64,7 +62,16 @@ { #if can_handle_soft_dependency_on_SPL defined(HAVE_SPL) ((PHP_MAJOR_VERSION 5) || (PHP_MAJOR_VERSION == 5 PHP_MINOR_VERSION = 1)) if (!root) { - return spl_ce_RuntimeException; + if (!spl_ce_RuntimeException) { + zend_class_entry **pce; + + if (zend_hash_find(CG(class_table), runtimeexception, sizeof(RuntimeException), (void **) pce) == SUCCESS) { + spl_ce_RuntimeException = *pce; + return *pce; + } + } else { + return spl_ce_RuntimeException; + } } #endif #if (PHP_MAJOR_VERSION 6) @@ -295,7 +302,9 @@ /* {{{ PHP_MINIT_FUNCTION */ PHP_MINIT_FUNCTION(pdo) { - zend_class_entry ce; + zend_class_entry ce, *pce; + + spl_ce_RuntimeException = NULL; ZEND_INIT_MODULE_GLOBALS(pdo, php_pdo_init_globals, NULL); REGISTER_INI_ENTRIES(); @@ -310,11 +319,9 @@ PDO persistent database, module_number); INIT_CLASS_ENTRY(ce, PDOException, NULL); -#if can_handle_soft_dependency_on_SPL defined(HAVE_SPL) ((PHP_MAJOR_VERSION 5) || (PHP_MAJOR_VERSION == 5 PHP_MINOR_VERSION = 1)) - pdo_exception_ce = zend_register_internal_class_ex(ce, spl_ce_RuntimeException, NULL TSRMLS_CC); -#else - pdo_exception_ce = zend_register_internal_class_ex(ce, zend_exception_get_default(), NULL TSRMLS_CC); -#endif + + pdo_exception_ce = zend_register_internal_class_ex(ce, php_pdo_get_exception_base(0 TSRMLS_CC), NULL TSRMLS_CC); + zend_declare_property_null(pdo_exception_ce, errorInfo, sizeof(errorInfo)-1, ZEND_ACC_PUBLIC TSRMLS_CC); pdo_dbh_init(TSRMLS_C); -- Give me your money at @ http://pecl.php.net/wishlist.php/sniper Donating money may make me happier and friendlier for a limited period! Death to all 4 letter abbreviations starting with P! Best regards, Marcus -- Give me your money at @ http://pecl.php.net/wishlist.php/sniper Donating money may make me happier and friendlier for a limited period! Death to all 4 letter abbreviations starting with P! -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/xmlreader php_xmlreader.c php_xmlreader.h
rrichards Wed Oct 5 15:41:58 2005 EDT Modified files: /php-src/ext/xmlreader php_xmlreader.c php_xmlreader.h Log: - speed and memory usage optimizations - implement readInnerXml, readOuterXml and readString: requires libxml 2.6.20 - add encoding and options paramters to open and XML methods options from libxml extension may be passed i.e. LIBXML_XINCLUDE to perform xinclude during read http://cvs.php.net/diff.php/php-src/ext/xmlreader/php_xmlreader.c?r1=1.13r2=1.14ty=u Index: php-src/ext/xmlreader/php_xmlreader.c diff -u php-src/ext/xmlreader/php_xmlreader.c:1.13 php-src/ext/xmlreader/php_xmlreader.c:1.14 --- php-src/ext/xmlreader/php_xmlreader.c:1.13 Wed Aug 3 10:08:21 2005 +++ php-src/ext/xmlreader/php_xmlreader.c Wed Oct 5 15:41:57 2005 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: php_xmlreader.c,v 1.13 2005/08/03 14:08:21 sniper Exp $ */ +/* $Id: php_xmlreader.c,v 1.14 2005/10/05 19:41:57 rrichards Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -40,13 +40,14 @@ typedef int (*xmlreader_read_int_t)(xmlTextReaderPtr reader); typedef unsigned char *(*xmlreader_read_char_t)(xmlTextReaderPtr reader); +typedef const unsigned char *(*xmlreader_read_const_char_t)(xmlTextReaderPtr reader); typedef int (*xmlreader_write_t)(xmlreader_object *obj, zval *newval TSRMLS_DC); typedef unsigned char *(*xmlreader_read_one_char_t)(xmlTextReaderPtr reader, const unsigned char *); typedef struct _xmlreader_prop_handler { xmlreader_read_int_t read_int_func; - xmlreader_read_char_t read_char_func; + xmlreader_read_const_char_t read_char_func; xmlreader_write_t write_func; int type; } xmlreader_prop_handler; @@ -54,7 +55,7 @@ #define XMLREADER_LOAD_STRING 0 #define XMLREADER_LOAD_FILE 1 -static void xmlreader_register_prop_handler(HashTable *prop_handler, char *name, xmlreader_read_int_t read_int_func, xmlreader_read_char_t read_char_func, int rettype TSRMLS_DC) +static void xmlreader_register_prop_handler(HashTable *prop_handler, char *name, xmlreader_read_int_t read_int_func, xmlreader_read_const_char_t read_char_func, int rettype TSRMLS_DC) { xmlreader_prop_handler hnd; @@ -66,7 +67,7 @@ static int xmlreader_property_reader(xmlreader_object *obj, xmlreader_prop_handler *hnd, zval **retval TSRMLS_DC) { - char *retchar = NULL; + const xmlChar *retchar = NULL; int retint = 0; if (obj-ptr != NULL) { @@ -88,8 +89,7 @@ switch (hnd-type) { case IS_STRING: if (retchar) { - ZVAL_STRING(*retval, retchar, 1); - xmlFree(retchar); + ZVAL_STRING(*retval, (xmlChar *) retchar, 1); } else { ZVAL_EMPTY_STRING(*retval); } @@ -311,11 +311,6 @@ static void xmlreader_free_resources(xmlreader_object *intern) { if (intern) { - if (intern-input) { - xmlFreeParserInputBuffer(intern-input); - intern-input = NULL; - } - if (intern-ptr) { xmlFreeTextReader(intern-ptr); intern-ptr = NULL; @@ -355,7 +350,6 @@ intern-std.in_get = 0; intern-std.in_set = 0; intern-ptr = NULL; - intern-input = NULL; intern-schema = NULL; intern-prop_handler = xmlreader_prop_handlers; @@ -418,7 +412,6 @@ RETURN_FALSE; } -/* This function not yet needed until some additional functions are implemented in libxml static void php_xmlreader_no_arg_string(INTERNAL_FUNCTION_PARAMETERS, xmlreader_read_char_t internal_function) { zval *id; char *retchar = NULL; @@ -428,7 +421,7 @@ intern = (xmlreader_object *)zend_object_store_get_object(id TSRMLS_CC); if (intern intern-ptr) { - retchar = xmlTextReaderReadString(intern-ptr); + retchar = internal_function(intern-ptr); } if (retchar) { RETVAL_STRING(retchar, 1); @@ -438,7 +431,6 @@ RETVAL_EMPTY_STRING(); } } -*/ static void php_xmlreader_set_relaxng_schema(INTERNAL_FUNCTION_PARAMETERS, int type) { #ifdef LIBXML_SCHEMAS_ENABLED @@ -522,7 +514,7 @@ PHP_METHOD(xmlreader, getAttributeNo) { zval *id; - int attr_pos; + long attr_pos; char *retchar = NULL; xmlreader_object *intern; @@ -585,7 +577,8 @@ PHP_METHOD(xmlreader, getParserProperty) { zval *id; - int property, retval = -1; + long property; + int retval = -1; xmlreader_object *intern; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, l, property) == FAILURE) { @@ -663,7 +656,8 @@ PHP_METHOD(xmlreader,
[PHP-CVS] cvs: php-src /ext/xmlreader php_xmlreader.c
rrichards Wed Oct 5 15:52:59 2005 EDT Modified files: /php-src/ext/xmlreader php_xmlreader.c Log: these should have remained ints http://cvs.php.net/diff.php/php-src/ext/xmlreader/php_xmlreader.c?r1=1.14r2=1.15ty=u Index: php-src/ext/xmlreader/php_xmlreader.c diff -u php-src/ext/xmlreader/php_xmlreader.c:1.14 php-src/ext/xmlreader/php_xmlreader.c:1.15 --- php-src/ext/xmlreader/php_xmlreader.c:1.14 Wed Oct 5 15:41:57 2005 +++ php-src/ext/xmlreader/php_xmlreader.c Wed Oct 5 15:52:58 2005 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: php_xmlreader.c,v 1.14 2005/10/05 19:41:57 rrichards Exp $ */ +/* $Id: php_xmlreader.c,v 1.15 2005/10/05 19:52:58 rrichards Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -944,7 +944,7 @@ PHP_METHOD(xmlreader, XML) { zval *id; - long source_len = 0, encoding_len = 0; + int source_len = 0, encoding_len = 0; long options = 0; xmlreader_object *intern; char *source, *uri = NULL, *encoding = NULL; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /main/streams streams.c
tony2001Wed Oct 5 17:46:31 2005 EDT Modified files: /php-src/main/streams streams.c Log: fix fwrite() and fgets() in unicode mode http://cvs.php.net/diff.php/php-src/main/streams/streams.c?r1=1.88r2=1.89ty=u Index: php-src/main/streams/streams.c diff -u php-src/main/streams/streams.c:1.88 php-src/main/streams/streams.c:1.89 --- php-src/main/streams/streams.c:1.88 Wed Oct 5 13:18:06 2005 +++ php-src/main/streams/streams.c Wed Oct 5 17:46:28 2005 @@ -19,7 +19,7 @@ +--+ */ -/* $Id: streams.c,v 1.88 2005/10/05 17:18:06 tony2001 Exp $ */ +/* $Id: streams.c,v 1.89 2005/10/05 21:46:28 tony2001 Exp $ */ #define _GNU_SOURCE #include php.h @@ -1258,7 +1258,7 @@ count_bytes = 1; /* translate U16 to bytes */ } - memcpy(buf + num_bytes, s, count_bytes); + memcpy(buf + (num_bytes 1), s, count_bytes); num_bytes += count_bytes; num_chars += count_chars; stream-readbuf_ofs += count_bytes 1; @@ -1577,23 +1577,23 @@ PHPAPI size_t _php_stream_u_write(php_stream *stream, const UChar *buf, int32_t count TSRMLS_DC) { + int32_t ret; + if (buf == NULL || count == 0 || stream-ops-write == NULL) { return 0; } if (stream-writefilters.head) { - return _php_stream_write_filtered(stream, (const char*)buf, count, PSFS_FLAG_NORMAL, 1 TSRMLS_CC); + ret = _php_stream_write_filtered(stream, (const char*)buf, count, PSFS_FLAG_NORMAL, 1 TSRMLS_CC); } else { - int32_t ret; - ret = _php_stream_write_buffer(stream, (const char*)buf, UBYTES(count) TSRMLS_CC); + } - /* Return data points, not bytes */ - if (ret 0) { - ret = 1; - } - return ret; + /* Return data points, not bytes */ + if (ret 0) { + ret = 1; } + return ret; } PHPAPI size_t _php_stream_printf(php_stream *stream TSRMLS_DC, const char *fmt, ...) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/spl spl_iterators.c
helly Wed Oct 5 17:57:46 2005 EDT Modified files: /php-src/ext/splspl_iterators.c Log: - MFB Missing constants http://cvs.php.net/diff.php/php-src/ext/spl/spl_iterators.c?r1=1.88r2=1.89ty=u Index: php-src/ext/spl/spl_iterators.c diff -u php-src/ext/spl/spl_iterators.c:1.88 php-src/ext/spl/spl_iterators.c:1.89 --- php-src/ext/spl/spl_iterators.c:1.88Wed Oct 5 15:12:43 2005 +++ php-src/ext/spl/spl_iterators.c Wed Oct 5 17:57:45 2005 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: spl_iterators.c,v 1.88 2005/10/05 19:12:43 helly Exp $ */ +/* $Id: spl_iterators.c,v 1.89 2005/10/05 21:57:45 helly Exp $ */ #ifdef HAVE_CONFIG_H # include config.h @@ -2299,9 +2299,11 @@ REGISTER_SPL_ITERATOR(CachingIterator); REGISTER_SPL_IMPLEMENTS(CachingIterator, ArrayAccess); - REGISTER_SPL_CLASS_CONST_LONG(CachingIterator, CALL_TOSTRING, CIT_CALL_TOSTRING); - REGISTER_SPL_CLASS_CONST_LONG(CachingIterator, CATCH_GET_CHILD, CIT_CATCH_GET_CHILD); - REGISTER_SPL_CLASS_CONST_LONG(CachingIterator, FULL_CACHE, CIT_FULL_CACHE); + REGISTER_SPL_CLASS_CONST_LONG(CachingIterator, CALL_TOSTRING, CIT_CALL_TOSTRING); + REGISTER_SPL_CLASS_CONST_LONG(CachingIterator, CATCH_GET_CHILD, CIT_CATCH_GET_CHILD); + REGISTER_SPL_CLASS_CONST_LONG(CachingIterator, TOSTRING_USE_KEY, CIT_TOSTRING_USE_KEY); + REGISTER_SPL_CLASS_CONST_LONG(CachingIterator, TOSTRING_USE_CURRENT, CIT_TOSTRING_USE_CURRENT); + REGISTER_SPL_CLASS_CONST_LONG(CachingIterator, FULL_CACHE, CIT_FULL_CACHE); REGISTER_SPL_SUB_CLASS_EX(RecursiveCachingIterator, CachingIterator, spl_dual_it_new, spl_funcs_RecursiveCachingIterator); REGISTER_SPL_IMPLEMENTS(RecursiveCachingIterator, RecursiveIterator); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_1) /ext/spl spl_iterators.c
helly Wed Oct 5 17:59:14 2005 EDT Modified files: (Branch: PHP_5_1) /php-src/ext/splspl_iterators.c Log: - Synch RecursiveIteratorIterator, fixes a few memory corruptions/memleaks http://cvs.php.net/diff.php/php-src/ext/spl/spl_iterators.c?r1=1.73.2.3r2=1.73.2.4ty=u Index: php-src/ext/spl/spl_iterators.c diff -u php-src/ext/spl/spl_iterators.c:1.73.2.3 php-src/ext/spl/spl_iterators.c:1.73.2.4 --- php-src/ext/spl/spl_iterators.c:1.73.2.3Mon Oct 3 12:05:08 2005 +++ php-src/ext/spl/spl_iterators.c Wed Oct 5 17:59:13 2005 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: spl_iterators.c,v 1.73.2.3 2005/10/03 16:05:08 helly Exp $ */ +/* $Id: spl_iterators.c,v 1.73.2.4 2005/10/05 21:59:13 helly Exp $ */ #ifdef HAVE_CONFIG_H # include config.h @@ -89,6 +89,10 @@ int level; RecursiveIteratorModemode; int flags; + int max_depth; + zend_boolin_iteration; + zend_function*beginIteration; + zend_function*endIteration; zend_function*callHasChildren; zend_function*callGetChildren; zend_function*beginChildren; @@ -116,14 +120,14 @@ sub_iter-funcs-dtor(sub_iter TSRMLS_CC); zval_ptr_dtor(object-iterators[object-level--].zobject); } - erealloc(object-iterators, sizeof(spl_sub_iterator)); + object-iterators = erealloc(object-iterators, sizeof(spl_sub_iterator)); object-level = 0; zval_ptr_dtor(iter-zobject); efree(iter); } -static int spl_recursive_it_valid_ex(spl_recursive_it_object *object TSRMLS_DC) +static int spl_recursive_it_valid_ex(spl_recursive_it_object *object, zval *zthis TSRMLS_DC) { zend_object_iterator *sub_iter; int level = object-level; @@ -135,6 +139,10 @@ } level--; } + if (object-endIteration object-in_iteration) { + zend_call_method_with_0_params(zthis, object-ce, object-endIteration, endIteration, NULL); + } + object-in_iteration = 0; return FAILURE; } @@ -142,7 +150,7 @@ { spl_recursive_it_object *object = (spl_recursive_it_object*)iter-data; - return spl_recursive_it_valid_ex(object TSRMLS_CC); + return spl_recursive_it_valid_ex(object, ((spl_recursive_it_iterator*)iter)-zobject TSRMLS_CC); } static void spl_recursive_it_get_current_data(zend_object_iterator *iter, zval ***data TSRMLS_DC) @@ -199,6 +207,7 @@ has_children = zend_is_true(retval); zval_ptr_dtor(retval); if (has_children) { + if (object-max_depth == -1 || object-max_depth object-level) { switch (object-mode) { case RIT_LEAVES_ONLY: case RIT_CHILD_FIRST: @@ -208,6 +217,14 @@ object-iterators[object-level].state = RS_SELF; goto next_step; } + } else { + /* do not recurse into */ + if (object-mode == RIT_LEAVES_ONLY) { + /* this is not a leave, so skip it */ + object-iterators[object-level].state = RS_NEXT; + goto next_step; + } + } } } if (object-nextElement) { @@ -306,6 +323,10 @@ if (sub_iter-funcs-rewind) { sub_iter-funcs-rewind(sub_iter TSRMLS_CC); } + if (object-beginIteration !object-in_iteration) { + zend_call_method_with_0_params(zthis, object-ce, object-beginIteration, beginIteration, NULL); + } + object-in_iteration = 1; spl_recursive_it_move_forward_ex(object, zthis TSRMLS_CC); } @@ -371,7 +392,18 @@ intern-level = 0; intern-mode = mode; intern-flags = flags; + intern-max_depth = -1; + intern-in_iteration = 0; intern-ce = Z_OBJCE_P(object); + + zend_hash_find(intern-ce-function_table, beginiteration,
[PHP-CVS] cvs: php-src(PHP_5_1) /ext/pdo_mysql mysql_driver.c
tony2001Wed Oct 5 18:14:54 2005 EDT Modified files: (Branch: PHP_5_1) /php-src/ext/pdo_mysql mysql_driver.c Log: use the right constant name in error messages http://cvs.php.net/diff.php/php-src/ext/pdo_mysql/mysql_driver.c?r1=1.59.2.2r2=1.59.2.3ty=u Index: php-src/ext/pdo_mysql/mysql_driver.c diff -u php-src/ext/pdo_mysql/mysql_driver.c:1.59.2.2 php-src/ext/pdo_mysql/mysql_driver.c:1.59.2.3 --- php-src/ext/pdo_mysql/mysql_driver.c:1.59.2.2 Wed Sep 14 11:34:58 2005 +++ php-src/ext/pdo_mysql/mysql_driver.cWed Oct 5 18:14:52 2005 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: mysql_driver.c,v 1.59.2.2 2005/09/14 15:34:58 iliaa Exp $ */ +/* $Id: mysql_driver.c,v 1.59.2.3 2005/10/05 22:14:52 tony2001 Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -75,7 +75,7 @@ Cannot execute queries while other unbuffered queries are active. Consider using PDOStatement::fetchAll(). Alternatively, if your code is only ever going to run against mysql, you may enable query - buffering by setting the PDO_MYSQL_ATTR_USE_BUFFERED_QUERY attribute., + buffering by setting the PDO::MYSQL_ATTR_USE_BUFFERED_QUERY attribute., dbh-is_persistent); } } else { /* no error */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_1) /ext/pdo pdo.c
tony2001Wed Oct 5 18:17:38 2005 EDT Modified files: (Branch: PHP_5_1) /php-src/ext/pdopdo.c Log: nuke unused variable http://cvs.php.net/diff.php/php-src/ext/pdo/pdo.c?r1=1.57.2.9r2=1.57.2.10ty=u Index: php-src/ext/pdo/pdo.c diff -u php-src/ext/pdo/pdo.c:1.57.2.9 php-src/ext/pdo/pdo.c:1.57.2.10 --- php-src/ext/pdo/pdo.c:1.57.2.9 Wed Oct 5 09:51:46 2005 +++ php-src/ext/pdo/pdo.c Wed Oct 5 18:17:38 2005 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: pdo.c,v 1.57.2.9 2005/10/05 13:51:46 derick Exp $ */ +/* $Id: pdo.c,v 1.57.2.10 2005/10/05 22:17:38 tony2001 Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -302,7 +302,7 @@ /* {{{ PHP_MINIT_FUNCTION */ PHP_MINIT_FUNCTION(pdo) { - zend_class_entry ce, *pce; + zend_class_entry ce; spl_ce_RuntimeException = NULL; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/wddx php_wddx_api.h wddx.c
rrichards Wed Oct 5 18:35:17 2005 EDT Modified files: /php-src/ext/wddx php_wddx_api.h wddx.c Log: fix buffer lengths passed to snprintf http://cvs.php.net/diff.php/php-src/ext/wddx/php_wddx_api.h?r1=1.24r2=1.25ty=u Index: php-src/ext/wddx/php_wddx_api.h diff -u php-src/ext/wddx/php_wddx_api.h:1.24 php-src/ext/wddx/php_wddx_api.h:1.25 --- php-src/ext/wddx/php_wddx_api.h:1.24Sat Aug 13 21:17:49 2005 +++ php-src/ext/wddx/php_wddx_api.h Wed Oct 5 18:35:11 2005 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: php_wddx_api.h,v 1.24 2005/08/14 01:17:49 sniper Exp $ */ +/* $Id: php_wddx_api.h,v 1.25 2005/10/05 22:35:11 rrichards Exp $ */ #ifndef PHP_WDDX_API_H #define PHP_WDDX_API_H @@ -47,6 +47,9 @@ #define WDDX_VAR_S var name='%s' #define WDDX_VAR_E /var +#define WDDX_NUMBER_LEN17 +#define WDDX_VAR_S_LEN 13 + #define php_wddx_add_chunk(packet, str)smart_str_appends(packet, str) #define php_wddx_add_chunk_ex(packet, str, len) smart_str_appendl(packet, str, len) #define php_wddx_add_chunk_static(packet, str) smart_str_appendl(packet, str, sizeof(str)-1) http://cvs.php.net/diff.php/php-src/ext/wddx/wddx.c?r1=1.123r2=1.124ty=u Index: php-src/ext/wddx/wddx.c diff -u php-src/ext/wddx/wddx.c:1.123 php-src/ext/wddx/wddx.c:1.124 --- php-src/ext/wddx/wddx.c:1.123 Wed Aug 31 10:30:46 2005 +++ php-src/ext/wddx/wddx.c Wed Oct 5 18:35:11 2005 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: wddx.c,v 1.123 2005/08/31 14:30:46 sniper Exp $ */ +/* $Id: wddx.c,v 1.124 2005/10/05 22:35:11 rrichards Exp $ */ #include php.h @@ -423,7 +423,7 @@ tmp = *var; zval_copy_ctor(tmp); convert_to_string(tmp); - snprintf(tmp_buf, Z_STRLEN(tmp), WDDX_NUMBER, Z_STRVAL(tmp)); + snprintf(tmp_buf, Z_STRLEN(tmp) + WDDX_NUMBER_LEN + 1, WDDX_NUMBER, Z_STRVAL(tmp)); zval_dtor(tmp); php_wddx_add_chunk(packet, tmp_buf); @@ -625,8 +625,8 @@ if (name) { name_esc = php_escape_html_entities(name, name_len, name_esc_len, 0, ENT_QUOTES, NULL TSRMLS_CC); - tmp_buf = emalloc(name_esc_len + 1); - snprintf(tmp_buf, name_esc_len, WDDX_VAR_S, name_esc); + tmp_buf = emalloc(name_esc_len + WDDX_VAR_S_LEN + 1); + snprintf(tmp_buf, name_esc_len + WDDX_VAR_S_LEN + 1, WDDX_VAR_S, name_esc); php_wddx_add_chunk(packet, tmp_buf); efree(tmp_buf); efree(name_esc); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_1) /ext/wddx php_wddx_api.h wddx.c
rrichards Wed Oct 5 18:36:11 2005 EDT Modified files: (Branch: PHP_5_1) /php-src/ext/wddx php_wddx_api.h wddx.c Log: MFH: fix buffer lengths passed to snprintf http://cvs.php.net/diff.php/php-src/ext/wddx/php_wddx_api.h?r1=1.23r2=1.23.2.1ty=u Index: php-src/ext/wddx/php_wddx_api.h diff -u php-src/ext/wddx/php_wddx_api.h:1.23 php-src/ext/wddx/php_wddx_api.h:1.23.2.1 --- php-src/ext/wddx/php_wddx_api.h:1.23Wed Aug 3 10:08:20 2005 +++ php-src/ext/wddx/php_wddx_api.h Wed Oct 5 18:36:10 2005 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: php_wddx_api.h,v 1.23 2005/08/03 14:08:20 sniper Exp $ */ +/* $Id: php_wddx_api.h,v 1.23.2.1 2005/10/05 22:36:10 rrichards Exp $ */ #ifndef PHP_WDDX_API_H #define PHP_WDDX_API_H @@ -47,6 +47,9 @@ #define WDDX_VAR_S var name='%s' #define WDDX_VAR_E /var +#define WDDX_NUMBER_LEN17 +#define WDDX_VAR_S_LEN 13 + #define php_wddx_add_chunk(packet, str)smart_str_appends(packet, str) #define php_wddx_add_chunk_ex(packet, str, len) smart_str_appendl(packet, str, len) #define php_wddx_add_chunk_static(packet, str) smart_str_appendl(packet, str, sizeof(str)-1) http://cvs.php.net/diff.php/php-src/ext/wddx/wddx.c?r1=1.119.2.3r2=1.119.2.4ty=u Index: php-src/ext/wddx/wddx.c diff -u php-src/ext/wddx/wddx.c:1.119.2.3 php-src/ext/wddx/wddx.c:1.119.2.4 --- php-src/ext/wddx/wddx.c:1.119.2.3 Fri Sep 16 13:11:02 2005 +++ php-src/ext/wddx/wddx.c Wed Oct 5 18:36:10 2005 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: wddx.c,v 1.119.2.3 2005/09/16 17:11:02 tony2001 Exp $ */ +/* $Id: wddx.c,v 1.119.2.4 2005/10/05 22:36:10 rrichards Exp $ */ #include php.h @@ -422,7 +422,7 @@ tmp = *var; zval_copy_ctor(tmp); convert_to_string(tmp); - snprintf(tmp_buf, Z_STRLEN(tmp), WDDX_NUMBER, Z_STRVAL(tmp)); + snprintf(tmp_buf, Z_STRLEN(tmp) + WDDX_NUMBER_LEN + 1, WDDX_NUMBER, Z_STRVAL(tmp)); zval_dtor(tmp); php_wddx_add_chunk(packet, tmp_buf); @@ -624,8 +624,8 @@ if (name) { name_esc = php_escape_html_entities(name, name_len, name_esc_len, 0, ENT_QUOTES, NULL TSRMLS_CC); - tmp_buf = emalloc(name_esc_len + 1); - snprintf(tmp_buf, name_esc_len, WDDX_VAR_S, name_esc); + tmp_buf = emalloc(name_esc_len + WDDX_VAR_S_LEN + 1); + snprintf(tmp_buf, name_esc_len + WDDX_VAR_S_LEN + 1, WDDX_VAR_S, name_esc); php_wddx_add_chunk(packet, tmp_buf); efree(tmp_buf); efree(name_esc); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src / run-tests.php
helly Wed Oct 5 20:35:10 2005 EDT Modified files: /php-srcrun-tests.php Log: - Fix faillog and make it understand/handle redirected tests http://cvs.php.net/diff.php/php-src/run-tests.php?r1=1.232r2=1.233ty=u Index: php-src/run-tests.php diff -u php-src/run-tests.php:1.232 php-src/run-tests.php:1.233 --- php-src/run-tests.php:1.232 Mon Oct 3 14:15:54 2005 +++ php-src/run-tests.php Wed Oct 5 20:35:08 2005 @@ -23,7 +23,7 @@ +--+ */ -/* $Id: run-tests.php,v 1.232 2005/10/03 18:15:54 helly Exp $ */ +/* $Id: run-tests.php,v 1.233 2005/10/06 00:35:08 helly Exp $ */ /* Sanity check to ensure that pcre extension needed by this script is available. * In the event it is not, print a nice error message indicating that this script will @@ -217,6 +217,7 @@ // Determine the tests to be run. $test_files = array(); +$redir_tests = array(); $test_results = array(); $PHP_FAILED_TESTS = array('BORKED' = array(), 'FAILED' = array()); @@ -232,22 +233,30 @@ case 'r': case 'l': $test_list = @file($argv[++$i]); - if (is_array($test_list) count($test_list)) { - $test_files = array_merge($test_files, $test_list); + if ($test_list) { + foreach($test_list as $test) { + $matches = array(); + if (preg_match('/^#.*\[(.*)\]\:\s+(.*)$/', $test, $matches)) { + $redir_tests[] = array($matches[1], $matches[2]); + } else if (strlen($test)) { + $test_files[] = trim($test); + } + } } if ($switch != 'l') { break; } $i--; - case 'v': - $DETAILED = true; - break; + // break left intentionally case 'w': $failed_tests_file = fopen($argv[++$i], 'w+t'); break; case 'a': $failed_tests_file = fopen($argv[++$i], 'a+t'); break; + case 'v': + $DETAILED = true; + break; case 'n': if (!$pass_option_n) { $pass_options .= ' -n'; @@ -277,7 +286,7 @@ -l file Read the testfiles to be executed from file. After the test has finished all failed tests are written to the same file. If the list is empty and no further test is specified then -all tests are executed. +all tests are executed (same as: -r file -w file). -r file Read the testfiles to be executed from file. @@ -311,9 +320,7 @@ } } $test_files = array_unique($test_files); - for($i = 0; $i count($test_files); $i++) { - $test_files[$i] = trim($test_files[$i]); - } + $test_files = array_merge($test_files, $redir_tests); // Run selected tests. $test_cnt = count($test_files); @@ -324,7 +331,7 @@ $start_time = time(); $test_idx = 0; foreach($test_files AS $name) { - $test_results[$name] = run_test($php,$name,$test_cnt,++$test_idx); + $test_results[is_array($name) ? $name[0] : $name] = run_test($php,$name,$test_cnt,++$test_idx); if ($failed_tests_file ($test_results[$name] == 'FAILED' || $test_results[$name] == 'WARNED')) { fwrite($failed_tests_file, $name\n); } @@ -409,9 +416,21 @@ closedir($o); } +function test_name($name) +{ + if (is_array($name)) { + return $name[0] . ':' . $name[1]; + } else { + return $name; + } +} + function test_sort($a, $b) { global $cwd; + + $a = test_name($a); + $b = test_name($b);
[PHP-CVS] cvs: php-src / run-tests.php
helly Wed Oct 5 20:38:55 2005 EDT Modified files: /php-srcrun-tests.php Log: - MFB use new functions http://cvs.php.net/diff.php/php-src/run-tests.php?r1=1.233r2=1.234ty=u Index: php-src/run-tests.php diff -u php-src/run-tests.php:1.233 php-src/run-tests.php:1.234 --- php-src/run-tests.php:1.233 Wed Oct 5 20:35:08 2005 +++ php-src/run-tests.php Wed Oct 5 20:38:55 2005 @@ -23,7 +23,7 @@ +--+ */ -/* $Id: run-tests.php,v 1.233 2005/10/06 00:35:08 helly Exp $ */ +/* $Id: run-tests.php,v 1.234 2005/10/06 00:38:55 helly Exp $ */ /* Sanity check to ensure that pcre extension needed by this script is available. * In the event it is not, print a nice error message indicating that this script will @@ -572,9 +572,7 @@ if ($just_save_results || !mail_qa_team($failed_tests_data, $compression, $status)) { $output_file = $CUR_DIR . '/php_test_results_' . date('Ymd_Hi') . ( $compression ? '.txt.gz' : '.txt' ); - $fp = fopen($output_file, wt); - fwrite($fp, $failed_tests_data); - fclose($fp); + file_put_contents($output_file, $failed_tests_data); if (!$just_save_results) { echo \nThe test script was unable to automatically send the report to PHP's QA Team\n; @@ -633,9 +631,7 @@ { global $DETAILED; - $fp = @fopen($filename,'wt') or error(Cannot open file ' . $filename . ' (save_text)); - fwrite($fp,$text); - fclose($fp); + @file_put_contents($filename, $text) or error(Cannot open file ' . $filename . ' (save_text)); if (1 $DETAILED) echo FILE $filename {{{ $text -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] Re: cvs: php-src /ext/date/lib timelib_structs.h
Jani Taskinen wrote: sniperMon Oct 3 16:20:50 2005 EDT Modified files: /php-src/ext/date/lib timelib_structs.h Log: Generated files are included like this.. [snip] -#include timelib_config.h +#include timelib_config.h I do believe that: #ifdef PHP_WIN32 #include timelib_config.h #else #include timelib_config.h #endif should fix the windows build without ruining the patch. Greg -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php