[PHP-CVS] cvs: php-src /ext/pcre php_pcre.c php_pcre.h /ext/pcre/tests bug27103.phpt bug40909.phpt invalid_utf8.phpt /ext/spl spl_iterators.c /win32 sendmail.c
dmitry Fri Jul 6 23:06:51 2007 UTC Modified files: /php-src/ext/pcre php_pcre.c php_pcre.h /php-src/ext/pcre/tests bug27103.phpt bug40909.phpt invalid_utf8.phpt /php-src/ext/splspl_iterators.c /php-src/win32 sendmail.c Log: PCRE unicode/binary support http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/php_pcre.c?r1=1.213r2=1.214diff_format=u Index: php-src/ext/pcre/php_pcre.c diff -u php-src/ext/pcre/php_pcre.c:1.213 php-src/ext/pcre/php_pcre.c:1.214 --- php-src/ext/pcre/php_pcre.c:1.213 Tue Jun 12 14:07:42 2007 +++ php-src/ext/pcre/php_pcre.c Fri Jul 6 23:06:51 2007 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: php_pcre.c,v 1.213 2007/06/12 14:07:42 scottmac Exp $ */ +/* $Id: php_pcre.c,v 1.214 2007/07/06 23:06:51 dmitry Exp $ */ /* TODO * php_pcre_replace_impl(): @@ -191,7 +191,7 @@ /* {{{ pcre_get_compiled_regex_cache */ -PHPAPI pcre_cache_entry* pcre_get_compiled_regex_cache(char *regex, int regex_len TSRMLS_DC) +PHPAPI pcre_cache_entry* pcre_get_compiled_regex_cache(zend_uchar utype, char *regex, int regex_len TSRMLS_DC) { pcre*re = NULL; pcre_extra *extra; @@ -333,7 +333,7 @@ } } - if (UG(unicode)) { + if (utype == IS_UNICODE) { coptions |= PCRE_UTF8; } @@ -405,7 +405,7 @@ */ PHPAPI pcre* pcre_get_compiled_regex(char *regex, pcre_extra **extra, int *preg_options TSRMLS_DC) { - pcre_cache_entry * pce = pcre_get_compiled_regex_cache(regex, strlen(regex) TSRMLS_CC); + pcre_cache_entry * pce = pcre_get_compiled_regex_cache(ZEND_STR_TYPE, regex, strlen(regex) TSRMLS_CC); if (extra) { *extra = pce ? pce-extra : NULL; @@ -422,7 +422,7 @@ */ PHPAPI pcre* pcre_get_compiled_regex_ex(char *regex, pcre_extra **extra, int *preg_options, int *compile_options TSRMLS_DC) { - pcre_cache_entry * pce = pcre_get_compiled_regex_cache(regex, strlen(regex) TSRMLS_CC); + pcre_cache_entry * pce = pcre_get_compiled_regex_cache(ZEND_STR_TYPE, regex, strlen(regex) TSRMLS_CC); if (extra) { *extra = pce ? pce-extra : NULL; @@ -439,7 +439,7 @@ /* }}} */ /* {{{ add_offset_pair */ -static inline void add_offset_pair(zval *result, char *str, int len, int offset, char *name, offset_map_t *prev TSRMLS_DC) +static inline void add_offset_pair(zval *result, zend_uchar utype, char *str, int len, int offset, char *name, offset_map_t *prev TSRMLS_DC) { zval *match_pair; int tmp; @@ -449,16 +449,25 @@ INIT_PZVAL(match_pair); /* Add (match, offset) to the return value */ - add_next_index_utf8_stringl(match_pair, str, len, 1); + if (utype == IS_UNICODE) { + add_next_index_utf8_stringl(match_pair, str, len, 1); + } else { + add_next_index_stringl(match_pair, str, len, 1); + } /* Calculate codepoint offset from the previous chunk */ if (offset) { - tmp = prev-byte_offset; - while (tmp offset) { - U8_FWD_1(prev-str, tmp, offset); - prev-cp_offset++; - } - prev-byte_offset = tmp; + if (utype == IS_UNICODE) { + tmp = prev-byte_offset; + while (tmp offset) { + U8_FWD_1(prev-str, tmp, offset); + prev-cp_offset++; + } + prev-byte_offset = tmp; + } else { + prev-cp_offset = offset; + prev-byte_offset = offset; + } } add_next_index_long(match_pair, prev-cp_offset); @@ -511,7 +520,7 @@ } /* Compile regex or get it from cache. */ - if ((pce = pcre_get_compiled_regex_cache(regex.s, regex_len TSRMLS_CC)) == NULL) { + if ((pce = pcre_get_compiled_regex_cache(str_type, regex.s, regex_len TSRMLS_CC)) == NULL) { if (str_type == IS_UNICODE) { efree(regex_utf8); efree(subject_utf8); @@ -519,7 +528,7 @@ RETURN_FALSE; } - php_pcre_match_impl(pce, subject.s, subject_len, return_value, subpats, + php_pcre_match_impl(pce, str_type, subject.s, subject_len, return_value, subpats, global, ZEND_NUM_ARGS() = 4, flags, start_offset TSRMLS_CC); if (str_type == IS_UNICODE) { @@ -530,7 +539,7 @@ /* }}} */ /* {{{ php_pcre_match_impl */ -PHPAPI void php_pcre_match_impl(pcre_cache_entry *pce, char *subject, int subject_len, zval *return_value, +PHPAPI void php_pcre_match_impl(pcre_cache_entry *pce, zend_uchar utype, char
[PHP-CVS] cvs: php-src /ext/standard/tests/math bug30695.phpt /ext/standard/tests/strings bug40704.phpt md5.phpt md5_file.phpt substr.phpt trim1.phpt
dmitry Mon Jul 9 11:38:34 2007 UTC Modified files: /php-src/ext/standard/tests/mathbug30695.phpt /php-src/ext/standard/tests/strings bug40704.phpt md5.phpt md5_file.phpt substr.phpt trim1.phpt Log: Fixed tests http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/math/bug30695.phpt?r1=1.1r2=1.2diff_format=u Index: php-src/ext/standard/tests/math/bug30695.phpt diff -u php-src/ext/standard/tests/math/bug30695.phpt:1.1 php-src/ext/standard/tests/math/bug30695.phpt:1.2 --- php-src/ext/standard/tests/math/bug30695.phpt:1.1 Mon Nov 29 10:15:03 2004 +++ php-src/ext/standard/tests/math/bug30695.phpt Mon Jul 9 11:38:34 2007 @@ -1,5 +1,7 @@ --TEST-- Bug #30695 (32 bit issues) +--INI-- +unicode.output_encoding=ISO-8859-1 --FILE-- ?php function toUTF8( $char_code ) http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/bug40704.phpt?r1=1.2r2=1.3diff_format=u Index: php-src/ext/standard/tests/strings/bug40704.phpt diff -u php-src/ext/standard/tests/strings/bug40704.phpt:1.2 php-src/ext/standard/tests/strings/bug40704.phpt:1.3 --- php-src/ext/standard/tests/strings/bug40704.phpt:1.2Tue May 29 20:11:23 2007 +++ php-src/ext/standard/tests/strings/bug40704.phptMon Jul 9 11:38:34 2007 @@ -11,3 +11,6 @@ --EXPECT-- string(26) Bug ' Trigger Missing Text Done +--UEXPECT-- +unicode(26) Bug ' Trigger Missing Text +Done http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/md5.phpt?r1=1.2r2=1.3diff_format=u Index: php-src/ext/standard/tests/strings/md5.phpt http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/md5_file.phpt?r1=1.2r2=1.3diff_format=u Index: php-src/ext/standard/tests/strings/md5_file.phpt http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/substr.phpt?r1=1.2r2=1.3diff_format=u Index: php-src/ext/standard/tests/strings/substr.phpt diff -u php-src/ext/standard/tests/strings/substr.phpt:1.2 php-src/ext/standard/tests/strings/substr.phpt:1.3 --- php-src/ext/standard/tests/strings/substr.phpt:1.2 Sat May 12 12:12:26 2007 +++ php-src/ext/standard/tests/strings/substr.phpt Mon Jul 9 11:38:34 2007 @@ -1,5 +1,8 @@ --TEST-- Testing substr() function +--INI-- +unicode.script_encoding=ISO-8859-1 +unicode.output_encoding=ISO-8859-1 --FILE-- ?php @@ -216,3 +219,143 @@ string(26) ñtërnâtiônà lizætiøn Done +--UEXPECTF-- +*** Testing for error conditions *** + +Warning: substr() expects at least 2 parameters, 0 given in %s on line %d +NULL + +Warning: substr() expects at least 2 parameters, 1 given in %s on line %d +NULL + +Warning: substr() expects at least 2 parameters, 1 given in %s on line %d +NULL + +Warning: substr() expects at least 2 parameters, 1 given in %s on line %d +NULL + +Warning: substr() expects at most 3 parameters, 4 given in %s on line %d +NULL + +--- Iteration 1 --- + +-- Variations for two arguments -- +bool(false) +bool(false) +bool(false) + +-- Variations for three arguments -- +bool(false) +bool(false) +bool(false) +bool(false) +bool(false) +bool(false) +bool(false) +bool(false) +bool(false) + +--- Iteration 2 --- + +-- Variations for two arguments -- +bool(false) +bool(false) +bool(false) + +-- Variations for three arguments -- +bool(false) +bool(false) +bool(false) +bool(false) +bool(false) +bool(false) +bool(false) +bool(false) +bool(false) + +--- Iteration 3 --- + +-- Variations for two arguments -- +unicode(4) 2345 +unicode(5) 12345 +unicode(2) 45 + +-- Variations for three arguments -- +unicode(3) 234 +unicode(0) +unicode(1) 2 +unicode(3) 123 +unicode(0) +unicode(2) 12 +unicode(2) 45 +unicode(0) +unicode(0) + +--- Iteration 4 --- + +-- Variations for two arguments -- +unicode(5) bcdef +unicode(6) abcdef +unicode(2) ef + +-- Variations for three arguments -- +unicode(3) bcd +unicode(0) +unicode(2) bc +unicode(3) abc +unicode(0) +unicode(3) abc +unicode(2) ef +unicode(0) +unicode(0) + +--- Iteration 5 --- + +-- Variations for two arguments -- +unicode(5) 23abc +unicode(6) 123abc +unicode(2) bc + +-- Variations for three arguments -- +unicode(3) 23a +unicode(0) +unicode(2) 23 +unicode(3) 123 +unicode(0) +unicode(3) 123 +unicode(2) bc +unicode(0) +unicode(0) + +--- Iteration 6 --- + +-- Variations for two arguments -- +unicode(6) 123abc +unicode(7) _123abc +unicode(2) bc + +-- Variations for three arguments -- +unicode(3) 123 +unicode(0) +unicode(3) 123 +unicode(3) _12 +unicode(0) +unicode(4) _123 +unicode(2) bc +unicode(0) +unicode(0) + +*** Testing for variations of start and length to point to same element *** +unicode(1) c +unicode(1) c + +*** Testing for start truncation *** +unicode(0) + +*** Testing for string with null characters *** +unicode(6) c+ +*** Testing for string with international characters *** +unicode(26) ñtërnâtiônà lizætiøn + +Done
[PHP-CVS] cvs: php-src(PHP_5_2) /sapi/cgi fastcgi.c
dmitry Mon Jul 9 11:48:39 2007 UTC Modified files: (Branch: PHP_5_2) /php-src/sapi/cgi fastcgi.c Log: ECONNABORTED is not a critical error (Andrei Nigmatulin) http://cvs.php.net/viewvc.cgi/php-src/sapi/cgi/fastcgi.c?r1=1.4.2.13.2.26r2=1.4.2.13.2.27diff_format=u Index: php-src/sapi/cgi/fastcgi.c diff -u php-src/sapi/cgi/fastcgi.c:1.4.2.13.2.26 php-src/sapi/cgi/fastcgi.c:1.4.2.13.2.27 --- php-src/sapi/cgi/fastcgi.c:1.4.2.13.2.26Mon May 21 09:08:13 2007 +++ php-src/sapi/cgi/fastcgi.c Mon Jul 9 11:48:39 2007 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: fastcgi.c,v 1.4.2.13.2.26 2007/05/21 09:08:13 dmitry Exp $ */ +/* $Id: fastcgi.c,v 1.4.2.13.2.27 2007/07/09 11:48:39 dmitry Exp $ */ #include php.h #include fastcgi.h @@ -927,7 +927,11 @@ } } +#ifdef _WIN32 if (req-fd 0 (in_shutdown || errno != EINTR)) { +#else + if (req-fd 0 (in_shutdown || (errno != EINTR errno != ECONNABORTED))) { +#endif return -1; } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/standard var_unserializer.c var_unserializer.re
dmitry Mon Jul 9 13:43:51 2007 UTC Modified files: /php-src/ext/standard var_unserializer.c var_unserializer.re Log: Fixed deserialization of escaped strings http://cvs.php.net/viewvc.cgi/php-src/ext/standard/var_unserializer.c?r1=1.86r2=1.87diff_format=u Index: php-src/ext/standard/var_unserializer.c diff -u php-src/ext/standard/var_unserializer.c:1.86 php-src/ext/standard/var_unserializer.c:1.87 --- php-src/ext/standard/var_unserializer.c:1.86Tue Mar 27 09:28:49 2007 +++ php-src/ext/standard/var_unserializer.c Mon Jul 9 13:43:50 2007 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: var_unserializer.c,v 1.86 2007/03/27 09:28:49 tony2001 Exp $ */ +/* $Id: var_unserializer.c,v 1.87 2007/07/09 13:43:50 dmitry Exp $ */ #include php.h #include ext/standard/php_var.h @@ -142,6 +142,7 @@ return NULL; } } + end += 2; str[i] = (char)ch; } (*p)++; http://cvs.php.net/viewvc.cgi/php-src/ext/standard/var_unserializer.re?r1=1.64r2=1.65diff_format=u Index: php-src/ext/standard/var_unserializer.re diff -u php-src/ext/standard/var_unserializer.re:1.64 php-src/ext/standard/var_unserializer.re:1.65 --- php-src/ext/standard/var_unserializer.re:1.64 Tue Mar 27 09:28:49 2007 +++ php-src/ext/standard/var_unserializer.reMon Jul 9 13:43:50 2007 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: var_unserializer.re,v 1.64 2007/03/27 09:28:49 tony2001 Exp $ */ +/* $Id: var_unserializer.re,v 1.65 2007/07/09 13:43:50 dmitry Exp $ */ #include php.h #include ext/standard/php_var.h @@ -140,6 +140,7 @@ return NULL; } } + end += 2; str[i] = (char)ch; } (*p)++; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_2) /ext/standard var_unserializer.c var_unserializer.re /ext/standard/tests/serialize unserializeS.phpt
dmitry Mon Jul 9 14:31:56 2007 UTC Modified files: (Branch: PHP_5_2) /php-src/ext/standard var_unserializer.c var_unserializer.re /php-src/ext/standard/tests/serialize unserializeS.phpt Log: Proper fix for MOPB-29 http://cvs.php.net/viewvc.cgi/php-src/ext/standard/var_unserializer.c?r1=1.70.2.4.2.5r2=1.70.2.4.2.6diff_format=u Index: php-src/ext/standard/var_unserializer.c diff -u php-src/ext/standard/var_unserializer.c:1.70.2.4.2.5 php-src/ext/standard/var_unserializer.c:1.70.2.4.2.6 --- php-src/ext/standard/var_unserializer.c:1.70.2.4.2.5Tue Mar 27 09:29:10 2007 +++ php-src/ext/standard/var_unserializer.c Mon Jul 9 14:31:56 2007 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: var_unserializer.c,v 1.70.2.4.2.5 2007/03/27 09:29:10 tony2001 Exp $ */ +/* $Id: var_unserializer.c,v 1.70.2.4.2.6 2007/07/09 14:31:56 dmitry Exp $ */ #include php.h #include ext/standard/php_var.h @@ -140,18 +140,22 @@ /* }}} */ -static char *unserialize_str(const unsigned char **p, size_t *len) +static char *unserialize_str(const unsigned char **p, size_t *len, size_t maxlen) { size_t i, j; char *str = safe_emalloc(*len, 1, 1); - unsigned char *end = *(unsigned char **)p+*len; + unsigned char *end = *(unsigned char **)p+maxlen; if(end *p) { efree(str); return NULL; } - for (i = 0; i *len *p end; i++) { + for (i = 0; i *len; i++) { + if (*p = end) { + efree(str); + return NULL; + } if (**p != '\\') { str[i] = (char)**p; } else { @@ -757,7 +761,7 @@ return 0; } - if ((str = unserialize_str(YYCURSOR, len)) == NULL) { + if ((str = unserialize_str(YYCURSOR, len, maxlen)) == NULL) { return 0; } http://cvs.php.net/viewvc.cgi/php-src/ext/standard/var_unserializer.re?r1=1.52.2.2.2.3r2=1.52.2.2.2.4diff_format=u Index: php-src/ext/standard/var_unserializer.re diff -u php-src/ext/standard/var_unserializer.re:1.52.2.2.2.3 php-src/ext/standard/var_unserializer.re:1.52.2.2.2.4 --- php-src/ext/standard/var_unserializer.re:1.52.2.2.2.3 Tue Mar 27 09:29:10 2007 +++ php-src/ext/standard/var_unserializer.reMon Jul 9 14:31:56 2007 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: var_unserializer.re,v 1.52.2.2.2.3 2007/03/27 09:29:10 tony2001 Exp $ */ +/* $Id: var_unserializer.re,v 1.52.2.2.2.4 2007/07/09 14:31:56 dmitry Exp $ */ #include php.h #include ext/standard/php_var.h @@ -138,18 +138,22 @@ /* }}} */ -static char *unserialize_str(const unsigned char **p, size_t *len) +static char *unserialize_str(const unsigned char **p, size_t *len, size_t maxlen) { size_t i, j; char *str = safe_emalloc(*len, 1, 1); - unsigned char *end = *(unsigned char **)p+*len; + unsigned char *end = *(unsigned char **)p+maxlen; if(end *p) { efree(str); return NULL; } - for (i = 0; i *len *p end; i++) { + for (i = 0; i *len; i++) { + if (*p = end) { + efree(str); + return NULL; + } if (**p != '\\') { str[i] = (char)**p; } else { @@ -525,7 +529,7 @@ return 0; } - if ((str = unserialize_str(YYCURSOR, len)) == NULL) { + if ((str = unserialize_str(YYCURSOR, len, maxlen)) == NULL) { return 0; } http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/serialize/unserializeS.phpt?r1=1.1.2.1r2=1.1.2.2diff_format=u Index: php-src/ext/standard/tests/serialize/unserializeS.phpt diff -u php-src/ext/standard/tests/serialize/unserializeS.phpt:1.1.2.1 php-src/ext/standard/tests/serialize/unserializeS.phpt:1.1.2.2 --- php-src/ext/standard/tests/serialize/unserializeS.phpt:1.1.2.1 Fri Mar 23 20:15:22 2007 +++ php-src/ext/standard/tests/serialize/unserializeS.phpt Mon Jul 9 14:31:56 2007 @@ -11,4 +11,4 @@ var_dump($data); --EXPECT-- -string(100) +bool(false) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/standard array.c
dmitry Mon Jul 9 14:32:59 2007 UTC Modified files: /php-src/ext/standard array.c Log: wrong condition http://cvs.php.net/viewvc.cgi/php-src/ext/standard/array.c?r1=1.410r2=1.411diff_format=u Index: php-src/ext/standard/array.c diff -u php-src/ext/standard/array.c:1.410 php-src/ext/standard/array.c:1.411 --- php-src/ext/standard/array.c:1.410 Thu Jun 28 16:06:23 2007 +++ php-src/ext/standard/array.cMon Jul 9 14:32:59 2007 @@ -21,7 +21,7 @@ +--+ */ -/* $Id: array.c,v 1.410 2007/06/28 16:06:23 tony2001 Exp $ */ +/* $Id: array.c,v 1.411 2007/07/09 14:32:59 dmitry Exp $ */ #include php.h #include php_ini.h @@ -1403,7 +1403,7 @@ if (prefix) { convert_to_text(prefix); - if (Z_UNILEN_P(prefix) !php_valid_var_name(Z_UNIVAL_P(prefix), Z_UNILEN_P(prefix), Z_TYPE_P(prefix))) { + if (!Z_UNILEN_P(prefix) || !php_valid_var_name(Z_UNIVAL_P(prefix), Z_UNILEN_P(prefix), Z_TYPE_P(prefix))) { php_error_docref(NULL TSRMLS_CC, E_WARNING, prefix is not a valid identifier); return; } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/standard var_unserializer.c var_unserializer.re /ext/standard/tests/serialize unserializeS.phpt
dmitry Mon Jul 9 14:33:37 2007 UTC Modified files: /php-src/ext/standard var_unserializer.c var_unserializer.re /php-src/ext/standard/tests/serialize unserializeS.phpt Log: Proper fix for MOPB-29 http://cvs.php.net/viewvc.cgi/php-src/ext/standard/var_unserializer.c?r1=1.87r2=1.88diff_format=u Index: php-src/ext/standard/var_unserializer.c diff -u php-src/ext/standard/var_unserializer.c:1.87 php-src/ext/standard/var_unserializer.c:1.88 --- php-src/ext/standard/var_unserializer.c:1.87Mon Jul 9 13:43:50 2007 +++ php-src/ext/standard/var_unserializer.c Mon Jul 9 14:33:37 2007 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: var_unserializer.c,v 1.87 2007/07/09 13:43:50 dmitry Exp $ */ +/* $Id: var_unserializer.c,v 1.88 2007/07/09 14:33:37 dmitry Exp $ */ #include php.h #include ext/standard/php_var.h @@ -112,18 +112,22 @@ return ustr; } -static char *unserialize_str(const unsigned char **p, int *len) +static char *unserialize_str(const unsigned char **p, size_t *len, size_t maxlen) { size_t i, j; char *str = safe_emalloc(*len, 1, 1); - unsigned char *end = *(unsigned char **)p+*len; + unsigned char *end = *(unsigned char **)p+maxlen; if(end *p) { efree(str); return NULL; } - for (i = 0; i *len *p end; i++) { + for (i = 0; i *len; i++) { + if (*p = end) { + efree(str); + return NULL; + } if (**p != '\\') { str[i] = (char)**p; } else { @@ -142,7 +146,6 @@ return NULL; } } - end += 2; str[i] = (char)ch; } (*p)++; @@ -866,7 +869,7 @@ return 0; } - if ((str = unserialize_str(YYCURSOR, len)) == NULL) { + if ((str = unserialize_str(YYCURSOR, len, maxlen)) == NULL) { return 0; } http://cvs.php.net/viewvc.cgi/php-src/ext/standard/var_unserializer.re?r1=1.65r2=1.66diff_format=u Index: php-src/ext/standard/var_unserializer.re diff -u php-src/ext/standard/var_unserializer.re:1.65 php-src/ext/standard/var_unserializer.re:1.66 --- php-src/ext/standard/var_unserializer.re:1.65 Mon Jul 9 13:43:50 2007 +++ php-src/ext/standard/var_unserializer.reMon Jul 9 14:33:37 2007 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: var_unserializer.re,v 1.65 2007/07/09 13:43:50 dmitry Exp $ */ +/* $Id: var_unserializer.re,v 1.66 2007/07/09 14:33:37 dmitry Exp $ */ #include php.h #include ext/standard/php_var.h @@ -110,18 +110,22 @@ return ustr; } -static char *unserialize_str(const unsigned char **p, int *len) +static char *unserialize_str(const unsigned char **p, size_t *len, size_t maxlen) { size_t i, j; char *str = safe_emalloc(*len, 1, 1); - unsigned char *end = *(unsigned char **)p+*len; + unsigned char *end = *(unsigned char **)p+maxlen; if(end *p) { efree(str); return NULL; } - for (i = 0; i *len *p end; i++) { + for (i = 0; i *len; i++) { + if (*p = end) { + efree(str); + return NULL; + } if (**p != '\\') { str[i] = (char)**p; } else { @@ -140,7 +144,6 @@ return NULL; } } - end += 2; str[i] = (char)ch; } (*p)++; @@ -578,7 +581,7 @@ return 0; } - if ((str = unserialize_str(YYCURSOR, len)) == NULL) { + if ((str = unserialize_str(YYCURSOR, len, maxlen)) == NULL) { return 0; } http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/serialize/unserializeS.phpt?r1=1.2r2=1.3diff_format=u Index: php-src/ext/standard/tests/serialize/unserializeS.phpt diff -u php-src/ext/standard/tests/serialize/unserializeS.phpt:1.2 php-src/ext/standard/tests/serialize/unserializeS.phpt:1.3 --- php-src/ext/standard/tests/serialize/unserializeS.phpt:1.2 Fri Mar 23 20:34:11 2007 +++ php-src/ext/standard/tests/serialize/unserializeS.phpt Mon Jul 9 14:33:37 2007 @@ -11,4 +11,4 @@ var_dump($data); --EXPECT-- -string(100) +bool(false) -- 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 count_recursive.phpt
dmitry Mon Jul 9 15:27:58 2007 UTC Modified files: /php-src/ext/standard/tests/array count_recursive.phpt Log: Fixed test http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/array/count_recursive.phpt?r1=1.6r2=1.7diff_format=u Index: php-src/ext/standard/tests/array/count_recursive.phpt diff -u php-src/ext/standard/tests/array/count_recursive.phpt:1.6 php-src/ext/standard/tests/array/count_recursive.phpt:1.7 --- php-src/ext/standard/tests/array/count_recursive.phpt:1.6 Fri Apr 20 21:13:45 2007 +++ php-src/ext/standard/tests/array/count_recursive.phpt Mon Jul 9 15:27:58 2007 @@ -224,13 +224,13 @@ Notice: Use of undefined constant ABCD - assumed 'ABCD' in %s on line %d -Warning: count() expects parameter 2 to be long, string given in %s on line %d +Warning: count() expects parameter 2 to be long, %s given in %s on line %d NULL -Warning: count() expects parameter 2 to be long, string given in %s on line %d +Warning: count() expects parameter 2 to be long, %s given in %s on line %d NULL -Warning: count() expects parameter 2 to be long, string given in %s on line %d +Warning: count() expects parameter 2 to be long, %s given in %s on line %d NULL Done -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/standard var_unserializer.c var_unserializer.re
dmitry Mon Jul 9 15:58:52 2007 UTC Modified files: /php-src/ext/standard var_unserializer.c var_unserializer.re Log: Fixed custom unserialixe() in unicode mode http://cvs.php.net/viewvc.cgi/php-src/ext/standard/var_unserializer.c?r1=1.88r2=1.89diff_format=u Index: php-src/ext/standard/var_unserializer.c diff -u php-src/ext/standard/var_unserializer.c:1.88 php-src/ext/standard/var_unserializer.c:1.89 --- php-src/ext/standard/var_unserializer.c:1.88Mon Jul 9 14:33:37 2007 +++ php-src/ext/standard/var_unserializer.c Mon Jul 9 15:58:52 2007 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: var_unserializer.c,v 1.88 2007/07/09 14:33:37 dmitry Exp $ */ +/* $Id: var_unserializer.c,v 1.89 2007/07/09 15:58:52 dmitry Exp $ */ #include php.h #include ext/standard/php_var.h @@ -359,6 +359,8 @@ { long datalen; int type; + zstr buf; + size_t buf_len; if(ce-unserialize == NULL) { zend_error(E_WARNING, Class %v has no unserializer, ce-name); @@ -389,11 +391,23 @@ return 0; } - if(ce-unserialize(rval, ce, type, ZSTR((char*)*p), datalen, (zend_unserialize_data *)var_hash TSRMLS_CC) != SUCCESS) { + if (type == IS_UNICODE) { + buf.u = unserialize_ustr(p, datalen); + buf_len = u_strlen(buf.u); + } else { + buf.s = (char*)*p; + buf_len = datalen; + (*p) += datalen; + } + if(ce-unserialize(rval, ce, type, buf, buf_len, (zend_unserialize_data *)var_hash TSRMLS_CC) != SUCCESS) { + if (type == IS_UNICODE) { + efree(buf.v); + } return 0; } - - (*p) += datalen; + if (type == IS_UNICODE) { + efree(buf.v); + } return finish_nested_data(UNSERIALIZE_PASSTHRU); } http://cvs.php.net/viewvc.cgi/php-src/ext/standard/var_unserializer.re?r1=1.66r2=1.67diff_format=u Index: php-src/ext/standard/var_unserializer.re diff -u php-src/ext/standard/var_unserializer.re:1.66 php-src/ext/standard/var_unserializer.re:1.67 --- php-src/ext/standard/var_unserializer.re:1.66 Mon Jul 9 14:33:37 2007 +++ php-src/ext/standard/var_unserializer.reMon Jul 9 15:58:52 2007 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: var_unserializer.re,v 1.66 2007/07/09 14:33:37 dmitry Exp $ */ +/* $Id: var_unserializer.re,v 1.67 2007/07/09 15:58:52 dmitry Exp $ */ #include php.h #include ext/standard/php_var.h @@ -363,6 +363,8 @@ { long datalen; int type; + zstr buf; + size_t buf_len; if(ce-unserialize == NULL) { zend_error(E_WARNING, Class %v has no unserializer, ce-name); @@ -393,11 +395,23 @@ return 0; } - if(ce-unserialize(rval, ce, type, ZSTR((char*)*p), datalen, (zend_unserialize_data *)var_hash TSRMLS_CC) != SUCCESS) { + if (type == IS_UNICODE) { + buf.u = unserialize_ustr(p, datalen); + buf_len = u_strlen(buf.u); + } else { + buf.s = (char*)*p; + buf_len = datalen; + (*p) += datalen; + } + if(ce-unserialize(rval, ce, type, buf, buf_len, (zend_unserialize_data *)var_hash TSRMLS_CC) != SUCCESS) { + if (type == IS_UNICODE) { + efree(buf.v); + } return 0; } - - (*p) += datalen; + if (type == IS_UNICODE) { + efree(buf.v); + } return finish_nested_data(UNSERIALIZE_PASSTHRU); } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /main php_streams.h
dmitry Mon Jul 9 16:42:45 2007 UTC Modified files: /php-src/main php_streams.h Log: wrong comments http://cvs.php.net/viewvc.cgi/php-src/main/php_streams.h?r1=1.129r2=1.130diff_format=u Index: php-src/main/php_streams.h diff -u php-src/main/php_streams.h:1.129 php-src/main/php_streams.h:1.130 --- php-src/main/php_streams.h:1.129Tue Jul 3 10:22:55 2007 +++ php-src/main/php_streams.h Mon Jul 9 16:42:45 2007 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: php_streams.h,v 1.129 2007/07/03 10:22:55 dmitry Exp $ */ +/* $Id: php_streams.h,v 1.130 2007/07/09 16:42:45 dmitry Exp $ */ #ifndef PHP_STREAMS_H #define PHP_STREAMS_H @@ -619,7 +619,7 @@ /* use glob stream for directory open in plain files stream */ #define STREAM_USE_GLOB_DIR_OPEN0x1000 -/* use glob stream for directory open in plain files stream */ +/* don't check allow_url_fopen and allow_url_include */ #define STREAM_DISABLE_URL_PROTECTION 0x2000 /* Antique - no longer has meaning */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_2) /ext/standard basic_functions.c streamsfuncs.c streamsfuncs.h /ext/standard/tests/file include_userstream_001.phpt include_userstream_002.phpt /main main.c php_global
dmitry Mon Jul 9 17:27:24 2007 UTC Added files: (Branch: PHP_5_2) /php-src/ext/standard/tests/fileinclude_userstream_001.phpt include_userstream_002.phpt Modified files: /php-src/main main.c php_globals.h php_streams.h /php-src/main/streams streams.c userspace.c /php-src/ext/standard basic_functions.c streamsfuncs.c streamsfuncs.h Log: Added ability to create local or remote (URL) user streams Local user streams must not be able to open(), URLs if allow_url_include is off Implemented new function stream_is_local() [ - stream_wrapper_register() extended with additional optional argument flags of type long. This time only one flag is implemented - STREAM_IS_URL, that means that userstream wrapper is remote (URL). By default stream is local. - stream_is_local() is a new function that accepts stream and tell if this stream is local or remote (URL) ] http://cvs.php.net/viewvc.cgi/php-src/main/main.c?r1=1.640.2.23.2.38r2=1.640.2.23.2.39diff_format=u Index: php-src/main/main.c diff -u php-src/main/main.c:1.640.2.23.2.38 php-src/main/main.c:1.640.2.23.2.39 --- php-src/main/main.c:1.640.2.23.2.38 Fri Jun 15 09:20:27 2007 +++ php-src/main/main.c Mon Jul 9 17:27:23 2007 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: main.c,v 1.640.2.23.2.38 2007/06/15 09:20:27 dmitry Exp $ */ +/* $Id: main.c,v 1.640.2.23.2.39 2007/07/09 17:27:23 dmitry Exp $ */ /* {{{ includes */ @@ -1121,6 +1121,7 @@ PG(modules_activated) = 0; PG(header_is_being_sent) = 0; PG(connection_status) = PHP_CONNECTION_NORMAL; + PG(in_user_include) = 0; zend_activate(TSRMLS_C); sapi_activate(TSRMLS_C); http://cvs.php.net/viewvc.cgi/php-src/main/php_globals.h?r1=1.98.2.1.2.5r2=1.98.2.1.2.6diff_format=u Index: php-src/main/php_globals.h diff -u php-src/main/php_globals.h:1.98.2.1.2.5 php-src/main/php_globals.h:1.98.2.1.2.6 --- php-src/main/php_globals.h:1.98.2.1.2.5 Fri Mar 2 21:58:05 2007 +++ php-src/main/php_globals.h Mon Jul 9 17:27:23 2007 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: php_globals.h,v 1.98.2.1.2.5 2007/03/02 21:58:05 stas Exp $ */ +/* $Id: php_globals.h,v 1.98.2.1.2.6 2007/07/09 17:27:23 dmitry Exp $ */ #ifndef PHP_GLOBALS_H #define PHP_GLOBALS_H @@ -156,6 +156,7 @@ zend_bool com_initialized; #endif long max_input_nesting_level; + zend_bool in_user_include; }; http://cvs.php.net/viewvc.cgi/php-src/main/php_streams.h?r1=1.103.2.1.2.2r2=1.103.2.1.2.3diff_format=u Index: php-src/main/php_streams.h diff -u php-src/main/php_streams.h:1.103.2.1.2.2 php-src/main/php_streams.h:1.103.2.1.2.3 --- php-src/main/php_streams.h:1.103.2.1.2.2Wed Feb 21 21:57:21 2007 +++ php-src/main/php_streams.h Mon Jul 9 17:27:23 2007 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: php_streams.h,v 1.103.2.1.2.2 2007/02/21 21:57:21 tony2001 Exp $ */ +/* $Id: php_streams.h,v 1.103.2.1.2.3 2007/07/09 17:27:23 dmitry Exp $ */ #ifndef PHP_STREAMS_H #define PHP_STREAMS_H @@ -499,6 +499,9 @@ /* get (or create) a persistent version of the stream */ #define STREAM_OPEN_PERSISTENT 2048 +/* don't check allow_url_fopen and allow_url_include */ +#define STREAM_DISABLE_URL_PROTECTION 0x2000 + /* Antique - no longer has meaning */ #define IGNORE_URL_WIN 0 @@ -550,6 +553,9 @@ END_EXTERN_C() #endif +/* Definitions for user streams */ +#define PHP_STREAM_IS_URL 1 + /* * Local variables: * tab-width: 4 http://cvs.php.net/viewvc.cgi/php-src/main/streams/streams.c?r1=1.82.2.6.2.13r2=1.82.2.6.2.14diff_format=u Index: php-src/main/streams/streams.c diff -u php-src/main/streams/streams.c:1.82.2.6.2.13 php-src/main/streams/streams.c:1.82.2.6.2.14 --- php-src/main/streams/streams.c:1.82.2.6.2.13Tue May 8 12:08:17 2007 +++ php-src/main/streams/streams.c Mon Jul 9 17:27:23 2007 @@ -19,7 +19,7 @@ +--+ */ -/* $Id: streams.c,v 1.82.2.6.2.13 2007/05/08 12:08:17 dmitry Exp $ */ +/* $Id: streams.c,v 1.82.2.6.2.14 2007/07/09 17:27:23 dmitry Exp $ */ #define _GNU_SOURCE #include php.h @@ -1606,7 +1606,11 @@ return php_plain_files_wrapper; } - if ((wrapperpp (*wrapperpp)-is_url) (!PG(allow_url_fopen) || ((options STREAM_OPEN_FOR_INCLUDE) !PG(allow_url_include))) ) { + if (wrapperpp (*wrapperpp)-is_url +(options STREAM_DISABLE_URL_PROTECTION) == 0 + (!PG(allow_url_fopen) || +((options STREAM_OPEN_FOR_INCLUDE) || +
[PHP-CVS] cvs: php-src /ext/dom/tests dom005.phpt
dmitry Tue Jul 10 07:26:22 2007 UTC Modified files: /php-src/ext/dom/tests dom005.phpt Log: Fixed test http://cvs.php.net/viewvc.cgi/php-src/ext/dom/tests/dom005.phpt?r1=1.5r2=1.6diff_format=u Index: php-src/ext/dom/tests/dom005.phpt diff -u php-src/ext/dom/tests/dom005.phpt:1.5 php-src/ext/dom/tests/dom005.phpt:1.6 --- php-src/ext/dom/tests/dom005.phpt:1.5 Sun Nov 6 10:53:39 2005 +++ php-src/ext/dom/tests/dom005.phpt Tue Jul 10 07:26:22 2007 @@ -11,6 +11,7 @@ print adjustDoctype($dom-saveXML()); print --- save as HTML\n; +$dom-formatOutput = true; print adjustDoctype($dom-saveHTML()); function adjustDoctype($xml) { -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/date/tests date_create-3.phpt
dmitry Tue Jul 10 07:29:06 2007 UTC Modified files: /php-src/ext/date/tests date_create-3.phpt Log: Fixed test http://cvs.php.net/viewvc.cgi/php-src/ext/date/tests/date_create-3.phpt?r1=1.4r2=1.5diff_format=u Index: php-src/ext/date/tests/date_create-3.phpt diff -u php-src/ext/date/tests/date_create-3.phpt:1.4 php-src/ext/date/tests/date_create-3.phpt:1.5 --- php-src/ext/date/tests/date_create-3.phpt:1.4 Mon Aug 7 21:06:21 2006 +++ php-src/ext/date/tests/date_create-3.phpt Tue Jul 10 07:29:06 2007 @@ -10,4 +10,4 @@ ? --EXPECT-- 2005-12-31T00:00:00+0100 -2005-12-31T00:00:00+0100 +2005-12-30T23:00:00+ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/json/tests pass001.1.phpt
dmitry Tue Jul 10 07:51:23 2007 UTC Modified files: /php-src/ext/json/tests pass001.1.phpt Log: Fixed test http://cvs.php.net/viewvc.cgi/php-src/ext/json/tests/pass001.1.phpt?r1=1.8r2=1.9diff_format=u Index: php-src/ext/json/tests/pass001.1.phpt diff -u php-src/ext/json/tests/pass001.1.phpt:1.8 php-src/ext/json/tests/pass001.1.phpt:1.9 --- php-src/ext/json/tests/pass001.1.phpt:1.8 Fri Jun 8 09:03:23 2007 +++ php-src/ext/json/tests/pass001.1.phpt Tue Jul 10 07:51:23 2007 @@ -383,7 +383,7 @@ float(1.23456789E-13) [E]= float(1.23456789E+34) -[_empty_]= +[]= float(INF) [E no .]= float(4) @@ -527,9 +527,9 @@ string(7) rosebud } ENCODE: FROM OBJECT -[JSON Test Pattern pass1,{object with 1 member:[array with 1 element]},{},[],-42,true,false,null,{integer:1234567890,real:-9876.54321,e:1.23456789e-13,E:1.23456789e+34,_empty_:0,E no .:4.0e+12,zero:0,one:1,space: ,quote:\,backslash:\\,controls:\b\f\n\r\t,slash:\/ \/,alpha:abcdefghijklmnopqrstuvwyz,ALPHA:ABCDEFGHIJKLMNOPQRSTUVWYZ,digit:0123456789,special:[EMAIL PROTECTED]*()_+-={':[,]}|;.\/?,hex:\u0123\u4567\u89ab\ucdef\uabcd\uef4a,unicode:\u30d7\u30ec\u30b9\u30ad\u30c3\u30c8,\u30d7\u30ec\u30b9\u30ad\u30c3\u30c8:\u30d7\u30ec\u30b9\u30ad\u30c3\u30c8,empty_string:,true:true,false:false,null:null,array:[],object:{},123:{456:{abc:{789:def,012:[1,2,5,500],ghi:[1,2,five,50,sixty]}}},address:50 St. James Street,url:http:\/\/www.JSON.org\/,comment:\/\/ \/* !-- --,# -- -- *\/: , s p a c e d :[1,2,3,4,5,6,7],compact:[1,2,3,4,5,6,7],jsontext:{\object with 1 me! mber\:[\array with 1 element\]},quotes:#34; \ %22 0x22 034 #x22;,\/\\\[EMAIL PROTECTED]*()_+-=[]{}|;:',.\/?:A key can be any string},0.5,98.6,99.44,1066,rosebud] +[JSON Test Pattern pass1,{object with 1 member:[array with 1 element]},{},[],-42,true,false,null,{integer:1234567890,real:-9876.54321,e:1.23456789e-13,E:1.23456789e+34,_empty_:0,E no .:4,zero:0,one:1,space: ,quote:\,backslash:\\,controls:\b\f\n\r\t,slash:\/ \/,alpha:abcdefghijklmnopqrstuvwyz,ALPHA:ABCDEFGHIJKLMNOPQRSTUVWYZ,digit:0123456789,special:[EMAIL PROTECTED]*()_+-={':[,]}|;.\/?,hex:\u0123\u4567\u89ab\ucdef\uabcd\uef4a,unicode:\u30d7\u30ec\u30b9\u30ad\u30c3\u30c8,\u30d7\u30ec\u30b9\u30ad\u30c3\u30c8:\u30d7\u30ec\u30b9\u30ad\u30c3\u30c8,empty_string:,true:true,false:false,null:null,array:[],object:{},123:{456:{abc:{789:def,012:[1,2,5,500],ghi:[1,2,five,50,sixty]}}},address:50 St. James Street,url:http:\/\/www.JSON.org\/,comment:\/\/ \/* !-- --,# -- -- *\/: , s p a c e d :[1,2,3,4,5,6,7],compact:[1,2,3,4,5,6,7],jsontext:{\object wit! h 1 member\:[\array with 1 element\]},quotes:#34; \ %22 0x22 034 #x22;,\/\\\[EMAIL PROTECTED]*()_+-=[]{}|;:',.\/?:A key can be any string},0.5,98.6,99.44,1066,rosebud] ENCODE: FROM ARRAY -[JSON Test Pattern pass1,{object with 1 member:[array with 1 element]},[],[],-42,true,false,null,{integer:1234567890,real:-9876.54321,e:1.23456789e-13,E:1.23456789e+34,_empty_:0,E no .:4.0e+12,zero:0,one:1,space: ,quote:\,backslash:\\,controls:\b\f\n\r\t,slash:\/ \/,alpha:abcdefghijklmnopqrstuvwyz,ALPHA:ABCDEFGHIJKLMNOPQRSTUVWYZ,digit:0123456789,special:[EMAIL PROTECTED]*()_+-={':[,]}|;.\/?,hex:\u0123\u4567\u89ab\ucdef\uabcd\uef4a,unicode:\u30d7\u30ec\u30b9\u30ad\u30c3\u30c8,\u30d7\u30ec\u30b9\u30ad\u30c3\u30c8:\u30d7\u30ec\u30b9\u30ad\u30c3\u30c8,empty_string:,true:true,false:false,null:null,array:[],object:[],123:{456:{abc:{789:def,012:[1,2,5,500],ghi:[1,2,five,50,sixty]}}},address:50 St. James Street,url:http:\/\/www.JSON.org\/,comment:\/\/ \/* !-- --,# -- -- *\/: , s p a c e d :[1,2,3,4,5,6,7],compact:[1,2,3,4,5,6,7],jsontext:{\object with 1 me! mber\:[\array with 1 element\]},quotes:#34; \ %22 0x22 034 #x22;,\/\\\[EMAIL PROTECTED]*()_+-=[]{}|;:',.\/?:A key can be any string},0.5,98.6,99.44,1066,rosebud] +[JSON Test Pattern pass1,{object with 1 member:[array with 1 element]},[],[],-42,true,false,null,{integer:1234567890,real:-9876.54321,e:1.23456789e-13,E:1.23456789e+34,:0,E no .:4,zero:0,one:1,space: ,quote:\,backslash:\\,controls:\b\f\n\r\t,slash:\/ \/,alpha:abcdefghijklmnopqrstuvwyz,ALPHA:ABCDEFGHIJKLMNOPQRSTUVWYZ,digit:0123456789,special:[EMAIL PROTECTED]*()_+-={':[,]}|;.\/?,hex:\u0123\u4567\u89ab\ucdef\uabcd\uef4a,unicode:\u30d7\u30ec\u30b9\u30ad\u30c3\u30c8,\u30d7\u30ec\u30b9\u30ad\u30c3\u30c8:\u30d7\u30ec\u30b9\u30ad\u30c3\u30c8,empty_string:,true:true,false:false,null:null,array:[],object:[],123:{456:{abc:{789:def,012:[1,2,5,500],ghi:[1,2,five,50,sixty]}}},address:50 St. James Street,url:http:\/\/www.JSON.org\/,comment:\/\/ \/* !-- --,# -- -- *\/: , s p a c e d :[1,2,3,4,5,6,7],compact:[1,2,3,4,5,6,7],jsontext:{\object with 1 mem! ber\:[\array with 1 element\]},quotes:#34; \ %22 0x22 034 #x22;,\/\\\[EMAIL PROTECTED]*()_+-=[]{}|;:',.\/?:A key can be any string},0.5,98.6,99.44,1066,rosebud] DECODE AGAIN: AS OBJECT array(14) { [0]= @@ -569,7
[PHP-CVS] cvs: php-src /ext/openssl openssl.c
dmitry Tue Jul 10 07:57:15 2007 UTC Modified files: /php-src/ext/opensslopenssl.c Log: Fixed bug #41353 http://cvs.php.net/viewvc.cgi/php-src/ext/openssl/openssl.c?r1=1.141r2=1.142diff_format=u Index: php-src/ext/openssl/openssl.c diff -u php-src/ext/openssl/openssl.c:1.141 php-src/ext/openssl/openssl.c:1.142 --- php-src/ext/openssl/openssl.c:1.141 Wed Jun 20 05:27:38 2007 +++ php-src/ext/openssl/openssl.c Tue Jul 10 07:57:15 2007 @@ -20,7 +20,7 @@ +--+ */ -/* $Id: openssl.c,v 1.141 2007/06/20 05:27:38 pajoye Exp $ */ +/* $Id: openssl.c,v 1.142 2007/07/10 07:57:15 dmitry Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -1559,7 +1559,7 @@ BIO * bio_in = NULL; int i; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, szs, zp12, zout, pass, pass_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, szs, zp12, zp12_len, zout, pass, pass_len) == FAILURE) { return; } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/pcre php_pcre.c /ext/pcre/tests bug21732.phpt
dmitry Tue Jul 10 09:11:35 2007 UTC Modified files: /php-src/ext/pcre php_pcre.c /php-src/ext/pcre/tests bug21732.phpt Log: Fixed preg_replace_callback() with callback defined by array http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/php_pcre.c?r1=1.214r2=1.215diff_format=u Index: php-src/ext/pcre/php_pcre.c diff -u php-src/ext/pcre/php_pcre.c:1.214 php-src/ext/pcre/php_pcre.c:1.215 --- php-src/ext/pcre/php_pcre.c:1.214 Fri Jul 6 23:06:51 2007 +++ php-src/ext/pcre/php_pcre.c Tue Jul 10 09:11:35 2007 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: php_pcre.c,v 1.214 2007/07/06 23:06:51 dmitry Exp $ */ +/* $Id: php_pcre.c,v 1.215 2007/07/10 09:11:35 dmitry Exp $ */ /* TODO * php_pcre_replace_impl(): @@ -1422,7 +1422,9 @@ } if (is_callable_replace) { - convert_to_text(replace); + if (Z_TYPE_P(replace) != IS_ARRAY) { + convert_to_text(replace); + } if (!zend_is_callable(replace, 0, callback_name)) { php_error_docref(NULL TSRMLS_CC, E_WARNING, Requires argument 2, '%R', to be a valid callback, Z_TYPE(callback_name), Z_UNIVAL(callback_name)); zval_dtor(callback_name); http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/tests/bug21732.phpt?r1=1.2r2=1.3diff_format=u Index: php-src/ext/pcre/tests/bug21732.phpt diff -u php-src/ext/pcre/tests/bug21732.phpt:1.2 php-src/ext/pcre/tests/bug21732.phpt:1.3 --- php-src/ext/pcre/tests/bug21732.phpt:1.2Thu Jan 23 18:48:43 2003 +++ php-src/ext/pcre/tests/bug21732.phptTue Jul 10 09:11:35 2007 @@ -27,3 +27,16 @@ string(1) e } string(4) yes! +--UEXPECT-- +bool(false) +array(4) { + [0]= + unicode(5) abcde + [1]= + unicode(2) ab + [2]= + unicode(2) cd + [3]= + unicode(1) e +} +unicode(4) yes! -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/spl/tests bug33136.phpt
dmitry Tue Jul 10 10:16:14 2007 UTC Modified files: /php-src/ext/spl/tests bug33136.phpt Log: Fixed test http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/bug33136.phpt?r1=1.5r2=1.6diff_format=u Index: php-src/ext/spl/tests/bug33136.phpt diff -u php-src/ext/spl/tests/bug33136.phpt:1.5 php-src/ext/spl/tests/bug33136.phpt:1.6 --- php-src/ext/spl/tests/bug33136.phpt:1.5 Mon May 7 17:23:02 2007 +++ php-src/ext/spl/tests/bug33136.phpt Tue Jul 10 10:16:14 2007 @@ -68,9 +68,6 @@ ( [data:Collection:private] = Array ( -[0] = foo -[1] = bar -[foo] = baz ) [storage:ArrayObject:private] = Array @@ -101,9 +98,6 @@ ( [data:Collection:private] = Array ( -[0] = foo -[1] = bar -[foo] = baz ) [storage:ArrayObject:private] = Array -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/pcre php_pcre.c
dmitry Tue Jul 10 09:57:23 2007 UTC Modified files: /php-src/ext/pcre php_pcre.c Log: Fixed compilation warnings http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/php_pcre.c?r1=1.215r2=1.216diff_format=u Index: php-src/ext/pcre/php_pcre.c diff -u php-src/ext/pcre/php_pcre.c:1.215 php-src/ext/pcre/php_pcre.c:1.216 --- php-src/ext/pcre/php_pcre.c:1.215 Tue Jul 10 09:11:35 2007 +++ php-src/ext/pcre/php_pcre.c Tue Jul 10 09:57:23 2007 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: php_pcre.c,v 1.215 2007/07/10 09:11:35 dmitry Exp $ */ +/* $Id: php_pcre.c,v 1.216 2007/07/10 09:57:23 dmitry Exp $ */ /* TODO * php_pcre_replace_impl(): @@ -594,7 +594,7 @@ /* Calculate byte offset from codepoint offset */ if (start_offset 0) { k = subject_len; - U8_BACK_N(subject, 0, k, -start_offset); + U8_BACK_N((unsigned char*)subject, 0, k, -start_offset); } else { U8_FWD_N(subject, k, subject_len, start_offset); } @@ -1772,7 +1772,7 @@ if (delim *delim) { if (UG(unicode)) { - U8_GET(delim, 0, 0, delim_len, delim_char); + U8_GET((unsigned char*)delim, 0, 0, delim_len, delim_char); } else { delim_char = (UChar32)delim[0]; } @@ -1899,7 +1899,7 @@ int size_offsets; /* Size of the offsets array */ int count = 0; /* Count of matched subpatterns */ zstr string_key; - int string_key_len; + uint string_key_len; ulongnum_key; zend_boolinvert;/* Whether to return non-matching entries */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /tests/unicode autodetect-SCSU.phpt autodetect-UTF16BE.phpt autodetect-UTF16LE.phpt autodetect-UTF32BE.phpt autodetect-UTF32LE.phpt autodetect-UTF7.phpt autodetect-UTF8.phpt enc
dmitry Tue Jul 10 10:21:08 2007 UTC Modified files: /php-src/tests/unicode autodetect-SCSU.phpt autodetect-UTF16BE.phpt autodetect-UTF16LE.phpt autodetect-UTF32BE.phpt autodetect-UTF32LE.phpt autodetect-UTF7.phpt autodetect-UTF8.phpt enc-HZ.phpt enc-ISO-2022-KR.phpt enc-JIS.phpt enc-SJIS.phpt encrt-HZ.phpt encrt-ISO-2022-KR.phpt encrt-JIS.phpt encrt-SJIS.phpt normalize_001.phpt normalize_002.phpt normalize_003.phpt normalize_004.phpt Log: Skip unicode tests in non-unicode mode http://cvs.php.net/viewvc.cgi/php-src/tests/unicode/autodetect-SCSU.phpt?r1=1.2r2=1.3diff_format=u Index: php-src/tests/unicode/autodetect-SCSU.phpt diff -u php-src/tests/unicode/autodetect-SCSU.phpt:1.2 php-src/tests/unicode/autodetect-SCSU.phpt:1.3 --- php-src/tests/unicode/autodetect-SCSU.phpt:1.2 Wed Jun 28 15:07:14 2006 +++ php-src/tests/unicode/autodetect-SCSU.phpt Tue Jul 10 10:21:08 2007 @@ -1,7 +1,8 @@ --TEST-- Script encoding autodetection (SCSU) +--SKIPIF-- +?php if (!unicode_semantics()) die('skip unicode.semantics=off'); ? --INI-- -unicode.semantics=on unicode.output_encoding=CP866 --FILE-- ?php http://cvs.php.net/viewvc.cgi/php-src/tests/unicode/autodetect-UTF16BE.phpt?r1=1.2r2=1.3diff_format=u Index: php-src/tests/unicode/autodetect-UTF16BE.phpt diff -u php-src/tests/unicode/autodetect-UTF16BE.phpt:1.2 php-src/tests/unicode/autodetect-UTF16BE.phpt:1.3 --- php-src/tests/unicode/autodetect-UTF16BE.phpt:1.2 Wed Jun 28 15:07:14 2006 +++ php-src/tests/unicode/autodetect-UTF16BE.phpt Tue Jul 10 10:21:08 2007 @@ -1,7 +1,8 @@ --TEST-- Script encoding autodetection (UTF-16BE) +--SKIPIF-- +?php if (!unicode_semantics()) die('skip unicode.semantics=off'); ? --INI-- -unicode.semantics=on unicode.output_encoding=CP866 --FILE-- ?php http://cvs.php.net/viewvc.cgi/php-src/tests/unicode/autodetect-UTF16LE.phpt?r1=1.2r2=1.3diff_format=u Index: php-src/tests/unicode/autodetect-UTF16LE.phpt diff -u php-src/tests/unicode/autodetect-UTF16LE.phpt:1.2 php-src/tests/unicode/autodetect-UTF16LE.phpt:1.3 --- php-src/tests/unicode/autodetect-UTF16LE.phpt:1.2 Wed Jun 28 15:07:14 2006 +++ php-src/tests/unicode/autodetect-UTF16LE.phpt Tue Jul 10 10:21:08 2007 @@ -1,7 +1,8 @@ --TEST-- Script encoding autodetection (UTF-16LE) +--SKIPIF-- +?php if (!unicode_semantics()) die('skip unicode.semantics=off'); ? --INI-- -unicode.semantics=on unicode.output_encoding=CP866 --FILE-- ?php http://cvs.php.net/viewvc.cgi/php-src/tests/unicode/autodetect-UTF32BE.phpt?r1=1.2r2=1.3diff_format=u Index: php-src/tests/unicode/autodetect-UTF32BE.phpt diff -u php-src/tests/unicode/autodetect-UTF32BE.phpt:1.2 php-src/tests/unicode/autodetect-UTF32BE.phpt:1.3 --- php-src/tests/unicode/autodetect-UTF32BE.phpt:1.2 Wed Jun 28 15:07:14 2006 +++ php-src/tests/unicode/autodetect-UTF32BE.phpt Tue Jul 10 10:21:08 2007 @@ -1,7 +1,8 @@ --TEST-- Script encoding autodetection (UTF-32BE) +--SKIPIF-- +?php if (!unicode_semantics()) die('skip unicode.semantics=off'); ? --INI-- -unicode.semantics=on unicode.output_encoding=CP866 --FILE-- ?php http://cvs.php.net/viewvc.cgi/php-src/tests/unicode/autodetect-UTF32LE.phpt?r1=1.2r2=1.3diff_format=u Index: php-src/tests/unicode/autodetect-UTF32LE.phpt diff -u php-src/tests/unicode/autodetect-UTF32LE.phpt:1.2 php-src/tests/unicode/autodetect-UTF32LE.phpt:1.3 --- php-src/tests/unicode/autodetect-UTF32LE.phpt:1.2 Wed Jun 28 15:07:14 2006 +++ php-src/tests/unicode/autodetect-UTF32LE.phpt Tue Jul 10 10:21:08 2007 @@ -1,7 +1,8 @@ --TEST-- Script encoding autodetection (UTF-32LE) +--SKIPIF-- +?php if (!unicode_semantics()) die('skip unicode.semantics=off'); ? --INI-- -unicode.semantics=on unicode.output_encoding=CP866 --FILE-- ?php http://cvs.php.net/viewvc.cgi/php-src/tests/unicode/autodetect-UTF7.phpt?r1=1.2r2=1.3diff_format=u Index: php-src/tests/unicode/autodetect-UTF7.phpt diff -u php-src/tests/unicode/autodetect-UTF7.phpt:1.2 php-src/tests/unicode/autodetect-UTF7.phpt:1.3 --- php-src/tests/unicode/autodetect-UTF7.phpt:1.2 Wed Jun 28 15:07:14 2006 +++ php-src/tests/unicode/autodetect-UTF7.phpt Tue Jul 10 10:21:08 2007 @@ -1,7 +1,8 @@ --TEST-- Script encoding autodetection (UTF7) +--SKIPIF-- +?php if (!unicode_semantics()) die('skip unicode.semantics=off'); ? --INI-- -unicode.semantics=on unicode.output_encoding=CP866 --FILE-- ?php http://cvs.php.net/viewvc.cgi/php-src/tests/unicode/autodetect-UTF8.phpt?r1=1.2r2=1.3diff_format=u Index: php-src/tests/unicode/autodetect-UTF8.phpt diff -u php-src/tests/unicode/autodetect-UTF8.phpt:1.2 php-src/tests/unicode/autodetect-UTF8.phpt:1.3 ---
[PHP-CVS] cvs: php-src(PHP_5_2) /main/streams streams.c
dmitry Tue Jul 10 11:57:34 2007 UTC Modified files: (Branch: PHP_5_2) /php-src/main/streams streams.c Log: Fixed warning http://cvs.php.net/viewvc.cgi/php-src/main/streams/streams.c?r1=1.82.2.6.2.14r2=1.82.2.6.2.15diff_format=u Index: php-src/main/streams/streams.c diff -u php-src/main/streams/streams.c:1.82.2.6.2.14 php-src/main/streams/streams.c:1.82.2.6.2.15 --- php-src/main/streams/streams.c:1.82.2.6.2.14Mon Jul 9 17:27:23 2007 +++ php-src/main/streams/streams.c Tue Jul 10 11:57:34 2007 @@ -19,7 +19,7 @@ +--+ */ -/* $Id: streams.c,v 1.82.2.6.2.14 2007/07/09 17:27:23 dmitry Exp $ */ +/* $Id: streams.c,v 1.82.2.6.2.15 2007/07/10 11:57:34 dmitry Exp $ */ #define _GNU_SOURCE #include php.h @@ -1609,8 +1609,8 @@ if (wrapperpp (*wrapperpp)-is_url (options STREAM_DISABLE_URL_PROTECTION) == 0 (!PG(allow_url_fopen) || -((options STREAM_OPEN_FOR_INCLUDE) || - PG(in_user_include)) !PG(allow_url_include))) { +(((options STREAM_OPEN_FOR_INCLUDE) || + PG(in_user_include)) !PG(allow_url_include { if (options REPORT_ERRORS) { php_error_docref(NULL TSRMLS_CC, E_WARNING, URL file-access is disabled in the server configuration); } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_2) /ext/standard link.c /ext/standard/tests/file symlink_link_linkinfo_is_link_error1.phpt /main fopen_wrappers.c TSRM tsrm_virtual_cwd.c
dmitry Tue Jul 10 13:21:11 2007 UTC Modified files: (Branch: PHP_5_2) /TSRM tsrm_virtual_cwd.c /php-src/main fopen_wrappers.c /php-src/ext/standard link.c /php-src/ext/standard/tests/file symlink_link_linkinfo_is_link_error1.phpt Log: Fixed symlink(, somthing) and link(, somthing) in ZTS mode http://cvs.php.net/viewvc.cgi/TSRM/tsrm_virtual_cwd.c?r1=1.74.2.9.2.31r2=1.74.2.9.2.32diff_format=u Index: TSRM/tsrm_virtual_cwd.c diff -u TSRM/tsrm_virtual_cwd.c:1.74.2.9.2.31 TSRM/tsrm_virtual_cwd.c:1.74.2.9.2.32 --- TSRM/tsrm_virtual_cwd.c:1.74.2.9.2.31 Tue Jul 3 14:48:01 2007 +++ TSRM/tsrm_virtual_cwd.c Tue Jul 10 13:21:11 2007 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: tsrm_virtual_cwd.c,v 1.74.2.9.2.31 2007/07/03 14:48:01 dmitry Exp $ */ +/* $Id: tsrm_virtual_cwd.c,v 1.74.2.9.2.32 2007/07/10 13:21:11 dmitry Exp $ */ #include sys/types.h #include sys/stat.h @@ -477,11 +477,11 @@ int use_cache; int use_relative_path = 0; TSRMLS_FETCH(); - + use_cache = ((use_realpath != CWD_EXPAND) CWDG(realpath_cache_size_limit)); if (path_length == 0) - return (0); + return (1); if (path_length = MAXPATHLEN) return (1); @@ -769,8 +769,23 @@ { cwd_state new_state; char *retval; + char cwd[MAXPATHLEN]; - CWD_STATE_COPY(new_state, CWDG(cwd)); + /* realpath() returns CWD */ + if (!*path) { + new_state.cwd = (char*)malloc(1); + new_state.cwd[0] = '\0'; + new_state.cwd_length = 0; + if (VCWD_GETCWD(cwd, MAXPATHLEN)) { + path = cwd; + } + } else if (!IS_ABSOLUTE_PATH(path, strlen(path))) { + CWD_STATE_COPY(new_state, CWDG(cwd)); + } else { + new_state.cwd = (char*)malloc(1); + new_state.cwd[0] = '\0'; + new_state.cwd_length = 0; + } if (virtual_file_ex(new_state, path, NULL, CWD_REALPATH)==0) { int len = new_state.cwd_lengthMAXPATHLEN-1?MAXPATHLEN-1:new_state.cwd_length; @@ -1202,7 +1217,15 @@ cwd_state new_state; char cwd[MAXPATHLEN]; - if (!IS_ABSOLUTE_PATH(path, strlen(path)) + /* realpath() returns CWD */ + if (!*path) { + new_state.cwd = (char*)malloc(1); + new_state.cwd[0] = '\0'; + new_state.cwd_length = 0; + if (VCWD_GETCWD(cwd, MAXPATHLEN)) { + path = cwd; + } + } else if (!IS_ABSOLUTE_PATH(path, strlen(path)) VCWD_GETCWD(cwd, MAXPATHLEN)) { new_state.cwd = strdup(cwd); new_state.cwd_length = strlen(cwd); http://cvs.php.net/viewvc.cgi/php-src/main/fopen_wrappers.c?r1=1.175.2.3.2.12r2=1.175.2.3.2.13diff_format=u Index: php-src/main/fopen_wrappers.c diff -u php-src/main/fopen_wrappers.c:1.175.2.3.2.12 php-src/main/fopen_wrappers.c:1.175.2.3.2.13 --- php-src/main/fopen_wrappers.c:1.175.2.3.2.12Fri Jun 1 13:35:23 2007 +++ php-src/main/fopen_wrappers.c Tue Jul 10 13:21:11 2007 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: fopen_wrappers.c,v 1.175.2.3.2.12 2007/06/01 13:35:23 tony2001 Exp $ */ +/* $Id: fopen_wrappers.c,v 1.175.2.3.2.13 2007/07/10 13:21:11 dmitry Exp $ */ /* {{{ includes */ @@ -606,7 +606,9 @@ char cwd[MAXPATHLEN]; char *result; - if (IS_ABSOLUTE_PATH(filepath, strlen(filepath))) { + if (!filepath[0]) { + return NULL; + } else if (IS_ABSOLUTE_PATH(filepath, strlen(filepath))) { cwd[0] = '\0'; } else{ result = VCWD_GETCWD(cwd, MAXPATHLEN); http://cvs.php.net/viewvc.cgi/php-src/ext/standard/link.c?r1=1.52.2.1.2.2r2=1.52.2.1.2.3diff_format=u Index: php-src/ext/standard/link.c diff -u php-src/ext/standard/link.c:1.52.2.1.2.2 php-src/ext/standard/link.c:1.52.2.1.2.3 --- php-src/ext/standard/link.c:1.52.2.1.2.2Mon Jan 1 09:36:08 2007 +++ php-src/ext/standard/link.c Tue Jul 10 13:21:11 2007 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: link.c,v 1.52.2.1.2.2 2007/01/01 09:36:08 sebastian Exp $ */ +/* $Id: link.c,v 1.52.2.1.2.3 2007/07/10 13:21:11 dmitry Exp $ */ #include php.h #include php_filestat.h @@ -123,6 +123,7 @@ convert_to_string_ex(frompath); if (!expand_filepath(Z_STRVAL_PP(frompath), source_p TSRMLS_CC) || !expand_filepath(Z_STRVAL_PP(topath), dest_p TSRMLS_CC)) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, No such file or directory); RETURN_FALSE; } @@ -179,6
[PHP-CVS] cvs: php-src /ext/standard link.c /ext/standard/tests/file symlink_link_linkinfo_is_link_error1.phpt /main fopen_wrappers.c TSRM tsrm_virtual_cwd.c
dmitry Tue Jul 10 13:21:31 2007 UTC Modified files: /TSRM tsrm_virtual_cwd.c /php-src/main fopen_wrappers.c /php-src/ext/standard link.c /php-src/ext/standard/tests/file symlink_link_linkinfo_is_link_error1.phpt Log: Fixed symlink(, somthing) and link(, somthing) in ZTS mode http://cvs.php.net/viewvc.cgi/TSRM/tsrm_virtual_cwd.c?r1=1.111r2=1.112diff_format=u Index: TSRM/tsrm_virtual_cwd.c diff -u TSRM/tsrm_virtual_cwd.c:1.111 TSRM/tsrm_virtual_cwd.c:1.112 --- TSRM/tsrm_virtual_cwd.c:1.111 Tue Jul 3 14:48:37 2007 +++ TSRM/tsrm_virtual_cwd.c Tue Jul 10 13:21:30 2007 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: tsrm_virtual_cwd.c,v 1.111 2007/07/03 14:48:37 dmitry Exp $ */ +/* $Id: tsrm_virtual_cwd.c,v 1.112 2007/07/10 13:21:30 dmitry Exp $ */ #include sys/types.h #include sys/stat.h @@ -481,7 +481,7 @@ use_cache = ((use_realpath != CWD_EXPAND) CWDG(realpath_cache_size_limit)); if (path_length == 0) - return (0); + return (1); if (path_length = MAXPATHLEN) return (1); @@ -769,9 +769,24 @@ { cwd_state new_state; char *retval; + char cwd[MAXPATHLEN]; + + /* realpath() returns CWD */ + if (!*path) { + new_state.cwd = (char*)malloc(1); + new_state.cwd[0] = '\0'; + new_state.cwd_length = 0; + if (VCWD_GETCWD(cwd, MAXPATHLEN)) { + path = cwd; + } + } else if (!IS_ABSOLUTE_PATH(path, strlen(path))) { + CWD_STATE_COPY(new_state, CWDG(cwd)); + } else { + new_state.cwd = (char*)malloc(1); + new_state.cwd[0] = '\0'; + new_state.cwd_length = 0; + } - CWD_STATE_COPY(new_state, CWDG(cwd)); - if (virtual_file_ex(new_state, path, NULL, CWD_REALPATH)==0) { int len = new_state.cwd_lengthMAXPATHLEN-1?MAXPATHLEN-1:new_state.cwd_length; @@ -1202,7 +1217,15 @@ cwd_state new_state; char cwd[MAXPATHLEN]; - if (!IS_ABSOLUTE_PATH(path, strlen(path)) + /* realpath() returns CWD */ + if (!*path) { + new_state.cwd = (char*)malloc(1); + new_state.cwd[0] = '\0'; + new_state.cwd_length = 0; + if (VCWD_GETCWD(cwd, MAXPATHLEN)) { + path = cwd; + } + } else if (!IS_ABSOLUTE_PATH(path, strlen(path)) VCWD_GETCWD(cwd, MAXPATHLEN)) { new_state.cwd = strdup(cwd); new_state.cwd_length = strlen(cwd); http://cvs.php.net/viewvc.cgi/php-src/main/fopen_wrappers.c?r1=1.194r2=1.195diff_format=u Index: php-src/main/fopen_wrappers.c diff -u php-src/main/fopen_wrappers.c:1.194 php-src/main/fopen_wrappers.c:1.195 --- php-src/main/fopen_wrappers.c:1.194 Fri Jun 1 13:33:48 2007 +++ php-src/main/fopen_wrappers.c Tue Jul 10 13:21:30 2007 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: fopen_wrappers.c,v 1.194 2007/06/01 13:33:48 tony2001 Exp $ */ +/* $Id: fopen_wrappers.c,v 1.195 2007/07/10 13:21:30 dmitry Exp $ */ /* {{{ includes */ @@ -579,7 +579,9 @@ char cwd[MAXPATHLEN]; char *result; - if (IS_ABSOLUTE_PATH(filepath, strlen(filepath))) { + if (!filepath[0]) { + return NULL; + } else if (IS_ABSOLUTE_PATH(filepath, strlen(filepath))) { cwd[0] = '\0'; } else{ result = VCWD_GETCWD(cwd, MAXPATHLEN); http://cvs.php.net/viewvc.cgi/php-src/ext/standard/link.c?r1=1.59r2=1.60diff_format=u Index: php-src/ext/standard/link.c diff -u php-src/ext/standard/link.c:1.59 php-src/ext/standard/link.c:1.60 --- php-src/ext/standard/link.c:1.59Mon Jan 1 09:29:32 2007 +++ php-src/ext/standard/link.c Tue Jul 10 13:21:31 2007 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: link.c,v 1.59 2007/01/01 09:29:32 sebastian Exp $ */ +/* $Id: link.c,v 1.60 2007/07/10 13:21:31 dmitry Exp $ */ #include php.h #include php_filestat.h @@ -135,6 +135,7 @@ } if (!expand_filepath(frompath, source_p TSRMLS_CC) || !expand_filepath(topath, dest_p TSRMLS_CC)) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, No such file or directory); RETURN_FALSE; } @@ -185,6 +186,7 @@ } if (!expand_filepath(frompath, source_p TSRMLS_CC) || !expand_filepath(topath, dest_p TSRMLS_CC)) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, No such file or directory); RETURN_FALSE; }
[PHP-CVS] cvs: php-src /ext/standard string.c /ext/standard/tests/strings strripos_offset.phpt
dmitry Tue Jul 10 14:16:40 2007 UTC Modified files: /php-src/ext/standard string.c /php-src/ext/standard/tests/strings strripos_offset.phpt Log: Fixed limit warnings in non-unicode mode http://cvs.php.net/viewvc.cgi/php-src/ext/standard/string.c?r1=1.646r2=1.647diff_format=u Index: php-src/ext/standard/string.c diff -u php-src/ext/standard/string.c:1.646 php-src/ext/standard/string.c:1.647 --- php-src/ext/standard/string.c:1.646 Fri Jun 29 14:53:02 2007 +++ php-src/ext/standard/string.c Tue Jul 10 14:16:40 2007 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: string.c,v 1.646 2007/06/29 14:53:02 dmitry Exp $ */ +/* $Id: string.c,v 1.647 2007/07/10 14:16:40 dmitry Exp $ */ /* Synced with php 3.0 revision 1.193 1999-06-16 [ssb] */ @@ -2788,6 +2788,7 @@ if (offset = 0) { U16_FWD_N(haystack.u, cu_offset, haystack_len, offset); if (cu_offset haystack_len - needle_len) { + php_error_docref(NULL TSRMLS_CC, E_NOTICE, Offset is greater than the length of haystack string); RETURN_FALSE; } u_p = haystack.u + cu_offset; @@ -2795,11 +2796,13 @@ } else { u_p = haystack.u; if (-offset haystack_len) { + php_error_docref(NULL TSRMLS_CC, E_NOTICE, Offset is greater than the length of haystack string); RETURN_FALSE; } else { cu_offset = haystack_len; U16_BACK_N(haystack.u, 0, cu_offset, -offset); if (cu_offset == 0) { + php_error_docref(NULL TSRMLS_CC, E_NOTICE, Offset is greater than the length of haystack string); RETURN_FALSE; } if (needle_len haystack_len - cu_offset) { @@ -2823,12 +2826,14 @@ } else { if (offset = 0) { if (offset haystack_len) { + php_error_docref(NULL TSRMLS_CC, E_NOTICE, Offset is greater than the length of haystack string); RETURN_FALSE; } p = haystack.s + offset; e = haystack.s + haystack_len - needle_len; } else { if (-offset haystack_len) { + php_error_docref(NULL TSRMLS_CC, E_NOTICE, Offset is greater than the length of haystack string); RETURN_FALSE; } @@ -2913,6 +2918,7 @@ if (offset = 0) { U16_FWD_N(haystack.u, cu_offset, haystack_len, offset); if (cu_offset haystack_len - needle_len) { + php_error_docref(NULL TSRMLS_CC, E_NOTICE, Offset is greater than the length of haystack string); RETURN_FALSE; } u_p = haystack.u + cu_offset; @@ -2920,11 +2926,13 @@ } else { u_p = haystack.u; if (-offset haystack_len || offset -INT_MAX) { + php_error_docref(NULL TSRMLS_CC, E_NOTICE, Offset is greater than the length of haystack string); RETURN_FALSE; } else { cu_offset = haystack_len; U16_BACK_N(haystack.u, 0, cu_offset, -offset); if (cu_offset == 0) { + php_error_docref(NULL TSRMLS_CC, E_NOTICE, Offset is greater than the length of haystack string); RETURN_FALSE; } if (needle_len haystack_len - cu_offset) { @@ -2951,6 +2959,7 @@ Can also avoid tolower emallocs */ if (offset = 0) { if (offset haystack_len) { + php_error_docref(NULL TSRMLS_CC, E_NOTICE, Offset is greater than the length of haystack string); RETURN_FALSE; } p = haystack.s + offset; @@ -2958,6 +2967,7 @@ } else { p = haystack.s; if (-offset haystack_len || offset INT_MAX) { + php_error_docref(NULL TSRMLS_CC, E_NOTICE, Offset is greater than the
[PHP-CVS] cvs: php-src /ext/standard html.c
dmitry Tue Jul 10 15:12:15 2007 UTC Modified files: /php-src/ext/standard html.c Log: MFB htmlentities() / htmlspecialchars() don't double encode flag support http://cvs.php.net/viewvc.cgi/php-src/ext/standard/html.c?r1=1.122r2=1.123diff_format=u Index: php-src/ext/standard/html.c diff -u php-src/ext/standard/html.c:1.122 php-src/ext/standard/html.c:1.123 --- php-src/ext/standard/html.c:1.122 Thu Jan 18 16:21:00 2007 +++ php-src/ext/standard/html.c Tue Jul 10 15:12:15 2007 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: html.c,v 1.122 2007/01/18 16:21:00 tony2001 Exp $ */ +/* $Id: html.c,v 1.123 2007/07/10 15:12:15 dmitry Exp $ */ /* * HTML entity resources: @@ -1092,9 +1092,8 @@ /* {{{ php_escape_html_entities */ -PHPAPI char *php_escape_html_entities(char *orig, int oldlen, int *newlen, int all, int quote_style, char *hint_charset TSRMLS_DC) +PHPAPI char *php_escape_html_entities_ex(unsigned char *old, int oldlen, int *newlen, int all, int quote_style, char *hint_charset, zend_bool double_encode TSRMLS_DC) { - unsigned char *old = (unsigned char *)orig; int i, j, maxlen, len; char *replaced; enum entity_charset charset = determine_charset(hint_charset TSRMLS_CC); @@ -1155,8 +1154,34 @@ int is_basic = 0; if (this_char == '') { - memcpy(replaced + len, amp;, sizeof(amp;) - 1); - len += sizeof(amp;) - 1; + if (double_encode) { +encode_amp: + memcpy(replaced + len, amp;, sizeof(amp;) - 1); + len += sizeof(amp;) - 1; + } else { + char *e = memchr(old + i, ';', oldlen - i); + char *s = (char*)old + i; + + if (!e || (e - s) 10) { /* minor optimization to avoid entities over 10 chars in length */ + goto encode_amp; + } else { + if (*s == '#') { /* numeric entities */ + s++; + while (s e) { + if (!isdigit(*s++)) { + goto encode_amp; + } + } + } else { /* text entities */ + while (s e) { + if (!isalnum(*s++)) { + goto encode_amp; + } + } + } + replaced[len++] = ''; + } + } is_basic = 1; } else { for (j = 0; basic_entities[j].charcode != 0; j++) { @@ -1194,6 +1219,11 @@ } /* }}} */ +PHPAPI char *php_escape_html_entities(char *old, int oldlen, int *newlen, int all, int quote_style, char *hint_charset TSRMLS_DC) +{ + return php_escape_html_entities_ex((unsigned char*)old, oldlen, newlen, all, quote_style, hint_charset, 1 TSRMLS_CC); +} + /* {{{ php_html_entities */ static void php_html_entities(INTERNAL_FUNCTION_PARAMETERS, int all) @@ -1207,8 +1237,9 @@ long quote_style = ENT_COMPAT; zend_uchar type; char *replaced; + zend_bool double_encode = 1; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, t|ls, str, str_len, type, quote_style, hint_charset, hint_charset_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, t|ls!b, str, str_len, type, quote_style, hint_charset, hint_charset_len, double_encode) == FAILURE) { return; } @@ -1219,7 +1250,7 @@ hint_charset = utf-8; } - replaced = php_escape_html_entities(str.s, str_len, len, all, quote_style, hint_charset TSRMLS_CC); + replaced = php_escape_html_entities_ex((unsigned char*)str.s, str_len, len, all, quote_style, hint_charset, double_encode TSRMLS_CC); if (type == IS_UNICODE) { RETVAL_U_STRINGL(UG(utf8_conv), replaced, len, ZSTR_AUTOFREE); @@ -1245,7 +1276,7 @@ } /* }}} */ -/* {{{ proto string
[PHP-CVS] cvs: php-src /ext/standard/tests/array locale_sort.phpt
dmitry Tue Jul 10 15:19:13 2007 UTC Modified files: /php-src/ext/standard/tests/array locale_sort.phpt Log: Fixed test http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/array/locale_sort.phpt?r1=1.7r2=1.8diff_format=u Index: php-src/ext/standard/tests/array/locale_sort.phpt diff -u php-src/ext/standard/tests/array/locale_sort.phpt:1.7 php-src/ext/standard/tests/array/locale_sort.phpt:1.8 --- php-src/ext/standard/tests/array/locale_sort.phpt:1.7 Fri Dec 22 01:20:24 2006 +++ php-src/ext/standard/tests/array/locale_sort.phpt Tue Jul 10 15:19:13 2007 @@ -2,29 +2,25 @@ Sort with SORT_LOCALE_STRING --SKIPIF-- ?php -if (false == @setlocale(LC_CTYPE, fr_FR, fr_FR.UTF-8)) { +if (false == setlocale(LC_CTYPE, fr_FR, fr_FR.ISO8859-1)) { die(skip setlocale() failed\n); } -if (!function_exists(locale_set_default)) { - die(sip locale_set_default() function\n); -} ? --INI-- -unicode.script_encoding=UTF-8 -unicode.output_encoding=UTF-8 +unicode.script_encoding=ISO8859-1 +unicode.output_encoding=ISO8859-1 --FILE-- ?php [EMAIL PROTECTED](LC_ALL, 'fr_FR', 'fr_FR.UTF-8'); -locale_set_default('fr_FR'); +setlocale(LC_ALL, 'fr_FR', 'fr_FR.ISO8859-1'); $table = array(AB = Alberta, BC = Colombie-Britannique, MB = Manitoba, NB = Nouveau-Brunswick, NL = Terre-Neuve-et-Labrador, -NS = Nouvelle-Ãcosse, +NS = Nouvelle-Écosse, ON = Ontario, -PE = Ãle-du-Prince-Ãdouard, -QC = Québec, +PE = Île-du-Prince-Édouard, +QC = Québec, SK = Saskatchewan, NT = Territoires du Nord-Ouest, NU = Nunavut, @@ -39,19 +35,19 @@ [BC]= string(20) Colombie-Britannique [PE]= - string(21) Ãle-du-Prince-Ãdouard + string(21) Île-du-Prince-Édouard [MB]= string(8) Manitoba [NB]= string(17) Nouveau-Brunswick [NS]= - string(15) Nouvelle-Ãcosse + string(15) Nouvelle-Écosse [NU]= string(7) Nunavut [ON]= string(7) Ontario [QC]= - string(6) Québec + string(6) Québec [SK]= string(12) Saskatchewan [NL]= @@ -68,19 +64,19 @@ [uBC]= unicode(20) Colombie-Britannique [uPE]= - unicode(21) Ãle-du-Prince-Ãdouard + unicode(21) Île-du-Prince-Édouard [uMB]= unicode(8) Manitoba [uNB]= unicode(17) Nouveau-Brunswick [uNS]= - unicode(15) Nouvelle-Ãcosse + unicode(15) Nouvelle-Écosse [uNU]= unicode(7) Nunavut [uON]= unicode(7) Ontario [uQC]= - unicode(6) Québec + unicode(6) Québec [uSK]= unicode(12) Saskatchewan [uNL]= -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/standard file.c
dmitry Tue Jul 10 17:02:43 2007 UTC Modified files: /php-src/ext/standard file.c Log: Fixed fgets() and fgetss() with limits http://cvs.php.net/viewvc.cgi/php-src/ext/standard/file.c?r1=1.493r2=1.494diff_format=u Index: php-src/ext/standard/file.c diff -u php-src/ext/standard/file.c:1.493 php-src/ext/standard/file.c:1.494 --- php-src/ext/standard/file.c:1.493 Sun Jul 1 21:26:30 2007 +++ php-src/ext/standard/file.c Tue Jul 10 17:02:43 2007 @@ -21,7 +21,7 @@ +--+ */ -/* $Id: file.c,v 1.493 2007/07/01 21:26:30 sniper Exp $ */ +/* $Id: file.c,v 1.494 2007/07/10 17:02:43 dmitry Exp $ */ /* Synced with php 3.0 revision 1.218 1999-06-16 [ssb] */ @@ -1131,13 +1131,16 @@ zval *zstream; int argc = ZEND_NUM_ARGS(); long length = -1; - zstr buf; + long len; + zstr buf, line; size_t retlen = 0; if (zend_parse_parameters(argc TSRMLS_CC, r|l, zstream, length) == FAILURE) { return; } + php_stream_from_zval(stream, zstream); + if (ZEND_NUM_ARGS() == 2 length = 0) { php_error_docref(NULL TSRMLS_CC, E_WARNING, Length parameter must be greater than 0); RETURN_FALSE; @@ -1147,20 +1150,26 @@ /* For BC reasons, fgets() should only return length-1 bytes. */ RETURN_FALSE; } else if (length 1) { + len = length; + buf.v = ecalloc(len, (stream-readbuf_type == IS_UNICODE) ? sizeof(UChar) : sizeof(char)); length--; + } else { + buf.v = NULL; + len = -1; } - php_stream_from_zval(stream, zstream); - - buf.v = php_stream_get_line_ex(stream, stream-readbuf_type, NULL_ZSTR, 0, length, retlen); - if (!buf.v) { + line.v = php_stream_get_line_ex(stream, stream-readbuf_type, buf, len, length, retlen); + if (!line.v) { + if (buf.v) { + efree(buf.v); + } RETURN_FALSE; } if (stream-readbuf_type == IS_UNICODE) { - RETURN_UNICODEL(buf.u, retlen, 0); + RETURN_UNICODEL(line.u, retlen, 0); } else { /* IS_STRING */ - RETURN_STRINGL(buf.s, retlen, 0); + RETURN_STRINGL(line.s, retlen, 0); } } /* }}} */ @@ -1203,13 +1212,17 @@ zval *zstream; php_stream *stream; long length = 0; + long len; zval **allow = NULL; size_t retlen = 0; + zstr buf; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, r|lZ, zstream, length, allow) == FAILURE) { return; } + php_stream_from_zval(stream, zstream); + if (ZEND_NUM_ARGS() = 2 length = 0) { php_error_docref(NULL TSRMLS_CC, E_WARNING, Length parameter must be greater than 0); RETURN_FALSE; @@ -1219,17 +1232,24 @@ /* For BC reasons, fgetss() should only return length-1 bytes. */ RETURN_FALSE; } else if (length 1) { + len = length; + buf.v = ecalloc(len, (stream-readbuf_type == IS_UNICODE) ? sizeof(UChar) : sizeof(char)); length--; + } else { + buf.v = NULL; + len = -1; } - php_stream_from_zval(stream, zstream); - if (stream-readbuf_type == IS_UNICODE) { - UChar *buf = php_stream_get_line_ex(stream, IS_UNICODE, NULL_ZSTR, 0, length, retlen); + UChar *line; UChar *allowed = NULL; int allowed_len = 0; - if (!buf) { + line = php_stream_get_line_ex(stream, IS_UNICODE, buf, len, length, retlen); + if (!line) { + if (buf.v) { + efree(buf.v); + } RETURN_FALSE; } @@ -1238,15 +1258,19 @@ allowed = Z_USTRVAL_PP(allow); allowed_len = Z_USTRLEN_PP(allow); } - retlen = php_u_strip_tags(buf, retlen, stream-fgetss_state, allowed, allowed_len TSRMLS_CC); + retlen = php_u_strip_tags(line, retlen, stream-fgetss_state, allowed, allowed_len TSRMLS_CC); - RETURN_UNICODEL(buf, retlen, 0); + RETURN_UNICODEL(line, retlen, 0); } else { /* IS_STRING */ - char *buf = php_stream_get_line_ex(stream, IS_STRING, NULL_ZSTR, 0, length, retlen); + char *line; char *allowed = NULL; int allowed_len = 0; - if (!buf) { + line = php_stream_get_line_ex(stream, IS_STRING, buf, len, length, retlen); + if (!line) { + if (buf.v) { +
[PHP-CVS] cvs: php-src /tests/classes serialize_001.phpt
dmitry Wed Jul 11 06:36:24 2007 UTC Modified files: /php-src/tests/classes serialize_001.phpt Log: removed seccond --UEXPECT-- http://cvs.php.net/viewvc.cgi/php-src/tests/classes/serialize_001.phpt?r1=1.4r2=1.5diff_format=u Index: php-src/tests/classes/serialize_001.phpt diff -u php-src/tests/classes/serialize_001.phpt:1.4 php-src/tests/classes/serialize_001.phpt:1.5 --- php-src/tests/classes/serialize_001.phpt:1.4Fri Jun 2 22:22:43 2006 +++ php-src/tests/classes/serialize_001.phptWed Jul 11 06:36:24 2007 @@ -107,33 +107,3 @@ Test::serialize() Exception: Test::serialize() must return a string or NULL ===DONE=== ---UEXPECT-- -== -unicode(6) String -Test::__construct(String) -Test::serialize(String) -Test::unserialize(String) -object(Test)#1 (1) { - [udata]= - string(6) String -} -object(Test)#1 (1) { - [udata]= - string(6) String -} -== -NULL -Test::__construct() -Test::serialize() -NULL -== -int(42) -Test::__construct(42) -Test::serialize(42) -Exception: Test::serialize() must return a string or NULL -== -bool(false) -Test::__construct() -Test::serialize() -Exception: Test::serialize() must return a string or NULL -===DONE=== -- 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_2) /ext/openssl openssl.c
I don't think it is imprtant fix. Nobody uses non-sting pasphrases. :) I found this bug in PHP6 where it was real stopper (because of unicode passphrases) and then backported it to 5.2. Thanks. Dmitry. -Original Message- From: Pierre [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 11, 2007 12:42 PM To: Dmitry Stogov Cc: php-cvs@lists.php.net Subject: Re: [PHP-CVS] cvs: php-src(PHP_5_2) /ext/openssl openssl.c Hi Dmitry, Thanks for the fixes! Can you add two NEWS entry please? (5_2) On 7/11/07, Dmitry Stogov [EMAIL PROTECTED] wrote: dmitry Wed Jul 11 07:26:52 2007 UTC Modified files: (Branch: PHP_5_2) /php-src/ext/opensslopenssl.c Log: Fixed crash on non-string passphrase http://cvs.php.net/viewvc.cgi/php-src/ext/openssl/openssl.c?r1=1.98.2. 5.2.35r2=1.98.2.5.2.36diff_format=u Index: php-src/ext/openssl/openssl.c diff -u php-src/ext/openssl/openssl.c:1.98.2.5.2.35 php-src/ext/openssl/openssl.c:1.98.2.5.2.36 --- php-src/ext/openssl/openssl.c:1.98.2.5.2.35 Tue Jun 19 22:09:49 2007 +++ php-src/ext/openssl/openssl.c Wed Jul 11 07:26:52 2007 @@ -20,7 +20,7 @@ +- -+ */ -/* $Id: openssl.c,v 1.98.2.5.2.35 2007/06/19 22:09:49 iliaa Exp $ */ +/* $Id: openssl.c,v 1.98.2.5.2.36 2007/07/11 07:26:52 dmitry Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -2256,6 +2256,7 @@ } else { tmp = **zphrase; zval_copy_ctor(tmp); + convert_to_string(tmp); passphrase = Z_STRVAL(tmp); } -- 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/openssl openssl.c /ext/openssl/tests 005.phpt bug28382.phpt
dmitry Wed Jul 11 12:10:28 2007 UTC Modified files: /php-src/ext/opensslopenssl.c /php-src/ext/openssl/tests 005.phpt bug28382.phpt Log: Unicode support improved openssl_x509_parse() extensions support http://cvs.php.net/viewvc.cgi/php-src/ext/openssl/openssl.c?r1=1.144r2=1.145diff_format=u Index: php-src/ext/openssl/openssl.c diff -u php-src/ext/openssl/openssl.c:1.144 php-src/ext/openssl/openssl.c:1.145 --- php-src/ext/openssl/openssl.c:1.144 Wed Jul 11 07:35:53 2007 +++ php-src/ext/openssl/openssl.c Wed Jul 11 12:10:28 2007 @@ -20,7 +20,7 @@ +--+ */ -/* $Id: openssl.c,v 1.144 2007/07/11 07:35:53 dmitry Exp $ */ +/* $Id: openssl.c,v 1.145 2007/07/11 12:10:28 dmitry Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -283,11 +283,11 @@ str = X509_NAME_ENTRY_get_data(ne); if (ASN1_STRING_type(str) != V_ASN1_UTF8STRING) { to_add_len = ASN1_STRING_to_UTF8(to_add, str); - add_next_index_stringl(subentries, (char *)to_add, to_add_len, 1); + add_next_index_utf8_stringl(subentries, (char *)to_add, to_add_len, 1); } else { to_add = ASN1_STRING_data(str); to_add_len = ASN1_STRING_length(str); - add_next_index_stringl(subentries, (char *)to_add, to_add_len, 1); + add_next_index_utf8_stringl(subentries, (char *)to_add, to_add_len, 1); } } last = j; @@ -295,24 +295,36 @@ i = last; if (obj_cnt 1) { - add_assoc_zval_ex(subitem, sname, strlen(sname) + 1, subentries); + add_ascii_assoc_zval_ex(subitem, sname, strlen(sname) + 1, subentries); } else { zval_dtor(subentries); FREE_ZVAL(subentries); if (obj_cnt str) { - add_assoc_stringl(subitem, sname, (char *)to_add, to_add_len, 1); + add_ascii_assoc_utf8_stringl(subitem, sname, (char *)to_add, to_add_len, 1); } } } if (key != NULL) { - zend_hash_update(HASH_OF(val), key, strlen(key) + 1, (void *)subitem, sizeof(subitem), NULL); + add_ascii_assoc_zval_ex(val, key, strlen(key) + 1, subitem); } } /* }}} */ static void add_assoc_asn1_string(zval * val, char * key, ASN1_STRING * str) /* {{{ */ { - add_assoc_stringl(val, key, (char *)str-data, str-length, 1); + unsigned char *data; + int data_len; + TSRMLS_FETCH(); + + if (ASN1_STRING_type(str) != V_ASN1_UTF8STRING) { + data = ASN1_STRING_data(str); + data_len = ASN1_STRING_length(str); + add_ascii_assoc_stringl(val, key, (char*)data, data_len, 1); + } else { + data = ASN1_STRING_data(str); + data_len = ASN1_STRING_length(str); + add_ascii_assoc_utf8_stringl(val, key, (char*)data, data_len, 1); + } } /* }}} */ @@ -443,13 +455,15 @@ req-config_filename, req-var, req-req_config TSRMLS_CC) == FAILURE) return FAILURE #define SET_OPTIONAL_STRING_ARG(key, varname, defval) \ - if (optional_args zend_hash_find(Z_ARRVAL_P(optional_args), key, sizeof(key), (void**)item) == SUCCESS) \ + if (optional_args zend_ascii_hash_find(Z_ARRVAL_P(optional_args), key, sizeof(key), (void**)item) == SUCCESS) { \ + convert_to_string_ex(item); \ varname = Z_STRVAL_PP(item); \ - else \ - varname = defval + } else \ + varname = defval; + #define SET_OPTIONAL_LONG_ARG(key, varname, defval)\ - if (optional_args zend_hash_find(Z_ARRVAL_P(optional_args), key, sizeof(key), (void**)item) == SUCCESS) \ + if (optional_args zend_ascii_hash_find(Z_ARRVAL_P(optional_args), key, sizeof(key), (void**)item) == SUCCESS) \ varname = Z_LVAL_PP(item); \ else \ varname = defval @@ -985,8 +999,11 @@ char * tmpstr; zval * subitem; X509_EXTENSION *extension; - ASN1_OCTET_STRING *extdata; char *extname; + BIO *bio_out; + BUF_MEM *bio_buf; + char buf[256]; + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, Z|b, zcert, useshortnames) == FAILURE) { return; @@ -998,37 +1015,37 @@ array_init(return_value); if (cert-name) { -
[PHP-CVS] cvs: php-src(PHP_5_2) / NEWS /ext/openssl openssl.c /ext/openssl/tests bug28382.phpt
dmitry Wed Jul 11 12:18:14 2007 UTC Modified files: (Branch: PHP_5_2) /php-srcNEWS /php-src/ext/opensslopenssl.c /php-src/ext/openssl/tests bug28382.phpt Log: mproced openssl_x509_parse() to return extensions in readable form http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.826r2=1.2027.2.547.2.827diff_format=u Index: php-src/NEWS diff -u php-src/NEWS:1.2027.2.547.2.826 php-src/NEWS:1.2027.2.547.2.827 --- php-src/NEWS:1.2027.2.547.2.826 Tue Jul 10 20:25:49 2007 +++ php-src/NEWSWed Jul 11 12:18:13 2007 @@ -6,6 +6,7 @@ - Upgraded PCRE to version 7.2 (Nuno) - Updated timezone database to version 2007.6. (Derick) +- Improced openssl_x509_parse() to return extensions in readable form. (Dmitry) - Improved fix for MOPB-03-2007. (Ilia) - Corrected fix for CVE-2007-2872. (Ilia) - Enabled statement cache for non-persistent OCI8 connections. @@ -30,6 +31,7 @@ - Added CURLOPT_PRIVATE CURLINFO_PRIVATE constants. (Andrey A. Belashkov, Tony) +- Fixed crash in OpenSSL extension because of non-strin passphrase. (Dmitry) - Fixed var_export() to use the new H modifier so that it can generate parseable PHP code for floats, independent of the locale. (Derick) - Fixed regression introduced by the fix for the libgd bug #74. (Pierre) http://cvs.php.net/viewvc.cgi/php-src/ext/openssl/openssl.c?r1=1.98.2.5.2.37r2=1.98.2.5.2.38diff_format=u Index: php-src/ext/openssl/openssl.c diff -u php-src/ext/openssl/openssl.c:1.98.2.5.2.37 php-src/ext/openssl/openssl.c:1.98.2.5.2.38 --- php-src/ext/openssl/openssl.c:1.98.2.5.2.37 Wed Jul 11 07:36:12 2007 +++ php-src/ext/openssl/openssl.c Wed Jul 11 12:18:14 2007 @@ -20,7 +20,7 @@ +--+ */ -/* $Id: openssl.c,v 1.98.2.5.2.37 2007/07/11 07:36:12 dmitry Exp $ */ +/* $Id: openssl.c,v 1.98.2.5.2.38 2007/07/11 12:18:14 dmitry Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -999,8 +999,10 @@ char * tmpstr; zval * subitem; X509_EXTENSION *extension; - ASN1_OCTET_STRING *extdata; char *extname; + BIO *bio_out; + BUF_MEM *bio_buf; + char buf[256]; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, Z|b, zcert, useshortnames) == FAILURE) { return; @@ -1082,9 +1084,20 @@ for (i = 0; i X509_get_ext_count(cert); i++) { extension = X509_get_ext(cert, i); - extdata = X509_EXTENSION_get_data(extension); - extname = (char *)OBJ_nid2sn(OBJ_obj2nid(X509_EXTENSION_get_object(extension))); - add_assoc_asn1_string(subitem, extname, extdata); + if (OBJ_obj2nid(X509_EXTENSION_get_object(extension)) != NID_undef) { + extname = (char *)OBJ_nid2sn(OBJ_obj2nid(X509_EXTENSION_get_object(extension))); + } else { + OBJ_obj2txt(buf, sizeof(buf)-1, X509_EXTENSION_get_object(extension), 1); + extname = buf; + } + bio_out = BIO_new(BIO_s_mem()); + if (X509V3_EXT_print(bio_out, extension, 0, 0)) { + BIO_get_mem_ptr(bio_out, bio_buf); + add_assoc_stringl(subitem, extname, bio_buf-data, bio_buf-length, 1); + } else { + add_assoc_asn1_string(subitem, extname, X509_EXTENSION_get_data(extension)); + } + BIO_free(bio_out); } add_assoc_zval(return_value, extensions, subitem); http://cvs.php.net/viewvc.cgi/php-src/ext/openssl/tests/bug28382.phpt?r1=1.1.2.5r2=1.1.2.6diff_format=u Index: php-src/ext/openssl/tests/bug28382.phpt diff -u php-src/ext/openssl/tests/bug28382.phpt:1.1.2.5 php-src/ext/openssl/tests/bug28382.phpt:1.1.2.6 --- php-src/ext/openssl/tests/bug28382.phpt:1.1.2.5 Wed May 30 15:40:26 2007 +++ php-src/ext/openssl/tests/bug28382.phpt Wed Jul 11 12:18:14 2007 @@ -14,25 +14,28 @@ --EXPECTF-- array(11) { [basicConstraints]= - string(2) %s + string(8) CA:FALSE [nsComment]= - string(40) %s + string(38) For Grid use only; request tag userTag [nsCertType]= - string(4) %s + string(30) SSL Client, SSL Server, S/MIME [crlDistributionPoints]= - string(56) %s + string(51) URI:http://mobile.blue-software.ro:90/ca/crl.shtml + [nsCaPolicyUrl]= - string(40) %s + string(38) http://mobile.blue-software.ro:90/pub/; [subjectAltName]= - string(26) %s + string(28) email:[EMAIL PROTECTED] [subjectKeyIdentifier]= - string(22) %s + string(59) B0:A7:FF:F9:41:15:DE:23:39:BD:DD:31:0F:97:A0:B2:A2:74:E0:FC [authorityKeyIdentifier]= - string(159) %s + string(115) DirName:/C=RO/ST=Romania/L=Craiova/O=Sergiu/OU=Sergiu SRL/CN=Sergiu CA/[EMAIL PROTECTED] +serial:00 + [keyUsage]= - string(4) %s + string(71) Digital Signature, Non Repudiation, Key Encipherment, Data Encipherment [nsBaseUrl]= -
[PHP-CVS] cvs: php-src /ext/standard/tests/array extract.phpt /ext/standard/tests/file flock_error.phpt
dmitry Wed Jul 11 12:57:55 2007 UTC Modified files: /php-src/ext/standard/tests/array extract.phpt /php-src/ext/standard/tests/fileflock_error.phpt Log: Fixed tests http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/array/extract.phpt?r1=1.2r2=1.3diff_format=u Index: php-src/ext/standard/tests/array/extract.phpt diff -u php-src/ext/standard/tests/array/extract.phpt:1.2 php-src/ext/standard/tests/array/extract.phpt:1.3 --- php-src/ext/standard/tests/array/extract.phpt:1.2 Sat May 12 11:20:52 2007 +++ php-src/ext/standard/tests/array/extract.phpt Wed Jul 11 12:57:55 2007 @@ -131,7 +131,7 @@ Warning: extract() expects parameter 1 to be array, integer given in %s on line %d NULL -Warning: extract() expects parameter 1 to be array, string given in %s on line %d +Warning: extract() expects parameter 1 to be array, %s given in %s on line %d NULL Warning: extract() expects at most 3 parameters, 4 given in %s on line %d http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/file/flock_error.phpt?r1=1.2r2=1.3diff_format=u Index: php-src/ext/standard/tests/file/flock_error.phpt diff -u php-src/ext/standard/tests/file/flock_error.phpt:1.2 php-src/ext/standard/tests/file/flock_error.phpt:1.3 --- php-src/ext/standard/tests/file/flock_error.phpt:1.2Fri May 25 13:50:06 2007 +++ php-src/ext/standard/tests/file/flock_error.phptWed Jul 11 12:57:55 2007 @@ -148,8 +148,10 @@ NULL --- Iteration 8 --- -Warning: flock() expects parameter 2 to be long, Unicode string given in %s on line %d -NULL +Notice: A non well formed numeric value encountered in %s on line %d + +Warning: flock(): Illegal operation argument in %s on line %d +bool(false) Warning: flock(): 6 is not a valid stream resource in %s on line %d bool(false) -- 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
dmitry Wed Jul 11 14:32:54 2007 UTC Modified files: /php-src/main/streams streams.c Log: Fixed wrong warning http://cvs.php.net/viewvc.cgi/php-src/main/streams/streams.c?r1=1.152r2=1.153diff_format=u Index: php-src/main/streams/streams.c diff -u php-src/main/streams/streams.c:1.152 php-src/main/streams/streams.c:1.153 --- php-src/main/streams/streams.c:1.152Tue Jul 3 10:22:55 2007 +++ php-src/main/streams/streams.c Wed Jul 11 14:32:54 2007 @@ -19,7 +19,7 @@ +--+ */ -/* $Id: streams.c,v 1.152 2007/07/03 10:22:55 dmitry Exp $ */ +/* $Id: streams.c,v 1.153 2007/07/11 14:32:54 dmitry Exp $ */ #define _GNU_SOURCE #include php.h @@ -2113,7 +2113,7 @@ #ifdef PHP_WIN32 if (localhost == 0 path[n+3] != '\0' path[n+3] != '/' path[n+4] != ':'){ #else - if (localhost == 0 path[n+3] != '/') { + if (localhost == 0 path[n+3] != '\0' path[n+3] != '/') { #endif if (options REPORT_ERRORS) { php_error_docref(NULL TSRMLS_CC, E_WARNING, remote host file access not supported, %s, path); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_2) /main/streams streams.c
dmitry Wed Jul 11 14:33:30 2007 UTC Modified files: (Branch: PHP_5_2) /php-src/main/streams streams.c Log: Fixed wrong warning http://cvs.php.net/viewvc.cgi/php-src/main/streams/streams.c?r1=1.82.2.6.2.15r2=1.82.2.6.2.16diff_format=u Index: php-src/main/streams/streams.c diff -u php-src/main/streams/streams.c:1.82.2.6.2.15 php-src/main/streams/streams.c:1.82.2.6.2.16 --- php-src/main/streams/streams.c:1.82.2.6.2.15Tue Jul 10 11:57:34 2007 +++ php-src/main/streams/streams.c Wed Jul 11 14:33:30 2007 @@ -19,7 +19,7 @@ +--+ */ -/* $Id: streams.c,v 1.82.2.6.2.15 2007/07/10 11:57:34 dmitry Exp $ */ +/* $Id: streams.c,v 1.82.2.6.2.16 2007/07/11 14:33:30 dmitry Exp $ */ #define _GNU_SOURCE #include php.h @@ -1557,7 +1557,7 @@ #ifdef PHP_WIN32 if (localhost == 0 path[n+3] != '\0' path[n+3] != '/' path[n+4] != ':'){ #else - if (localhost == 0 path[n+3] != '/') { + if (localhost == 0 path[n+3] != '\0' path[n+3] != '/') { #endif if (options REPORT_ERRORS) { php_error_docref(NULL TSRMLS_CC, E_WARNING, remote host file access not supported, %s, path); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /main/streams memory.c
dmitry Wed Jul 11 15:17:59 2007 UTC Modified files: /php-src/main/streams memory.c Log: Unicode support http://cvs.php.net/viewvc.cgi/php-src/main/streams/memory.c?r1=1.34r2=1.35diff_format=u Index: php-src/main/streams/memory.c diff -u php-src/main/streams/memory.c:1.34 php-src/main/streams/memory.c:1.35 --- php-src/main/streams/memory.c:1.34 Thu Feb 22 23:25:36 2007 +++ php-src/main/streams/memory.c Wed Jul 11 15:17:59 2007 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: memory.c,v 1.34 2007/02/22 23:25:36 helly Exp $ */ +/* $Id: memory.c,v 1.35 2007/07/11 15:17:59 dmitry Exp $ */ #define _GNU_SOURCE #include php.h @@ -640,11 +640,11 @@ MAKE_STD_ZVAL(meta); array_init(meta); if (!semi) { /* there is only a mime type */ - add_ascii_assoc_stringl(meta, mediatype, path, mlen, 1); + add_ascii_assoc_ascii_stringl(meta, mediatype, path, mlen, 1); mlen = 0; } else if (sep sep semi) { /* there is a mime type */ plen = semi - path; - add_ascii_assoc_stringl(meta, mediatype, path, plen, 1); + add_ascii_assoc_ascii_stringl(meta, mediatype, path, plen, 1); mlen -= plen; path += plen; } else if (semi != path || mlen != sizeof(;base64)-1 || memcmp(path, ;base64, sizeof(;base64)-1)) { /* must be error since parameters are only allowed after mediatype */ @@ -674,7 +674,7 @@ plen = sep - path; vlen = (semi ? semi - sep : mlen - plen) - 1 /* '=' */; key = estrndup(path, plen); - add_rt_assoc_stringl_ex(meta, key, plen + 1, sep + 1, vlen, 1); + add_rt_assoc_rt_stringl_ex(meta, key, plen + 1, sep + 1, vlen, 1); efree(key); plen += vlen + 1; mlen -= plen; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/standard basic_functions.c
dmitry Wed Jul 11 15:52:44 2007 UTC Modified files: /php-src/ext/standard basic_functions.c Log: Unicode support http://cvs.php.net/viewvc.cgi/php-src/ext/standard/basic_functions.c?r1=1.862r2=1.863diff_format=u Index: php-src/ext/standard/basic_functions.c diff -u php-src/ext/standard/basic_functions.c:1.862 php-src/ext/standard/basic_functions.c:1.863 --- php-src/ext/standard/basic_functions.c:1.862Tue Jul 3 10:22:55 2007 +++ php-src/ext/standard/basic_functions.c Wed Jul 11 15:52:44 2007 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: basic_functions.c,v 1.862 2007/07/03 10:22:55 dmitry Exp $ */ +/* $Id: basic_functions.c,v 1.863 2007/07/11 15:52:44 dmitry Exp $ */ #include php.h #include php_streams.h @@ -5030,8 +5030,8 @@ if (PG(last_error_message)) { array_init(return_value); add_ascii_assoc_long_ex(return_value, type, sizeof(type), PG(last_error_type)); - add_ascii_assoc_string_ex(return_value, message, sizeof(message), PG(last_error_message), 1); - add_ascii_assoc_string_ex(return_value, file, sizeof(file), PG(last_error_file)?PG(last_error_file):-, 1 ); + add_ascii_assoc_rt_string_ex(return_value, message, sizeof(message), PG(last_error_message), 1); + add_ascii_assoc_rt_string_ex(return_value, file, sizeof(file), PG(last_error_file)?PG(last_error_file):-, 1 ); add_ascii_assoc_long_ex(return_value, line, sizeof(line), PG(last_error_lineno)); } } -- 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 /ext/xmlreader/tests 008.phpt
dmitry Wed Jul 11 16:47:30 2007 UTC Modified files: /php-src/ext/xmlreader php_xmlreader.c /php-src/ext/xmlreader/tests008.phpt Log: Unicode support http://cvs.php.net/viewvc.cgi/php-src/ext/xmlreader/php_xmlreader.c?r1=1.45r2=1.46diff_format=u Index: php-src/ext/xmlreader/php_xmlreader.c diff -u php-src/ext/xmlreader/php_xmlreader.c:1.45 php-src/ext/xmlreader/php_xmlreader.c:1.46 --- php-src/ext/xmlreader/php_xmlreader.c:1.45 Fri Jan 12 12:16:36 2007 +++ php-src/ext/xmlreader/php_xmlreader.c Wed Jul 11 16:47:30 2007 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: php_xmlreader.c,v 1.45 2007/01/12 12:16:36 tony2001 Exp $ */ +/* $Id: php_xmlreader.c,v 1.46 2007/07/11 16:47:30 dmitry Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -1094,16 +1094,22 @@ int source_len = 0, encoding_len = 0; long options = 0; xmlreader_object *intern = NULL; - char *source, *uri = NULL, *encoding = NULL; + zstr source; + char *uri = NULL, *encoding = NULL; int resolved_path_len; char *directory=NULL, resolved_path[MAXPATHLEN]; xmlParserInputBufferPtr inputbfr; xmlTextReaderPtr reader = NULL; + zend_uchar source_type; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, S|s!l, source, source_len, encoding, encoding_len, options) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, t|s!l, source, source_len, source_type, encoding, encoding_len, options) == FAILURE) { return; } + if (source_type == IS_UNICODE) { + source.s = php_libxml_unicode_to_string(source.u, source_len, source_len TSRMLS_CC); + } + id = getThis(); if (id != NULL ! instanceof_function(Z_OBJCE_P(id), xmlreader_class_entry TSRMLS_CC)) { id = NULL; @@ -1118,7 +1124,11 @@ RETURN_FALSE; } - inputbfr = xmlParserInputBufferCreateMem(source, source_len, XML_CHAR_ENCODING_NONE); + inputbfr = xmlParserInputBufferCreateMem(source.s, source_len, XML_CHAR_ENCODING_NONE); + + if (source_type == IS_UNICODE) { + efree(source.s); + } if (inputbfr != NULL) { /* Get the URI of the current script so that we can set the base directory in libxml */ http://cvs.php.net/viewvc.cgi/php-src/ext/xmlreader/tests/008.phpt?r1=1.3r2=1.4diff_format=u Index: php-src/ext/xmlreader/tests/008.phpt diff -u php-src/ext/xmlreader/tests/008.phpt:1.3 php-src/ext/xmlreader/tests/008.phpt:1.4 --- php-src/ext/xmlreader/tests/008.phpt:1.3Sat Aug 5 12:32:54 2006 +++ php-src/ext/xmlreader/tests/008.phptWed Jul 11 16:47:30 2007 @@ -4,7 +4,7 @@ ?php if (!extension_loaded(xmlreader)) print skip; ? --FILE-- ?php -/* $Id: 008.phpt,v 1.3 2006/08/05 12:32:54 rrichards Exp $ */ +/* $Id: 008.phpt,v 1.4 2007/07/11 16:47:30 dmitry Exp $ */ $xmlstring = '?xml version=1.0 encoding=UTF-8 standalone=no? !DOCTYPE LIST SYSTEM dtdexample.dtd @@ -22,7 +22,7 @@ /MOVIE /LIST'; -$dtdfile = rawurlencode(dirname(__FILE__)) . b'/dtdexample.dtd'; +$dtdfile = rawurlencode((binary)dirname(__FILE__)) . b'/dtdexample.dtd'; $file = dirname(__FILE__) . '/__008.xml'; file_put_contents($file, $xmlstring); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_2) / NEWS /ext/soap soap.c
dmitry Fri Jul 13 14:00:06 2007 UTC Modified files: (Branch: PHP_5_2) /php-srcNEWS /php-src/ext/soap soap.c Log: Fixed bug #41635 (SoapServer and zlib.output_compression with FastCGI result in major slowdown http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.834r2=1.2027.2.547.2.835diff_format=u Index: php-src/NEWS diff -u php-src/NEWS:1.2027.2.547.2.834 php-src/NEWS:1.2027.2.547.2.835 --- php-src/NEWS:1.2027.2.547.2.834 Fri Jul 13 01:24:15 2007 +++ php-src/NEWSFri Jul 13 14:00:04 2007 @@ -108,6 +108,8 @@ - Fixed bug #41655 (open_basedir bypass via glob()). (Ilia) - Fixed bug #41640 (get_class_vars produces error on class constants). (Johannes) +- Fixed bug #41635 (SoapServer and zlib.output_compression with FastCGI result + in major slowdown). (Dmitry) - Fixed bug #41633 (Crash instantiating classes with self-referencing constants). (Dmitry) - Fixed bug #41630 (segfault when an invalid color index is present in http://cvs.php.net/viewvc.cgi/php-src/ext/soap/soap.c?r1=1.156.2.28.2.25r2=1.156.2.28.2.26diff_format=u Index: php-src/ext/soap/soap.c diff -u php-src/ext/soap/soap.c:1.156.2.28.2.25 php-src/ext/soap/soap.c:1.156.2.28.2.26 --- php-src/ext/soap/soap.c:1.156.2.28.2.25 Sun May 27 17:46:46 2007 +++ php-src/ext/soap/soap.c Fri Jul 13 14:00:05 2007 @@ -17,7 +17,7 @@ | Dmitry Stogov [EMAIL PROTECTED] | +--+ */ -/* $Id: soap.c,v 1.156.2.28.2.25 2007/05/27 17:46:46 iliaa Exp $ */ +/* $Id: soap.c,v 1.156.2.28.2.26 2007/07/13 14:00:05 dmitry Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -1848,8 +1848,6 @@ php_error_docref(NULL TSRMLS_CC, E_ERROR, Dump memory failed); } - snprintf(cont_len, sizeof(cont_len), Content-Length: %d, size); - sapi_add_header(cont_len, strlen(cont_len), 1); if (soap_version == SOAP_1_2) { sapi_add_header(Content-Type: application/soap+xml; charset=utf-8, sizeof(Content-Type: application/soap+xml; charset=utf-8)-1, 1); } else { @@ -1857,8 +1855,38 @@ } xmlFreeDoc(doc_return); - php_write(buf, size TSRMLS_CC); - xmlFree(buf); + + if (zend_ini_long(zlib.output_compression, sizeof(zlib.output_compression), 0) + zend_hash_exists(EG(function_table), ob_gzhandler, sizeof(ob_gzhandler))) { + zval nm_ob_gzhandler; + zval str; + zval mode; + zval result; + zval *params[2]; + + INIT_ZVAL(result); + ZVAL_STRINGL(nm_ob_gzhandler, ob_gzhandler, sizeof(ob_gzhandler) - 1, 0); + ZVAL_STRINGL(str, (char*)buf, size, 0); + params[0] = str; + ZVAL_LONG(mode, PHP_OUTPUT_HANDLER_START | PHP_OUTPUT_HANDLER_END); + params[1] = mode; + if (call_user_function(CG(function_table), NULL, nm_ob_gzhandler, result, 2, params TSRMLS_CC) != FAILURE + Z_TYPE(result) == IS_STRING + zend_alter_ini_entry(zlib.output_compression, sizeof(zlib.output_compression), 0, sizeof(0)-1, PHP_INI_USER, PHP_INI_STAGE_RUNTIME) == SUCCESS) { + xmlFree(buf); + buf = NULL; + snprintf(cont_len, sizeof(cont_len), Content-Length: %d, Z_STRLEN(result)); + sapi_add_header(cont_len, strlen(cont_len), 1); + php_write(Z_STRVAL(result), Z_STRLEN(result) TSRMLS_CC); + } + zval_dtor(result); + } + if (buf) { + snprintf(cont_len, sizeof(cont_len), Content-Length: %d, size); + sapi_add_header(cont_len, strlen(cont_len), 1); + php_write(buf, size TSRMLS_CC); + xmlFree(buf); + } } else { sapi_add_header(HTTP/1.1 202 Accepted, sizeof(HTTP/1.1 202 Accepted)-1, 1); sapi_add_header(Content-Length: 0, sizeof(Content-Length: 0)-1, 1); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/soap php_http.c
dmitry Fri Jul 13 09:15:04 2007 UTC Modified files: /php-src/ext/soap php_http.c Log: Fixed memleak http://cvs.php.net/viewvc.cgi/php-src/ext/soap/php_http.c?r1=1.107r2=1.108diff_format=u Index: php-src/ext/soap/php_http.c diff -u php-src/ext/soap/php_http.c:1.107 php-src/ext/soap/php_http.c:1.108 --- php-src/ext/soap/php_http.c:1.107 Mon May 28 23:43:24 2007 +++ php-src/ext/soap/php_http.c Fri Jul 13 09:15:03 2007 @@ -17,7 +17,7 @@ | Dmitry Stogov [EMAIL PROTECTED] | +--+ */ -/* $Id: php_http.c,v 1.107 2007/05/28 23:43:24 iliaa Exp $ */ +/* $Id: php_http.c,v 1.108 2007/07/13 09:15:03 dmitry Exp $ */ #include php_soap.h #include ext/standard/base64.h @@ -284,6 +284,7 @@ request_size = Z_STRLEN(retval); } else { if (request != buf) {efree(request);} + smart_str_free(soap_headers_z); return FALSE; } } @@ -305,6 +306,7 @@ if (phpurl != NULL) {php_url_free(phpurl);} if (request != buf) {efree(request);} add_soap_fault(this_ptr, HTTP, Unable to parse URL, NULL, NULL TSRMLS_CC); + smart_str_free(soap_headers_z); return FALSE; } @@ -315,6 +317,7 @@ php_url_free(phpurl); if (request != buf) {efree(request);} add_soap_fault(this_ptr, HTTP, Unknown protocol. Only http and https are allowed., NULL, NULL TSRMLS_CC); + smart_str_free(soap_headers_z); return FALSE; } @@ -328,6 +331,7 @@ if (request != buf) {efree(request);} add_soap_fault(this_ptr, HTTP, SSL support is not available in this build, NULL, NULL TSRMLS_CC); zend_alter_ini_entry(allow_url_fopen, sizeof(allow_url_fopen), old_allow_url_fopen_list, strlen(old_allow_url_fopen_list), PHP_INI_SYSTEM, PHP_INI_STAGE_RUNTIME); + smart_str_free(soap_headers_z); return FALSE; } @@ -381,6 +385,7 @@ if (request != buf) {efree(request);} add_soap_fault(this_ptr, HTTP, Could not connect to host, NULL, NULL TSRMLS_CC); zend_alter_ini_entry(allow_url_fopen, sizeof(allow_url_fopen), old_allow_url_fopen_list, strlen(old_allow_url_fopen_list), PHP_INI_SYSTEM, PHP_INI_STAGE_RUNTIME); + smart_str_free(soap_headers_z); return FALSE; } } @@ -437,7 +442,6 @@ } smart_str_append(soap_headers, soap_headers_z); - smart_str_free(soap_headers_z); if (soap_version == SOAP_1_2) { smart_str_append_const(soap_headers,Content-Type: application/soap+xml; charset=utf-8); @@ -690,12 +694,14 @@ client-stream = NULL; client-use_proxy = 0; add_soap_fault(this_ptr, HTTP, Failed Sending HTTP SOAP request, NULL, NULL TSRMLS_CC); + smart_str_free(soap_headers_z); return FALSE; } smart_str_free(soap_headers); } else { add_soap_fault(this_ptr, HTTP, Failed to create stream??, NULL, NULL TSRMLS_CC); + smart_str_free(soap_headers_z); return FALSE; } @@ -703,6 +709,7 @@ php_stream_close(stream); client-stream = NULL; client-use_proxy = 0; + smart_str_free(soap_headers_z); return TRUE; } @@ -714,6 +721,7 @@ client-stream = NULL; client-use_proxy = 0; add_soap_fault(this_ptr, HTTP, Error Fetching http headers, NULL, NULL TSRMLS_CC); + smart_str_free(soap_headers_z); return FALSE; } @@ -867,6 +875,7 @@ if (http_msg) { efree(http_msg); } + smart_str_free(soap_headers_z); return FALSE; } @@ -1009,6 +1018,7 @@ } if (auth) efree(auth); } + smart_str_free(soap_headers_z); /* Check and see if the server even sent a xml document */ content_type = get_http_header_value(http_headers,Content-Type: ); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_2) /ext/soap php_http.c
dmitry Fri Jul 13 09:14:03 2007 UTC Modified files: (Branch: PHP_5_2) /php-src/ext/soap php_http.c Log: Fixed memleak http://cvs.php.net/viewvc.cgi/php-src/ext/soap/php_http.c?r1=1.77.2.11.2.10r2=1.77.2.11.2.11diff_format=u Index: php-src/ext/soap/php_http.c diff -u php-src/ext/soap/php_http.c:1.77.2.11.2.10 php-src/ext/soap/php_http.c:1.77.2.11.2.11 --- php-src/ext/soap/php_http.c:1.77.2.11.2.10 Thu May 10 21:52:10 2007 +++ php-src/ext/soap/php_http.c Fri Jul 13 09:14:03 2007 @@ -17,7 +17,7 @@ | Dmitry Stogov [EMAIL PROTECTED] | +--+ */ -/* $Id: php_http.c,v 1.77.2.11.2.10 2007/05/10 21:52:10 tony2001 Exp $ */ +/* $Id: php_http.c,v 1.77.2.11.2.11 2007/07/13 09:14:03 dmitry Exp $ */ #include php_soap.h #include ext/standard/base64.h @@ -288,6 +288,7 @@ request_size = Z_STRLEN(retval); } else { if (request != buf) {efree(request);} + smart_str_free(soap_headers_z); return FALSE; } } @@ -311,6 +312,7 @@ if (phpurl != NULL) {php_url_free(phpurl);} if (request != buf) {efree(request);} add_soap_fault(this_ptr, HTTP, Unable to parse URL, NULL, NULL TSRMLS_CC); + smart_str_free(soap_headers_z); return FALSE; } @@ -321,6 +323,7 @@ php_url_free(phpurl); if (request != buf) {efree(request);} add_soap_fault(this_ptr, HTTP, Unknown protocol. Only http and https are allowed., NULL, NULL TSRMLS_CC); + smart_str_free(soap_headers_z); return FALSE; } @@ -331,6 +334,7 @@ if (request != buf) {efree(request);} add_soap_fault(this_ptr, HTTP, SSL support is not available in this build, NULL, NULL TSRMLS_CC); PG(allow_url_fopen) = old_allow_url_fopen; + smart_str_free(soap_headers_z); return FALSE; } @@ -380,6 +384,7 @@ if (request != buf) {efree(request);} add_soap_fault(this_ptr, HTTP, Could not connect to host, NULL, NULL TSRMLS_CC); PG(allow_url_fopen) = old_allow_url_fopen; + smart_str_free(soap_headers_z); return FALSE; } } @@ -438,7 +443,6 @@ } smart_str_append(soap_headers, soap_headers_z); - smart_str_free(soap_headers_z); if (soap_version == SOAP_1_2) { smart_str_append_const(soap_headers,Content-Type: application/soap+xml; charset=utf-8); @@ -695,6 +699,7 @@ } else { add_soap_fault(this_ptr, HTTP, Failed to create stream??, NULL, NULL TSRMLS_CC); + smart_str_free(soap_headers_z); return FALSE; } @@ -702,6 +707,7 @@ php_stream_close(stream); zend_hash_del(Z_OBJPROP_P(this_ptr), httpsocket, sizeof(httpsocket)); zend_hash_del(Z_OBJPROP_P(this_ptr), _use_proxy, sizeof(_use_proxy)); + smart_str_free(soap_headers_z); return TRUE; } @@ -713,6 +719,7 @@ zend_hash_del(Z_OBJPROP_P(this_ptr), httpsocket, sizeof(httpsocket)); zend_hash_del(Z_OBJPROP_P(this_ptr), _use_proxy, sizeof(_use_proxy)); add_soap_fault(this_ptr, HTTP, Error Fetching http headers, NULL, NULL TSRMLS_CC); + smart_str_free(soap_headers_z); return FALSE; } @@ -861,6 +868,7 @@ if (http_msg) { efree(http_msg); } + smart_str_free(soap_headers_z); return FALSE; } @@ -1008,6 +1016,7 @@ } if (auth) efree(auth); } + smart_str_free(soap_headers_z); /* Check and see if the server even sent a xml document */ content_type = get_http_header_value(http_headers,Content-Type: ); -- 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
dmitry Fri Jul 13 14:01:11 2007 UTC Modified files: /php-src/ext/soap soap.c Log: Fixed bug #41635 (SoapServer and zlib.output_compression with FastCGI result in major slowdown http://cvs.php.net/viewvc.cgi/php-src/ext/soap/soap.c?r1=1.224r2=1.225diff_format=u Index: php-src/ext/soap/soap.c diff -u php-src/ext/soap/soap.c:1.224 php-src/ext/soap/soap.c:1.225 --- php-src/ext/soap/soap.c:1.224 Fri Jul 6 10:36:20 2007 +++ php-src/ext/soap/soap.c Fri Jul 13 14:01:11 2007 @@ -17,7 +17,7 @@ | Dmitry Stogov [EMAIL PROTECTED] | +--+ */ -/* $Id: soap.c,v 1.224 2007/07/06 10:36:20 dmitry Exp $ */ +/* $Id: soap.c,v 1.225 2007/07/13 14:01:11 dmitry Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -2134,8 +2134,6 @@ php_error_docref(NULL TSRMLS_CC, E_ERROR, Dump memory failed); } - snprintf(cont_len, sizeof(cont_len), Content-Length: %d, size); - sapi_add_header(cont_len, strlen(cont_len), 1); if (soap_version == SOAP_1_2) { sapi_add_header(Content-Type: application/soap+xml; charset=utf-8, sizeof(Content-Type: application/soap+xml; charset=utf-8)-1, 1); } else { @@ -2147,10 +2145,18 @@ old_output_conv = UG(output_encoding_conv); UG(runtime_encoding_conv) = UG(utf8_conv); UG(output_encoding_conv) = UG(utf8_conv); + + if (zend_ini_long(zlib.output_compression, sizeof(zlib.output_compression), 0)) { + sapi_add_header(Connection: close, sizeof(Connection: close)-1, 1); + } else { + snprintf(cont_len, sizeof(cont_len), Content-Length: %d, size); + sapi_add_header(cont_len, strlen(cont_len), 1); + } php_write(buf, size TSRMLS_CC); + xmlFree(buf); + UG(runtime_encoding_conv) = old_runtime_conv; UG(output_encoding_conv) = old_output_conv; - xmlFree(buf); } else { sapi_add_header(HTTP/1.1 202 Accepted, sizeof(HTTP/1.1 202 Accepted)-1, 1); sapi_add_header(Content-Length: 0, sizeof(Content-Length: 0)-1, 1); -- 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 /ext/date/tests 010.phpt bug35499.phpt bug41523.phpt bug41964.phpt
dmitry Fri Jul 13 15:22:34 2007 UTC Modified files: /php-src/ext/date php_date.c /php-src/ext/date/tests 010.phpt bug35499.phpt bug41523.phpt bug41964.phpt Log: Unicode support http://cvs.php.net/viewvc.cgi/php-src/ext/date/php_date.c?r1=1.142r2=1.143diff_format=u Index: php-src/ext/date/php_date.c diff -u php-src/ext/date/php_date.c:1.142 php-src/ext/date/php_date.c:1.143 --- php-src/ext/date/php_date.c:1.142 Thu Jul 12 18:58:48 2007 +++ php-src/ext/date/php_date.c Fri Jul 13 15:22:34 2007 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: php_date.c,v 1.142 2007/07/12 18:58:48 derick Exp $ */ +/* $Id: php_date.c,v 1.143 2007/07/13 15:22:34 dmitry Exp $ */ #include php.h #include php_streams.h @@ -1915,16 +1915,16 @@ break; case TIMELIB_ZONETYPE_ID: if (parsed_time-tz_abbr) { - add_ascii_assoc_string(return_value, tz_abbr, parsed_time-tz_abbr, 1); + add_ascii_assoc_ascii_string(return_value, tz_abbr, parsed_time-tz_abbr, 1); } if (parsed_time-tz_info) { - add_ascii_assoc_string(return_value, tz_id, parsed_time-tz_info-name, 1); + add_ascii_assoc_ascii_string(return_value, tz_id, parsed_time-tz_info-name, 1); } break; case TIMELIB_ZONETYPE_ABBR: PHP_DATE_PARSE_DATE_SET_TIME_ELEMENT(zone, z); add_ascii_assoc_bool(return_value, is_dst, parsed_time-dst); - add_ascii_assoc_string(return_value, tz_abbr, parsed_time-tz_abbr, 1); + add_ascii_assoc_ascii_string(return_value, tz_abbr, parsed_time-tz_abbr, 1); break; } } @@ -2318,7 +2318,7 @@ add_ascii_assoc_string(element, time, php_format_date(DATE_FORMAT_ISO8601, 13, tzobj-tz-trans[i], 0 TSRMLS_CC), 0); add_ascii_assoc_long(element, offset, tzobj-tz-type[tzobj-tz-trans_idx[i]].offset); add_ascii_assoc_bool(element, isdst, tzobj-tz-type[tzobj-tz-trans_idx[i]].isdst); - add_ascii_assoc_string(element, abbr, tzobj-tz-timezone_abbr[tzobj-tz-type[tzobj-tz-trans_idx[i]].abbr_idx], 1); + add_ascii_assoc_ascii_string(element, abbr, tzobj-tz-timezone_abbr[tzobj-tz-type[tzobj-tz-trans_idx[i]].abbr_idx], 1); add_next_index_zval(return_value, element); } @@ -2364,7 +2364,7 @@ add_ascii_assoc_bool(element, dst, entry-type); add_ascii_assoc_long(element, offset, entry-gmtoffset); if (entry-full_tz_name) { - add_ascii_assoc_string(element, timezone_id, entry-full_tz_name, 1); + add_ascii_assoc_ascii_string(element, timezone_id, entry-full_tz_name, 1); } else { add_ascii_assoc_null(element, timezone_id); } http://cvs.php.net/viewvc.cgi/php-src/ext/date/tests/010.phpt?r1=1.2r2=1.3diff_format=u Index: php-src/ext/date/tests/010.phpt diff -u php-src/ext/date/tests/010.phpt:1.2 php-src/ext/date/tests/010.phpt:1.3 --- php-src/ext/date/tests/010.phpt:1.2 Fri Apr 20 20:57:57 2007 +++ php-src/ext/date/tests/010.phpt Fri Jul 13 15:22:34 2007 @@ -660,7 +660,7 @@ [uoffset]= int(-18000) [utimezone_id]= -string(16) America/New_York +unicode(16) America/New_York } [1]= array(3) { @@ -669,7 +669,7 @@ [uoffset]= int(-18000) [utimezone_id]= -string(15) America/Antigua +unicode(15) America/Antigua } [2]= array(3) { @@ -678,7 +678,7 @@ [uoffset]= int(-18000) [utimezone_id]= -string(16) America/Atikokan +unicode(16) America/Atikokan } [3]= array(3) { @@ -687,7 +687,7 @@ [uoffset]= int(-18000) [utimezone_id]= -string(21) America/Cambridge_Bay +unicode(21) America/Cambridge_Bay } [4]= array(3) { @@ -696,7 +696,7 @@ [uoffset]= int(-18000) [utimezone_id]= -string(14) America/Cancun +unicode(14) America/Cancun } [5]= array(3) { @@ -705,7 +705,7 @@ [uoffset]= int(-18000) [utimezone_id]= -string(14) America/Cayman +unicode(14) America/Cayman } [6]= array(3) { @@ -714,7 +714,7 @@ [uoffset]= int(-18000) [utimezone_id]= -string(15) America/Chicago +unicode(15) America/Chicago } [7]= array(3) { @@ -723,7 +723,7 @@ [uoffset]= int(-18000) [utimezone_id]= -string(21) America/Coral_Harbour +
[PHP-CVS] cvs: php-src /ext/standard/tests/file is_file_variation4.phpt
dmitry Mon Jul 23 08:57:47 2007 UTC Modified files: /php-src/ext/standard/tests/fileis_file_variation4.phpt Log: Fixed wrong expectation http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/file/is_file_variation4.phpt?r1=1.1r2=1.2diff_format=u Index: php-src/ext/standard/tests/file/is_file_variation4.phpt diff -u php-src/ext/standard/tests/file/is_file_variation4.phpt:1.1 php-src/ext/standard/tests/file/is_file_variation4.phpt:1.2 --- php-src/ext/standard/tests/file/is_file_variation4.phpt:1.1 Sat Jul 21 17:25:59 2007 +++ php-src/ext/standard/tests/file/is_file_variation4.phpt Mon Jul 23 08:57:47 2007 @@ -57,35 +57,15 @@ - Iteration 1 - bool(true) - Iteration 2 - -bool(true) +bool(false) - Iteration 3 - bool(true) - Iteration 4 - bool(true) - Iteration 5 - -bool(true) +bool(false) - Iteration 6 - -bool(true) -- Iteration 7 - -bool(true) -- Iteration 8 - -bool(true) - -*** Done *** ---UEXPECTF-- -*** Testing is_file() with different notations of file names *** -- Iteration 1 - -bool(true) -- Iteration 2 - -bool(true) -- Iteration 3 - -bool(true) -- Iteration 4 - -bool(true) -- Iteration 5 - -bool(true) -- Iteration 6 - -bool(true) +bool(false) - Iteration 7 - bool(true) - Iteration 8 - -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_2) /ext/standard/tests/file is_file_variation4.phpt
dmitry Mon Jul 23 08:58:17 2007 UTC Modified files: (Branch: PHP_5_2) /php-src/ext/standard/tests/fileis_file_variation4.phpt Log: Fixed wrong expectation http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/file/is_file_variation4.phpt?r1=1.1.2.2r2=1.1.2.3diff_format=u Index: php-src/ext/standard/tests/file/is_file_variation4.phpt diff -u php-src/ext/standard/tests/file/is_file_variation4.phpt:1.1.2.2 php-src/ext/standard/tests/file/is_file_variation4.phpt:1.1.2.3 --- php-src/ext/standard/tests/file/is_file_variation4.phpt:1.1.2.2 Sat Jul 21 17:34:03 2007 +++ php-src/ext/standard/tests/file/is_file_variation4.phpt Mon Jul 23 08:58:17 2007 @@ -57,15 +57,15 @@ - Iteration 1 - bool(true) - Iteration 2 - -bool(true) +bool(false) - Iteration 3 - bool(true) - Iteration 4 - bool(true) - Iteration 5 - -bool(true) +bool(false) - Iteration 6 - -bool(true) +bool(false) - Iteration 7 - bool(true) - Iteration 8 - -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_2) / NEWS /ext/soap php_http.c
dmitry Tue Jul 24 09:27:47 2007 UTC Modified files: (Branch: PHP_5_2) /php-srcNEWS /php-src/ext/soap php_http.c Log: Fixed bug #41983 (Error Fetching http headers terminated by '\n') http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.848r2=1.2027.2.547.2.849diff_format=u Index: php-src/NEWS diff -u php-src/NEWS:1.2027.2.547.2.848 php-src/NEWS:1.2027.2.547.2.849 --- php-src/NEWS:1.2027.2.547.2.848 Tue Jul 24 09:26:34 2007 +++ php-src/NEWSTue Jul 24 09:27:46 2007 @@ -68,6 +68,7 @@ - Fixed bug #42015 (ldap_rename(): server error DSA is unwilling to perform). (bob at mroczka dot com, Jani) - Fixed bug #41989 (move_uploaded_file() relative path in ZTS mode). (Tony) +- Fixed bug #41983 (Error Fetching http headers terminated by '\n'). (Dmitry) - Fixed bug #41964 (strtotime returns a timestamp for non-time string of pattern '(A|a) .+'). (Derick) - Fixed bug #41961 (Ensure search for hidden private methods does not stray http://cvs.php.net/viewvc.cgi/php-src/ext/soap/php_http.c?r1=1.77.2.11.2.11r2=1.77.2.11.2.12diff_format=u Index: php-src/ext/soap/php_http.c diff -u php-src/ext/soap/php_http.c:1.77.2.11.2.11 php-src/ext/soap/php_http.c:1.77.2.11.2.12 --- php-src/ext/soap/php_http.c:1.77.2.11.2.11 Fri Jul 13 09:14:03 2007 +++ php-src/ext/soap/php_http.c Tue Jul 24 09:27:46 2007 @@ -17,7 +17,7 @@ | Dmitry Stogov [EMAIL PROTECTED] | +--+ */ -/* $Id: php_http.c,v 1.77.2.11.2.11 2007/07/13 09:14:03 dmitry Exp $ */ +/* $Id: php_http.c,v 1.77.2.11.2.12 2007/07/24 09:27:46 dmitry Exp $ */ #include php_soap.h #include ext/standard/base64.h @@ -1153,17 +1153,19 @@ /* match */ tmp = pos + typelen; - eol = strstr(tmp, \r\n); + eol = strchr(tmp, '\n'); if (eol == NULL) { eol = headers + headerslen; + } else if (eol tmp *(eol-1) == '\r') { + eol--; } return estrndup(tmp, eol - tmp); } /* find next line */ - pos = strstr(pos, \r\n); + pos = strchr(pos, '\n'); if (pos) { - pos += 2; + pos++; } } while (pos); @@ -1203,7 +1205,7 @@ } if (header_chunked) { - char done, chunk_size[10]; + char ch, done, chunk_size[10], headerbuf[8192]; done = FALSE; @@ -1231,11 +1233,20 @@ len_size += len_read; http_buf_size += len_read; } - } - /* Eat up '\r' '\n' */ - php_stream_getc(stream); - php_stream_getc(stream); + /* Eat up '\r' '\n' */ + ch = php_stream_getc(stream); + if (ch == '\r') { + ch = php_stream_getc(stream); + } + if (ch != '\n') { + /* Somthing wrong in chunked encoding */ + if (http_buf) { + efree(http_buf); + } + return FALSE; + } + } } else { /* Somthing wrong in chunked encoding */ if (http_buf) { @@ -1248,6 +1259,19 @@ } } + /* Ignore trailer headers */ + while (1) { + if (!php_stream_gets(stream, headerbuf, sizeof(headerbuf))) { + break; + } + + if ((headerbuf[0] == '\r' headerbuf[1] == '\n') || + (headerbuf[0] == '\n')) { + /* empty line marks end of headers */ + break; + } + } + if (http_buf == NULL) { http_buf = emalloc(1); } @@ -1294,7 +1318,8 @@ break; } - if (strcmp(headerbuf, \r\n) == 0) { + if ((headerbuf[0] == '\r' headerbuf[1] == '\n') || + (headerbuf[0
[PHP-CVS] cvs: php-src /ext/soap php_http.c
dmitry Tue Jul 24 09:28:12 2007 UTC Modified files: /php-src/ext/soap php_http.c Log: Fixed bug #41983 (Error Fetching http headers terminated by '\n') http://cvs.php.net/viewvc.cgi/php-src/ext/soap/php_http.c?r1=1.108r2=1.109diff_format=u Index: php-src/ext/soap/php_http.c diff -u php-src/ext/soap/php_http.c:1.108 php-src/ext/soap/php_http.c:1.109 --- php-src/ext/soap/php_http.c:1.108 Fri Jul 13 09:15:03 2007 +++ php-src/ext/soap/php_http.c Tue Jul 24 09:28:12 2007 @@ -17,7 +17,7 @@ | Dmitry Stogov [EMAIL PROTECTED] | +--+ */ -/* $Id: php_http.c,v 1.108 2007/07/13 09:15:03 dmitry Exp $ */ +/* $Id: php_http.c,v 1.109 2007/07/24 09:28:12 dmitry Exp $ */ #include php_soap.h #include ext/standard/base64.h @@ -1155,17 +1155,19 @@ /* match */ tmp = pos + typelen; - eol = strstr(tmp, \r\n); + eol = strchr(tmp, '\n'); if (eol == NULL) { eol = headers + headerslen; + } else if (eol tmp *(eol-1) == '\r') { + eol--; } return estrndup(tmp, eol - tmp); } /* find next line */ - pos = strstr(pos, \r\n); + pos = strchr(pos, '\n'); if (pos) { - pos += 2; + pos++; } } while (pos); @@ -1205,7 +1207,7 @@ } if (header_chunked) { - char done, chunk_size[10]; + char ch, done, chunk_size[10], headerbuf[8192]; done = FALSE; @@ -1233,11 +1235,20 @@ len_size += len_read; http_buf_size += len_read; } - } - /* Eat up '\r' '\n' */ - php_stream_getc(stream); - php_stream_getc(stream); + /* Eat up '\r' '\n' */ + ch = php_stream_getc(stream); + if (ch == '\r') { + ch = php_stream_getc(stream); + } + if (ch != '\n') { + /* Somthing wrong in chunked encoding */ + if (http_buf) { + efree(http_buf); + } + return FALSE; + } + } } else { /* Somthing wrong in chunked encoding */ if (http_buf) { @@ -1250,6 +1261,19 @@ } } + /* Ignore trailer headers */ + while (1) { + if (!php_stream_gets(stream, ZSTR(headerbuf), sizeof(headerbuf))) { + break; + } + + if ((headerbuf[0] == '\r' headerbuf[1] == '\n') || + (headerbuf[0] == '\n')) { + /* empty line marks end of headers */ + break; + } + } + if (http_buf == NULL) { http_buf = emalloc(1); } @@ -1296,7 +1320,8 @@ break; } - if (strcmp(headerbuf, \r\n) == 0) { + if ((headerbuf[0] == '\r' headerbuf[1] == '\n') || + (headerbuf[0] == '\n')) { /* empty line marks end of headers */ done = TRUE; break; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_2) / NEWS /ext/pdo/tests pdo_018.phpt /tests/classes visibility_005.phpt ZendEngine2 zend_builtin_functions.c zend_object_handlers.c ZendEngine2/tests bug27798.phpt bu
dmitry Tue Jul 24 11:39:56 2007 UTC Added files: (Branch: PHP_5_2) /ZendEngine2/tests bug40757.phpt bug41929.phpt Modified files: /php-srcNEWS /ZendEngine2zend_builtin_functions.c zend_object_handlers.c /ZendEngine2/tests bug27798.phpt /php-src/ext/pdo/tests pdo_018.phpt /php-src/tests/classes visibility_005.phpt Log: Fixed bug #40757 (get_object_vars get nothing in child class) Fixed bug #41929 (Foreach on object does not iterate over all visible properties) http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.850r2=1.2027.2.547.2.851diff_format=u Index: php-src/NEWS diff -u php-src/NEWS:1.2027.2.547.2.850 php-src/NEWS:1.2027.2.547.2.851 --- php-src/NEWS:1.2027.2.547.2.850 Tue Jul 24 11:35:08 2007 +++ php-src/NEWSTue Jul 24 11:39:55 2007 @@ -76,6 +76,8 @@ from class hierarchy). (robin_fernandes at uk dot ibm dot com) - Fixed bug #41947 (SimpleXML incorrectly registers empty strings as namespaces). (Rob) +- Fixed bug #41929 (Foreach on object does not iterate over all visible + properties). (Dmitry) - Fixed bug #41919 (crash in string to array conversion). (judas dot iscariote at gmail dot com, Ilia) - Fixed bug #41908 (CFLAGS=-Os ./configure --enable-debug fails). @@ -160,6 +162,7 @@ on Windows). (Scott, Andrey) - Fixed bug #41127 (Memory leak in ldap_{first|next}_attribute functions). (Jani) +- Fixed bug #40757 (get_object_vars get nothing in child class). (Dmitry) - Fixed bug #40419 (Trailing slash in CGI request does not work). (Dmitry) - Fixed bug #39330 (apache2handler does not call shutdown actions before apache child die). (isk at ecommerce dot com, Gopal, Tony) http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_builtin_functions.c?r1=1.277.2.12.2.18r2=1.277.2.12.2.19diff_format=u Index: ZendEngine2/zend_builtin_functions.c diff -u ZendEngine2/zend_builtin_functions.c:1.277.2.12.2.18 ZendEngine2/zend_builtin_functions.c:1.277.2.12.2.19 --- ZendEngine2/zend_builtin_functions.c:1.277.2.12.2.18Sat Jun 9 08:38:44 2007 +++ ZendEngine2/zend_builtin_functions.cTue Jul 24 11:39:55 2007 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: zend_builtin_functions.c,v 1.277.2.12.2.18 2007/06/09 08:38:44 johannes Exp $ */ +/* $Id: zend_builtin_functions.c,v 1.277.2.12.2.19 2007/07/24 11:39:55 dmitry Exp $ */ #include zend.h #include zend_API.h @@ -789,7 +789,7 @@ char *key, *prop_name, *class_name; uint key_len; ulong num_index; - int instanceof; + zend_object *zobj; if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, obj) == FAILURE) { ZEND_WRONG_PARAM_COUNT(); @@ -808,7 +808,7 @@ RETURN_FALSE; } - instanceof = EG(This) instanceof_function(Z_OBJCE_P(EG(This)), Z_OBJCE_PP(obj) TSRMLS_CC); + zobj = zend_objects_get_address(*obj TSRMLS_CC); array_init(return_value); @@ -816,17 +816,11 @@ while (zend_hash_get_current_data_ex(properties, (void **) value, pos) == SUCCESS) { if (zend_hash_get_current_key_ex(properties, key, key_len, num_index, 0, pos) == HASH_KEY_IS_STRING) { - if (key[0]) { + if (zend_check_property_access(zobj, key, key_len-1 TSRMLS_CC) == SUCCESS) { + zend_unmangle_property_name(key, key_len-1, class_name, prop_name); /* Not separating references */ (*value)-refcount++; - add_assoc_zval_ex(return_value, key, key_len, *value); - } else if (instanceof) { - zend_unmangle_property_name(key, key_len-1, class_name, prop_name); - if (!memcmp(class_name, *, 2) || (Z_OBJCE_P(EG(This)) == Z_OBJCE_PP(obj) !strcmp(Z_OBJCE_P(EG(This))-name, class_name))) { - /* Not separating references */ - (*value)-refcount++; - add_assoc_zval_ex(return_value, prop_name, strlen(prop_name)+1, *value); - } + add_assoc_zval_ex(return_value, prop_name, strlen(prop_name)+1, *value); } } zend_hash_move_forward_ex(properties, pos); http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_object_handlers.c?r1=1.135.2.6.2.21r2=1.135.2.6.2.22diff_format=u Index: ZendEngine2/zend_object_handlers.c diff -u ZendEngine2/zend_object_handlers.c:1.135.2.6.2.21 ZendEngine2/zend_object_handlers.c:1.135.2.6.2.22 --- ZendEngine2/zend_object_handlers.c:1.135.2.6.2.21 Thu Jul 12 10:32:09 2007 +++ ZendEngine2/zend_object_handlers.c Tue Jul 24 11:39:55 2007 @@ -17,7 +17,7 @@
[PHP-CVS] cvs: php-src /tests/classes visibility_005.phpt ZendEngine2 zend_builtin_functions.c zend_object_handlers.c ZendEngine2/tests bug27798.phpt bug40757.phpt bug41929.phpt
dmitry Tue Jul 24 11:40:08 2007 UTC Modified files: /ZendEngine2zend_builtin_functions.c zend_object_handlers.c /ZendEngine2/tests bug40757.phpt bug41929.phpt bug27798.phpt /php-src/tests/classes visibility_005.phpt Log: Fixed bug #40757 (get_object_vars get nothing in child class) Fixed bug #41929 (Foreach on object does not iterate over all visible properties) http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_builtin_functions.c?r1=1.342r2=1.343diff_format=u Index: ZendEngine2/zend_builtin_functions.c diff -u ZendEngine2/zend_builtin_functions.c:1.342 ZendEngine2/zend_builtin_functions.c:1.343 --- ZendEngine2/zend_builtin_functions.c:1.342 Tue Jul 10 15:06:58 2007 +++ ZendEngine2/zend_builtin_functions.cTue Jul 24 11:40:07 2007 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: zend_builtin_functions.c,v 1.342 2007/07/10 15:06:58 tony2001 Exp $ */ +/* $Id: zend_builtin_functions.c,v 1.343 2007/07/24 11:40:07 dmitry Exp $ */ #include zend.h #include zend_API.h @@ -816,7 +816,7 @@ zstr key, prop_name, class_name; uint key_len; ulong num_index; - int instanceof; + zend_object *zobj; if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, obj) == FAILURE) { ZEND_WRONG_PARAM_COUNT(); @@ -835,7 +835,7 @@ RETURN_FALSE; } - instanceof = EG(This) instanceof_function(Z_OBJCE_P(EG(This)), Z_OBJCE_PP(obj) TSRMLS_CC); + zobj = zend_objects_get_address(*obj TSRMLS_CC); array_init(return_value); @@ -843,19 +843,11 @@ while (zend_hash_get_current_data_ex(properties, (void **) value, pos) == SUCCESS) { if (zend_hash_get_current_key_ex(properties, key, key_len, num_index, 0, pos) == (UG(unicode)?HASH_KEY_IS_UNICODE:HASH_KEY_IS_STRING)) { - zend_u_unmangle_property_name(UG(unicode)?IS_UNICODE:IS_STRING, key, key_len-1, class_name, prop_name); - if (class_name.v == NULL) { + if (zend_check_property_access(zobj, ZEND_STR_TYPE, key, key_len-1 TSRMLS_CC) == SUCCESS) { + zend_u_unmangle_property_name(ZEND_STR_TYPE, key, key_len-1, class_name, prop_name); /* Not separating references */ (*value)-refcount++; - add_u_assoc_zval_ex(return_value, UG(unicode)?IS_UNICODE:IS_STRING, key, key_len, *value); - } else if (instanceof) { - if (class_name.s[0] == '*' || - (Z_OBJCE_P(EG(This)) == Z_OBJCE_PP(obj) - UG(unicode)?!u_strcmp(Z_OBJCE_P(EG(This))-name.u, class_name.u):!strcmp(Z_OBJCE_P(EG(This))-name.s, class_name.s))) { - /* Not separating references */ - (*value)-refcount++; - add_u_assoc_zval(return_value, UG(unicode)?IS_UNICODE:IS_STRING, prop_name, *value); - } + add_u_assoc_zval(return_value, ZEND_STR_TYPE, prop_name, *value); } } zend_hash_move_forward_ex(properties, pos); http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_object_handlers.c?r1=1.187r2=1.188diff_format=u Index: ZendEngine2/zend_object_handlers.c diff -u ZendEngine2/zend_object_handlers.c:1.187 ZendEngine2/zend_object_handlers.c:1.188 --- ZendEngine2/zend_object_handlers.c:1.187Sat Jul 21 05:27:07 2007 +++ ZendEngine2/zend_object_handlers.c Tue Jul 24 11:40:07 2007 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: zend_object_handlers.c,v 1.187 2007/07/21 05:27:07 pollita Exp $ */ +/* $Id: zend_object_handlers.c,v 1.188 2007/07/24 11:40:07 dmitry Exp $ */ #include zend.h #include zend_globals.h @@ -164,7 +164,7 @@ case ZEND_ACC_PROTECTED: return zend_check_protected(property_info-ce, EG(scope)); case ZEND_ACC_PRIVATE: - if (ce==EG(scope) EG(scope)) { + if ((ce==EG(scope) || property_info-ce == EG(scope)) EG(scope)) { return 1; } else { return 0; http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug40757.phpt?r1=1.1r2=1.2diff_format=u Index: ZendEngine2/tests/bug40757.phpt diff -u /dev/null ZendEngine2/tests/bug40757.phpt:1.2 --- /dev/null Tue Jul 24 11:40:07 2007 +++ ZendEngine2/tests/bug40757.phpt Tue Jul 24 11:40:07 2007 @@ -0,0 +1,28 @@ +--TEST-- +Bug #40757 (get_object_vars() get nothing in child class) +--FILE-- +?php +class Base { + private $p1='sadf'; + + function getFields($obj){ +
[PHP-CVS] cvs: php-src(PHP_5_2) / NEWS /main/streams xp_socket.c
dmitry Tue Jul 24 14:24:44 2007 UTC Modified files: (Branch: PHP_5_2) /php-srcNEWS /php-src/main/streams xp_socket.c Log: Fixed bug #41984 (Hangs on large SoapClient requests) http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.852r2=1.2027.2.547.2.853diff_format=u Index: php-src/NEWS diff -u php-src/NEWS:1.2027.2.547.2.852 php-src/NEWS:1.2027.2.547.2.853 --- php-src/NEWS:1.2027.2.547.2.852 Tue Jul 24 14:21:36 2007 +++ php-src/NEWSTue Jul 24 14:24:44 2007 @@ -72,6 +72,7 @@ - Fixed bug #42015 (ldap_rename(): server error DSA is unwilling to perform). (bob at mroczka dot com, Jani) - Fixed bug #41989 (move_uploaded_file() relative path in ZTS mode). (Tony) +- Fixed bug #41984 (Hangs on large SoapClient requests). (Dmitry) - Fixed bug #41983 (Error Fetching http headers terminated by '\n'). (Dmitry) - Fixed bug #41964 (strtotime returns a timestamp for non-time string of pattern '(A|a) .+'). (Derick) http://cvs.php.net/viewvc.cgi/php-src/main/streams/xp_socket.c?r1=1.33.2.2.2.5r2=1.33.2.2.2.6diff_format=u Index: php-src/main/streams/xp_socket.c diff -u php-src/main/streams/xp_socket.c:1.33.2.2.2.5 php-src/main/streams/xp_socket.c:1.33.2.2.2.6 --- php-src/main/streams/xp_socket.c:1.33.2.2.2.5 Tue Jul 17 13:28:44 2007 +++ php-src/main/streams/xp_socket.cTue Jul 24 14:24:44 2007 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: xp_socket.c,v 1.33.2.2.2.5 2007/07/17 13:28:44 jani Exp $ */ +/* $Id: xp_socket.c,v 1.33.2.2.2.6 2007/07/24 14:24:44 dmitry Exp $ */ #include php.h #include ext/standard/file.h @@ -31,6 +31,10 @@ #include sys/un.h #endif +#ifndef MSG_DONTWAIT +# define MSG_DONTWAIT 0 +#endif + php_stream_ops php_stream_generic_socket_ops; PHPAPI php_stream_ops php_stream_socket_ops; php_stream_ops php_stream_udp_socket_ops; @@ -59,7 +63,7 @@ ptimeout = sock-timeout; retry: - didwrite = send(sock-socket, buf, count, 0); + didwrite = send(sock-socket, buf, count, (sock-is_blocked ptimeout) ? MSG_DONTWAIT : 0); if (didwrite = 0) { long err = php_socket_errno(); @@ -148,7 +152,7 @@ return 0; } - nr_bytes = recv(sock-socket, buf, count, 0); + nr_bytes = recv(sock-socket, buf, count, (sock-is_blocked sock-timeout.tv_sec != -1) ? MSG_DONTWAIT : 0); stream-eof = (nr_bytes == 0 || (nr_bytes == -1 php_socket_errno() != EWOULDBLOCK)); -- 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/general_functions debug_zval_dump_o.phpt
dmitry Tue Jul 24 20:03:30 2007 UTC Modified files: /php-src/ext/standard/tests/general_functions debug_zval_dump_o.phpt Log: Fixed test http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/general_functions/debug_zval_dump_o.phpt?r1=1.3r2=1.4diff_format=u Index: php-src/ext/standard/tests/general_functions/debug_zval_dump_o.phpt diff -u php-src/ext/standard/tests/general_functions/debug_zval_dump_o.phpt:1.3 php-src/ext/standard/tests/general_functions/debug_zval_dump_o.phpt:1.4 --- php-src/ext/standard/tests/general_functions/debug_zval_dump_o.phpt:1.3 Tue May 29 12:26:59 2007 +++ php-src/ext/standard/tests/general_functions/debug_zval_dump_o.phpt Tue Jul 24 20:03:30 2007 @@ -116,7 +116,7 @@ --EXPECTF-- *** Testing debug_zval_dump() on objects *** -- Iteration 1 -- -object(object_class)#%d (6) refcount(4){ +object(object_class)#%d (6) refcount(5){ [value1]= long(5) refcount(1) [value2:object_class:private]= @@ -124,7 +124,7 @@ [value3:protected]= long(20) refcount(5) [value4]= - long(30) refcount(6) + long(30) refcount(7) [array_var]= array(2) refcount(5){ [key1]= @@ -133,7 +133,7 @@ long(3) refcount(1) } [object_class1]= - object(object_class)#%d (6) refcount(4){ + object(object_class)#%d (6) refcount(5){ [value1]= long(5) refcount(1) [value2:object_class:private]= @@ -141,7 +141,7 @@ [value3:protected]= long(20) refcount(5) [value4]= -long(30) refcount(6) +long(30) refcount(7) [array_var]= array(2) refcount(5){ [key1]= @@ -154,10 +154,10 @@ } } -- Iteration 2 -- -object(no_member_class)#%d (0) refcount(3){ +object(no_member_class)#%d (0) refcount(4){ } -- Iteration 3 -- -object(contains_object_class)#%d (9) refcount(3){ +object(contains_object_class)#%d (9) refcount(4){ [p]= long(30) refcount(2) [p1:protected]= @@ -165,7 +165,7 @@ [p2:contains_object_class:private]= long(50) refcount(2) [class_object1]= - object(object_class)#%d (6) refcount(5){ + object(object_class)#%d (6) refcount(7){ [value1]= long(5) refcount(1) [value2:object_class:private]= @@ -173,7 +173,7 @@ [value3:protected]= long(20) refcount(5) [value4]= -long(30) refcount(6) +long(30) refcount(7) [array_var]= array(2) refcount(5){ [key1]= @@ -182,7 +182,7 @@ long(3) refcount(1) } [object_class1]= -object(object_class)#%d (6) refcount(5){ +object(object_class)#%d (6) refcount(7){ [value1]= long(5) refcount(1) [value2:object_class:private]= @@ -190,7 +190,7 @@ [value3:protected]= long(20) refcount(5) [value4]= - long(30) refcount(6) + long(30) refcount(7) [array_var]= array(2) refcount(5){ [key1]= @@ -203,7 +203,7 @@ } } [class_object2]= - object(object_class)#%d (6) refcount(5){ + object(object_class)#%d (6) refcount(7){ [value1]= long(5) refcount(1) [value2:object_class:private]= @@ -211,7 +211,7 @@ [value3:protected]= long(20) refcount(5) [value4]= -long(30) refcount(6) +long(30) refcount(7) [array_var]= array(2) refcount(5){ [key1]= @@ -220,7 +220,7 @@ long(3) refcount(1) } [object_class1]= -object(object_class)#%d (6) refcount(5){ +object(object_class)#%d (6) refcount(7){ [value1]= long(5) refcount(1) [value2:object_class:private]= @@ -228,7 +228,7 @@ [value3:protected]= long(20) refcount(5) [value4]= - long(30) refcount(6) + long(30) refcount(7) [array_var]= array(2) refcount(5){ [key1]= @@ -241,7 +241,7 @@ } } [class_object3:contains_object_class:private]= - object(object_class)#%d (6) refcount(5){ + object(object_class)#%d (6) refcount(7){ [value1]= long(5) refcount(1) [value2:object_class:private]= @@ -249,7 +249,7 @@ [value3:protected]= long(20) refcount(5) [value4]= -long(30) refcount(6) +long(30) refcount(7) [array_var]= array(2) refcount(5){ [key1]= @@ -258,7 +258,7 @@ long(3) refcount(1) } [object_class1]= -object(object_class)#%d (6) refcount(5){ +object(object_class)#%d (6) refcount(7){ [value1]= long(5) refcount(1) [value2:object_class:private]= @@ -266,7 +266,7 @@ [value3:protected]= long(20) refcount(5) [value4]= - long(30) refcount(6) + long(30) refcount(7) [array_var]= array(2) refcount(5){ [key1]= @@ -279,7 +279,7 @@ } } [class_object4:protected]= - object(object_class)#%d (6) refcount(5){ + object(object_class)#%d (6) refcount(7){ [value1]= long(5) refcount(1) [value2:object_class:private]= @@ -287,7 +287,7 @@ [value3:protected]= long(20) refcount(5)
[PHP-CVS] cvs: php-src(PHP_5_2) /ext/standard/tests/general_functions debug_zval_dump_o.phpt
dmitry Tue Jul 24 20:08:33 2007 UTC Modified files: (Branch: PHP_5_2) /php-src/ext/standard/tests/general_functions debug_zval_dump_o.phpt Log: Fixed test http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/general_functions/debug_zval_dump_o.phpt?r1=1.1.2.1r2=1.1.2.2diff_format=u Index: php-src/ext/standard/tests/general_functions/debug_zval_dump_o.phpt diff -u php-src/ext/standard/tests/general_functions/debug_zval_dump_o.phpt:1.1.2.1 php-src/ext/standard/tests/general_functions/debug_zval_dump_o.phpt:1.1.2.2 --- php-src/ext/standard/tests/general_functions/debug_zval_dump_o.phpt:1.1.2.1 Sat May 12 10:28:00 2007 +++ php-src/ext/standard/tests/general_functions/debug_zval_dump_o.phpt Tue Jul 24 20:08:33 2007 @@ -116,7 +116,7 @@ --EXPECTF-- *** Testing debug_zval_dump() on objects *** -- Iteration 1 -- -object(object_class)#%d (6) refcount(4){ +object(object_class)#%d (6) refcount(5){ [value1]= long(5) refcount(1) [value2:private]= @@ -124,7 +124,7 @@ [value3:protected]= long(20) refcount(5) [value4]= - long(30) refcount(6) + long(30) refcount(7) [array_var]= array(2) refcount(5){ [key1]= @@ -133,7 +133,7 @@ long(3) refcount(1) } [object_class1]= - object(object_class)#%d (6) refcount(4){ + object(object_class)#%d (6) refcount(5){ [value1]= long(5) refcount(1) [value2:private]= @@ -141,7 +141,7 @@ [value3:protected]= long(20) refcount(5) [value4]= -long(30) refcount(6) +long(30) refcount(7) [array_var]= array(2) refcount(5){ [key1]= @@ -154,10 +154,10 @@ } } -- Iteration 2 -- -object(no_member_class)#%d (0) refcount(3){ +object(no_member_class)#%d (0) refcount(4){ } -- Iteration 3 -- -object(contains_object_class)#%d (9) refcount(3){ +object(contains_object_class)#%d (9) refcount(4){ [p]= long(30) refcount(2) [p1:protected]= @@ -165,7 +165,7 @@ [p2:private]= long(50) refcount(2) [class_object1]= - object(object_class)#%d (6) refcount(5){ + object(object_class)#%d (6) refcount(7){ [value1]= long(5) refcount(1) [value2:private]= @@ -173,7 +173,7 @@ [value3:protected]= long(20) refcount(5) [value4]= -long(30) refcount(6) +long(30) refcount(7) [array_var]= array(2) refcount(5){ [key1]= @@ -182,7 +182,7 @@ long(3) refcount(1) } [object_class1]= -object(object_class)#%d (6) refcount(5){ +object(object_class)#%d (6) refcount(7){ [value1]= long(5) refcount(1) [value2:private]= @@ -190,7 +190,7 @@ [value3:protected]= long(20) refcount(5) [value4]= - long(30) refcount(6) + long(30) refcount(7) [array_var]= array(2) refcount(5){ [key1]= @@ -203,7 +203,7 @@ } } [class_object2]= - object(object_class)#%d (6) refcount(5){ + object(object_class)#%d (6) refcount(7){ [value1]= long(5) refcount(1) [value2:private]= @@ -211,7 +211,7 @@ [value3:protected]= long(20) refcount(5) [value4]= -long(30) refcount(6) +long(30) refcount(7) [array_var]= array(2) refcount(5){ [key1]= @@ -220,7 +220,7 @@ long(3) refcount(1) } [object_class1]= -object(object_class)#%d (6) refcount(5){ +object(object_class)#%d (6) refcount(7){ [value1]= long(5) refcount(1) [value2:private]= @@ -228,7 +228,7 @@ [value3:protected]= long(20) refcount(5) [value4]= - long(30) refcount(6) + long(30) refcount(7) [array_var]= array(2) refcount(5){ [key1]= @@ -241,7 +241,7 @@ } } [class_object3:private]= - object(object_class)#%d (6) refcount(5){ + object(object_class)#%d (6) refcount(7){ [value1]= long(5) refcount(1) [value2:private]= @@ -249,7 +249,7 @@ [value3:protected]= long(20) refcount(5) [value4]= -long(30) refcount(6) +long(30) refcount(7) [array_var]= array(2) refcount(5){ [key1]= @@ -258,7 +258,7 @@ long(3) refcount(1) } [object_class1]= -object(object_class)#%d (6) refcount(5){ +object(object_class)#%d (6) refcount(7){ [value1]= long(5) refcount(1) [value2:private]= @@ -266,7 +266,7 @@ [value3:protected]= long(20) refcount(5) [value4]= - long(30) refcount(6) + long(30) refcount(7) [array_var]= array(2) refcount(5){ [key1]= @@ -279,7 +279,7 @@ } } [class_object4:protected]= - object(object_class)#%d (6) refcount(5){ + object(object_class)#%d (6) refcount(7){ [value1]= long(5) refcount(1) [value2:private]= @@ -287,7 +287,7 @@ [value3:protected]= long(20) refcount(5) [value4]= -long(30) refcount(6) +long(30) refcount(7) [array_var]= array(2) refcount(5){ [key1]= @@ -296,7
[PHP-CVS] cvs: php-src /ext/standard/tests/file fgets_variation1.phpt fread_variation2.phpt fread_variation4-win32.phpt fread_variation4.phpt /main/streams plain_wrapper.c
dmitry Wed Jul 25 16:34:27 2007 UTC Modified files: /php-src/main/streams plain_wrapper.c /php-src/ext/standard/tests/filefgets_variation1.phpt fread_variation2.phpt fread_variation4-win32.phpt fread_variation4.phpt Log: Fixed EOF handling in case of reading from file opened in write only mode. http://cvs.php.net/viewvc.cgi/php-src/main/streams/plain_wrapper.c?r1=1.89r2=1.90diff_format=u Index: php-src/main/streams/plain_wrapper.c diff -u php-src/main/streams/plain_wrapper.c:1.89 php-src/main/streams/plain_wrapper.c:1.90 --- php-src/main/streams/plain_wrapper.c:1.89 Tue Jul 10 20:13:29 2007 +++ php-src/main/streams/plain_wrapper.cWed Jul 25 16:34:27 2007 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: plain_wrapper.c,v 1.89 2007/07/10 20:13:29 sas Exp $ */ +/* $Id: plain_wrapper.c,v 1.90 2007/07/25 16:34:27 dmitry Exp $ */ #include php.h #include php_globals.h @@ -342,7 +342,7 @@ ret = read(data-fd, buf, count); } - stream-eof = (ret == 0 || (ret == (size_t)-1 errno != EWOULDBLOCK errno != EINTR)); + stream-eof = (ret == 0 || (ret == (size_t)-1 errno != EWOULDBLOCK errno != EINTR errno != EBADF)); } else { #if HAVE_FLUSHIO http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/file/fgets_variation1.phpt?r1=1.3r2=1.4diff_format=u Index: php-src/ext/standard/tests/file/fgets_variation1.phpt diff -u php-src/ext/standard/tests/file/fgets_variation1.phpt:1.3 php-src/ext/standard/tests/file/fgets_variation1.phpt:1.4 --- php-src/ext/standard/tests/file/fgets_variation1.phpt:1.3 Mon Jul 23 10:44:04 2007 +++ php-src/ext/standard/tests/file/fgets_variation1.phpt Wed Jul 25 16:34:27 2007 @@ -84,7 +84,7 @@ bool(false) bool(false) int(0) -bool(true) +bool(false) -- File opened in mode : at -- bool(true) int(0) @@ -150,7 +150,7 @@ bool(false) bool(false) int(0) -bool(true) +bool(false) -- File opened in mode : at -- bool(true) int(0) http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/file/fread_variation2.phpt?r1=1.3r2=1.4diff_format=u Index: php-src/ext/standard/tests/file/fread_variation2.phpt diff -u php-src/ext/standard/tests/file/fread_variation2.phpt:1.3 php-src/ext/standard/tests/file/fread_variation2.phpt:1.4 --- php-src/ext/standard/tests/file/fread_variation2.phpt:1.3 Mon Jul 23 10:44:04 2007 +++ php-src/ext/standard/tests/file/fread_variation2.phpt Wed Jul 25 16:34:27 2007 @@ -652,6 +652,7 @@ Reading 1000 bytes from file, expecting 0 bytes ... OK int(0) bool(false) + Done --UEXPECTF-- *** Testing fread() : usage variations *** @@ -1202,4 +1203,5 @@ Reading 1000 bytes from file, expecting 0 bytes ... OK int(0) bool(false) + Done http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/file/fread_variation4-win32.phpt?r1=1.1r2=1.2diff_format=u Index: php-src/ext/standard/tests/file/fread_variation4-win32.phpt diff -u php-src/ext/standard/tests/file/fread_variation4-win32.phpt:1.1 php-src/ext/standard/tests/file/fread_variation4-win32.phpt:1.2 --- php-src/ext/standard/tests/file/fread_variation4-win32.phpt:1.1 Sun Jul 22 17:38:48 2007 +++ php-src/ext/standard/tests/file/fread_variation4-win32.phpt Wed Jul 25 16:34:27 2007 @@ -117,596 +117,236 @@ bool(false) Reading 1030 bytes from file, expecting 0 bytes ... OK int(0) -bool(true) --- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes -- -int(1024) bool(false) -Reading 10 bytes from file, expecting 0 bytes ... OK -int(1024) -bool(true) --- File opened in mode ab -- --- Reading beyond filesize, expeceted : 1024 bytes -- -int(0) -bool(false) -Reading 1030 bytes from file, expecting 0 bytes ... OK -int(0) -bool(true) -- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes -- int(1024) bool(false) Reading 10 bytes from file, expecting 0 bytes ... OK int(1024) -bool(true) --- File opened in mode at -- --- Reading beyond filesize, expeceted : 1024 bytes -- -int(0) -bool(false) -Reading 1030 bytes from file, expecting 0 bytes ... OK -int(0) -bool(true) --- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes -- -int(1024) bool(false) -Reading 10 bytes from file, expecting 0 bytes ... OK -int(1024) -bool(true) --- File opened in mode w -- --- Reading beyond filesize, expeceted : 1024 bytes -- -int(0) -bool(false) -Reading 1030 bytes from file, expecting 0 bytes ... OK -int(0) -bool(true) --- Reading beyond filesize when file pointer pointing to EOF, expeceted : 0 bytes -- -int(1024) -bool(false) -Reading 10 bytes from file, expecting 0 bytes ... OK -int(1024) -bool(true) --- File opened in mode wb -- +-- File opened in mode ab -- --
[PHP-CVS] cvs: php-src(PHP_5_2) / NEWS /ext/soap soap.c /ext/soap/tests/bugs bug42151.phpt
dmitry Wed Aug 1 10:39:33 2007 UTC Added files: (Branch: PHP_5_2) /php-src/ext/soap/tests/bugsbug42151.phpt Modified files: /php-srcNEWS /php-src/ext/soap soap.c Log: Fixed bug #42151 (__destruct functions not called after catching a SoapFault exception) http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.869r2=1.2027.2.547.2.870diff_format=u Index: php-src/NEWS diff -u php-src/NEWS:1.2027.2.547.2.869 php-src/NEWS:1.2027.2.547.2.870 --- php-src/NEWS:1.2027.2.547.2.869 Tue Jul 31 22:48:42 2007 +++ php-src/NEWSWed Aug 1 10:39:32 2007 @@ -70,6 +70,8 @@ - Fixed PECL bug #11216 (crash in ZipArchive::addEmptyDir when a directory already exists). (Pierre) +- Fixed bug #42151 (__destruct functions not called after catching a SoapFault + exception). (Dmitry) - Fixed bug #42142 (substr_replace() returns FALSE when length string length). (Ilia) - Fixed bug #42135 (Second call of session_start() causes creation of SID). http://cvs.php.net/viewvc.cgi/php-src/ext/soap/soap.c?r1=1.156.2.28.2.26r2=1.156.2.28.2.27diff_format=u Index: php-src/ext/soap/soap.c diff -u php-src/ext/soap/soap.c:1.156.2.28.2.26 php-src/ext/soap/soap.c:1.156.2.28.2.27 --- php-src/ext/soap/soap.c:1.156.2.28.2.26 Fri Jul 13 14:00:05 2007 +++ php-src/ext/soap/soap.c Wed Aug 1 10:39:33 2007 @@ -17,7 +17,7 @@ | Dmitry Stogov [EMAIL PROTECTED] | +--+ */ -/* $Id: soap.c,v 1.156.2.28.2.26 2007/07/13 14:00:05 dmitry Exp $ */ +/* $Id: soap.c,v 1.156.2.28.2.27 2007/08/01 10:39:33 dmitry Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -2067,6 +2067,7 @@ #ifdef va_copy va_list argcopy; #endif + zend_object_store_bucket *old_objects; int old = PG(display_errors); INIT_ZVAL(outbuf); @@ -2093,6 +2094,8 @@ INIT_PZVAL(exception); zend_throw_exception_object(exception TSRMLS_CC); + old_objects = EG(objects_store).object_buckets; + EG(objects_store).object_buckets = NULL; PG(display_errors) = 0; zend_try { call_old_error_handler(error_num, error_filename, error_lineno, format, args); @@ -2101,6 +2104,7 @@ EG(in_execution) = _old_in_execution; EG(current_execute_data) = _old_current_execute_data; } zend_end_try(); + EG(objects_store).object_buckets = old_objects; PG(display_errors) = old; zend_bailout(); } else { http://cvs.php.net/viewvc.cgi/php-src/ext/soap/tests/bugs/bug42151.phpt?view=markuprev=1.1 Index: php-src/ext/soap/tests/bugs/bug42151.phpt +++ php-src/ext/soap/tests/bugs/bug42151.phpt -- 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/bugs bug42151.phpt
dmitry Wed Aug 1 10:39:49 2007 UTC Modified files: /php-src/ext/soap soap.c /php-src/ext/soap/tests/bugsbug42151.phpt Log: Fixed bug #42151 (__destruct functions not called after catching a SoapFault exception) http://cvs.php.net/viewvc.cgi/php-src/ext/soap/soap.c?r1=1.225r2=1.226diff_format=u Index: php-src/ext/soap/soap.c diff -u php-src/ext/soap/soap.c:1.225 php-src/ext/soap/soap.c:1.226 --- php-src/ext/soap/soap.c:1.225 Fri Jul 13 14:01:11 2007 +++ php-src/ext/soap/soap.c Wed Aug 1 10:39:49 2007 @@ -17,7 +17,7 @@ | Dmitry Stogov [EMAIL PROTECTED] | +--+ */ -/* $Id: soap.c,v 1.225 2007/07/13 14:01:11 dmitry Exp $ */ +/* $Id: soap.c,v 1.226 2007/08/01 10:39:49 dmitry Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -2377,6 +2377,7 @@ #ifdef va_copy va_list argcopy; #endif + zend_object_store_bucket *old_objects; int old = PG(display_errors); INIT_ZVAL(outbuf); @@ -2400,6 +2401,8 @@ INIT_PZVAL(exception); zend_throw_exception_object(exception TSRMLS_CC); + old_objects = EG(objects_store).object_buckets; + EG(objects_store).object_buckets = NULL; PG(display_errors) = 0; zend_try { call_old_error_handler(error_num, error_filename, error_lineno, format, args); @@ -2408,6 +2411,7 @@ EG(in_execution) = _old_in_execution; EG(current_execute_data) = _old_current_execute_data; } zend_end_try(); + EG(objects_store).object_buckets = old_objects; PG(display_errors) = old; zend_bailout(); } else { http://cvs.php.net/viewvc.cgi/php-src/ext/soap/tests/bugs/bug42151.phpt?r1=1.1r2=1.2diff_format=u Index: php-src/ext/soap/tests/bugs/bug42151.phpt diff -u /dev/null php-src/ext/soap/tests/bugs/bug42151.phpt:1.2 --- /dev/null Wed Aug 1 10:39:49 2007 +++ php-src/ext/soap/tests/bugs/bug42151.phpt Wed Aug 1 10:39:49 2007 @@ -0,0 +1,31 @@ +--TEST-- +Bug #42151 __destruct functions not called after catching a SoapFault exception +--SKIPIF-- +?php require_once('skipif.inc'); ? +--FILE-- +?php +class foo { + function __construct(){ + $foo = @ new SoapClient('httpx://'); + } + function __destruct(){ + echo 'I never get executed.' . \n; + } +} +class bar { + function __destruct(){ + echo 'I don\'t get executed either.' . \n; + } +} +try { + $bar = new bar(); + $foo = new foo(); +} catch (Exception $e){ + echo $e-getMessage() . \n; +} +echo ok\n; +? +--EXPECT-- +SOAP-ERROR: Parsing WSDL: Couldn't load from 'httpx://' +ok +I don't get executed either. -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src / NEWS /ext/openssl openssl.c
dmitry Mon Aug 6 08:43:43 2007 UTC Modified files: /php-srcNEWS /php-src/ext/opensslopenssl.c Log: Improved ext/openssl . Added support for OpenSSL digest functions . Added support for OpenSSL cipher functions . Added access to internal values of DSA, RSA and DH keys http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2148r2=1.2149diff_format=u Index: php-src/NEWS diff -u php-src/NEWS:1.2148 php-src/NEWS:1.2149 --- php-src/NEWS:1.2148 Tue Jul 24 23:25:48 2007 +++ php-src/NEWSMon Aug 6 08:43:43 2007 @@ -34,6 +34,10 @@ - Moved extensions to PECL: . ext/ncurses (Hartmut) +- Improved ext/openssl (Dmitry) + . Added support for OpenSSL digest functions + . Added support for OpenSSL cipher functions + . Added access to internal values of DSA, RSA and DH keys - Improved and cleaned CGI code. FastCGI is now always enabled and can not be disabled. See sapi/cgi/CHANGES for more details. (Dmitry) - Improved ext/zlib; re-implemented non-file related functionality. (Mike) http://cvs.php.net/viewvc.cgi/php-src/ext/openssl/openssl.c?r1=1.145r2=1.146diff_format=u Index: php-src/ext/openssl/openssl.c diff -u php-src/ext/openssl/openssl.c:1.145 php-src/ext/openssl/openssl.c:1.146 --- php-src/ext/openssl/openssl.c:1.145 Wed Jul 11 12:10:28 2007 +++ php-src/ext/openssl/openssl.c Mon Aug 6 08:43:43 2007 @@ -20,7 +20,7 @@ +--+ */ -/* $Id: openssl.c,v 1.145 2007/07/11 12:10:28 dmitry Exp $ */ +/* $Id: openssl.c,v 1.146 2007/08/06 08:43:43 dmitry Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -33,6 +33,8 @@ #include ext/standard/file.h #include ext/standard/info.h #include ext/standard/php_fopen_wrappers.h +#include ext/standard/md5.h +#include ext/standard/base64.h /* OpenSSL includes */ #include openssl/evp.h @@ -88,6 +90,15 @@ PHP_OPENSSL_CIPHER_DEFAULT = PHP_OPENSSL_CIPHER_RC2_40 }; +PHP_FUNCTION(openssl_get_md_methods); +PHP_FUNCTION(openssl_get_cipher_methods); + +PHP_FUNCTION(openssl_digest); +PHP_FUNCTION(openssl_encrypt); +PHP_FUNCTION(openssl_decrypt); + +PHP_FUNCTION(openssl_dh_compute_key); + /* {{{ openssl_functions[] */ zend_function_entry openssl_functions[] = { @@ -126,10 +137,13 @@ PHP_FE(openssl_csr_get_subject, NULL) PHP_FE(openssl_csr_get_public_key, NULL) - PHP_FE(openssl_sign,second_arg_force_ref) - PHP_FE(openssl_verify, NULL) - PHP_FE(openssl_seal,arg2and3_force_ref) - PHP_FE(openssl_open,second_arg_force_ref) + PHP_FE(openssl_digest, NULL) + PHP_FE(openssl_encrypt, NULL) + PHP_FE(openssl_decrypt, NULL) + PHP_FE(openssl_sign,second_arg_force_ref) + PHP_FE(openssl_verify, NULL) + PHP_FE(openssl_seal,arg2and3_force_ref) + PHP_FE(openssl_open,second_arg_force_ref) /* for S/MIME handling */ PHP_FE(openssl_pkcs7_verify,NULL) @@ -142,6 +156,11 @@ PHP_FE(openssl_public_encrypt, second_arg_force_ref) PHP_FE(openssl_public_decrypt, second_arg_force_ref) + PHP_FE(openssl_get_md_methods, NULL) + PHP_FE(openssl_get_cipher_methods, NULL) + + PHP_FE(openssl_dh_compute_key, NULL) + PHP_FE(openssl_error_string, NULL) {NULL, NULL, NULL} }; @@ -645,6 +664,34 @@ return mdtype; } /* }}} */ + +static const EVP_CIPHER * php_openssl_get_evp_cipher_from_algo(long algo) { /* {{{ */ + switch (algo) { +#ifndef OPENSSL_NO_RC2 + case PHP_OPENSSL_CIPHER_RC2_40: + return EVP_rc2_40_cbc(); + break; + case PHP_OPENSSL_CIPHER_RC2_64: + return EVP_rc2_64_cbc(); + break; + case PHP_OPENSSL_CIPHER_RC2_128: + return EVP_rc2_cbc(); + break; +#endif + +#ifndef OPENSSL_NO_DES + case PHP_OPENSSL_CIPHER_DES: + return EVP_des_cbc(); + break; + case PHP_OPENSSL_CIPHER_3DES: + return EVP_des_ede3_cbc(); + break; +#endif + default: + return NULL; + break; + } +} /* }}} */ /* {{{ PHP_MINIT_FUNCTION @@ -2476,6 +2523,25 @@ } break; #endif +#if !defined(NO_DH) + case OPENSSL_KEYTYPE_DH: + { + DH *dhpar = DH_generate_parameters(req-priv_key_bits, 2, NULL, NULL); + int
RE: [PHP-CVS] cvs: php-src(PHP_5_2) / NEWS /tests/lang 041.phpt 042.phpt 043.phpt 044.phpt ZendEngine2 zend_language_parser.y
Hi, I think this feature shouldn't go into 5.2, especially after 5.2.4RC1 release. May be into 5.3 Thanks. Dmitry. -Original Message- From: Johannes Schlьter [mailto:[EMAIL PROTECTED] Sent: Friday, August 03, 2007 1:55 AM To: php-cvs@lists.php.net Subject: [PHP-CVS] cvs: php-src(PHP_5_2) / NEWS /tests/lang 041.phpt 042.phpt 043.phpt 044.phpt ZendEngine2 zend_language_parser.y johannes Thu Aug 2 21:55:23 2007 UTC Added files: (Branch: PHP_5_2) /php-src/tests/lang 041.phpt 042.phpt 043.phpt 044.phpt Modified files: /php-src NEWS /ZendEngine2 zend_language_parser.y Log: - Add possibility to call static class members using variables (Etienne Kneuss) http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.8 73r2=1.2027.2.547.2.874diff_format=u Index: php-src/NEWS diff -u php-src/NEWS:1.2027.2.547.2.873 php-src/NEWS:1.2027.2.547.2.874 --- php-src/NEWS:1.2027.2.547.2.873 Thu Aug 2 20:30:31 2007 +++ php-src/NEWS Thu Aug 2 21:55:23 2007 @@ -37,6 +37,8 @@ - Added PCRE_VERSION constant. (Tony) - Added ReflectionExtension::info() function to print the phpinfo() block for an extension. (Johannes) +- Added possibility to call static class members using variables. +(Etienne + Kneuss) - Implemented FR #41884 (ReflectionClass::getDefaultProperties() does not handle static attributes). (Tony) http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_language_parser .y?r1=1.160.2.4.2.6r2=1.160.2.4.2.7diff_format=u Index: ZendEngine2/zend_language_parser.y diff -u ZendEngine2/zend_language_parser.y:1.160.2.4.2.6 ZendEngine2/zend_language_parser.y:1.160.2.4.2.7 --- ZendEngine2/zend_language_parser.y:1.160.2.4.2.6 Fri May 18 18:36:04 2007 +++ ZendEngine2/zend_language_parser.yThu Aug 2 21:55:23 2007 @@ -18,7 +18,7 @@ +- -+ */ -/* $Id: zend_language_parser.y,v 1.160.2.4.2.6 2007/05/18 18:36:04 stas Exp $ */ +/* $Id: zend_language_parser.y,v 1.160.2.4.2.7 2007/08/02 21:55:23 +johannes Exp $ */ /* * LALR shift/reduce conflicts and how they are resolved: @@ -630,6 +630,12 @@ | fully_qualified_class_name T_PAAMAYIM_NEKUDOTAYIM variable_without_objects '(' { zend_do_end_variable_parse(BP_VAR_R, 0 TSRMLS_CC); zend_do_begin_class_member_function_call($1, $3 TSRMLS_CC); } function_call_parameter_list ')' { zend_do_end_function_call(NULL, $$, $6, 1, 1 TSRMLS_CC); zend_do_extended_fcall_end(TSRMLS_C);} + | variable_class_name T_PAAMAYIM_NEKUDOTAYIM T_STRING '(' { zend_do_begin_class_member_function_call($1, $3 TSRMLS_CC); } + function_call_parameter_list + ')' { zend_do_end_function_call(NULL, $$, $6, 1, 1 TSRMLS_CC); zend_do_extended_fcall_end(TSRMLS_C);} + | variable_class_name T_PAAMAYIM_NEKUDOTAYIM variable_without_objects '(' { zend_do_end_variable_parse(BP_VAR_R, 0 TSRMLS_CC); zend_do_begin_class_member_function_call($1, $3 TSRMLS_CC); } + function_call_parameter_list + ')' { zend_do_end_function_call(NULL, $$, $6, 1, 1 TSRMLS_CC); +zend_do_extended_fcall_end(TSRMLS_C);} | variable_without_objects '(' { zend_do_end_variable_parse(BP_VAR_R, 0 TSRMLS_CC); zend_do_begin_dynamic_function_call($1 TSRMLS_CC); } function_call_parameter_list ')' { zend_do_end_function_call($1, $$, $4, 0, 1 TSRMLS_CC); zend_do_extended_fcall_end(TSRMLS_C);} @@ -781,8 +787,13 @@ static_member: fully_qualified_class_name T_PAAMAYIM_NEKUDOTAYIM variable_without_objects { $$ = $3; zend_do_fetch_static_member($$, $1 TSRMLS_CC); } + | variable_class_name T_PAAMAYIM_NEKUDOTAYIM variable_without_objects { $$ = $3; zend_do_fetch_static_member($$, $1 TSRMLS_CC); } + ; +variable_class_name: + reference_variable { zend_do_end_variable_parse(BP_VAR_R, 0 +TSRMLS_CC); zend_do_fetch_class($$, $1 TSRMLS_CC); } ; base_variable_with_function_calls: base_variable { $$ = $1; } @@ -907,6 +918,7 @@ class_constant: fully_qualified_class_name T_PAAMAYIM_NEKUDOTAYIM T_STRING { zend_do_fetch_constant($$, $1, $3, ZEND_RT TSRMLS_CC); } + | variable_class_name T_PAAMAYIM_NEKUDOTAYIM T_STRING { zend_do_fetch_constant($$, $1, $3, ZEND_RT TSRMLS_CC); } ; %% http://cvs.php.net/viewvc.cgi/php-src/tests/lang/041.phpt?view =markuprev=1.1 Index: php-src/tests/lang/041.phpt +++ php-src/tests/lang/041.phpt --TEST-- Dynamic access of static members --FILE-- ?php class A { publicstatic $b = 'foo'; } $classname = 'A'; $binaryClassname = b'A'; $wrongClassname = 'B'; echo $classname::$b.\n; echo
[PHP-CVS] cvs: php-src(PHP_5_2) / NEWS /sapi/cgi cgi_main.c
dmitry Wed Aug 8 13:01:40 2007 UTC Modified files: (Branch: PHP_5_2) /php-srcNEWS /php-src/sapi/cgi cgi_main.c Log: - Fixed bug #42198 (SCRIPT_NAME and PHP_SELF truncated when inside a userdir and using PATH_INFO). - Fixed bug #31892 (PHP_SELF incorrect without cgi.fix_pathinfo, but turning on screws up PATH_INFO). http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.885r2=1.2027.2.547.2.886diff_format=u Index: php-src/NEWS diff -u php-src/NEWS:1.2027.2.547.2.885 php-src/NEWS:1.2027.2.547.2.886 --- php-src/NEWS:1.2027.2.547.2.885 Wed Aug 8 11:37:44 2007 +++ php-src/NEWSWed Aug 8 13:01:39 2007 @@ -7,11 +7,15 @@ - Fixed bug #4 (possible buffer overflow in php_openssl_make_REQ). (Pierre) - Fixed bug #42208 (substr_replace() crashes when the same array is passed more than once). (crrodriguez at suse dot de, Ilia) +- Fixed bug #42198 (SCRIPT_NAME and PHP_SELF truncated when inside a userdir + and using PATH_INFO). (Dmitry) - Fixed bug #42195 (C++ compiler required always). (Jani) - Fixed bug #42082 (NodeList length zero should be empty). (Hannes) - Fixed bug #41973 (./configure --with-ldap=shared fails with LDFLAGS=-Wl,--as-needed). (Nuno) - Fixed bug #36492 (Userfilters can leak buckets). (Sara) +- Fixed bug #31892 (PHP_SELF incorrect without cgi.fix_pathinfo, but turning + on screws up PATH_INFO). (Dmitry) 02 Aug 2007, PHP 5.2.4RC1 - Removed --enable-versioning configure option. (Jani) http://cvs.php.net/viewvc.cgi/php-src/sapi/cgi/cgi_main.c?r1=1.267.2.15.2.44r2=1.267.2.15.2.45diff_format=u Index: php-src/sapi/cgi/cgi_main.c diff -u php-src/sapi/cgi/cgi_main.c:1.267.2.15.2.44 php-src/sapi/cgi/cgi_main.c:1.267.2.15.2.45 --- php-src/sapi/cgi/cgi_main.c:1.267.2.15.2.44 Wed Aug 8 10:00:34 2007 +++ php-src/sapi/cgi/cgi_main.c Wed Aug 8 13:01:40 2007 @@ -21,7 +21,7 @@ +--+ */ -/* $Id: cgi_main.c,v 1.267.2.15.2.44 2007/08/08 10:00:34 jani Exp $ */ +/* $Id: cgi_main.c,v 1.267.2.15.2.45 2007/08/08 13:01:40 dmitry Exp $ */ #include php.h #include php_globals.h @@ -522,16 +522,29 @@ static void sapi_cgi_register_variables(zval *track_vars_array TSRMLS_DC) { - unsigned int new_val_len; - char *val = SG(request_info).request_uri ? SG(request_info).request_uri : ; + char *script_name = SG(request_info).request_uri; + unsigned int script_name_len = script_name ? strlen(script_name) : 0; + char *path_info = sapi_cgibin_getenv(PATH_INFO, sizeof(PATH_INFO)-1 TSRMLS_CC); + unsigned int path_info_len = path_info ? strlen(path_info) : 0; + unsigned int php_self_len = script_name_len + path_info_len; + char *php_self = emalloc(php_self_len + 1); + + if (script_name) { + memcpy(php_self, script_name, script_name_len + 1); + } + if (path_info) { + memcpy(php_self + script_name_len, path_info, path_info_len + 1); + } + /* In CGI mode, we consider the environment to be a part of the server * variables */ php_import_environment_variables(track_vars_array TSRMLS_CC); /* Build the special-case PHP_SELF variable for the CGI version */ - if (sapi_module.input_filter(PARSE_SERVER, PHP_SELF, val, strlen(val), new_val_len TSRMLS_CC)) { - php_register_variable_safe(PHP_SELF, val, new_val_len, track_vars_array TSRMLS_CC); + if (sapi_module.input_filter(PARSE_SERVER, PHP_SELF, php_self, php_self_len, php_self_len TSRMLS_CC)) { + php_register_variable_safe(PHP_SELF, php_self, php_self_len, track_vars_array TSRMLS_CC); } + efree(php_self); } static void sapi_cgi_log_message(char *message) @@ -830,7 +843,21 @@ if (orig_path_info != path_info) { if (orig_path_info) { + char old; + _sapi_cgibin_putenv(ORIG_PATH_INFO, orig_path_info TSRMLS_CC); + old = path_info[0]; + path_info[0] = 0; + if (!orig_script_name || + strcmp(orig_script_name, env_path_info) != 0) { + if (orig_script_name) { + _sapi_cgibin_putenv(ORIG_SCRIPT_NAME, orig_script_name TSRMLS_CC); + } +
[PHP-CVS] cvs: php-src /sapi/cgi cgi_main.c
dmitry Wed Aug 8 13:02:01 2007 UTC Modified files: /php-src/sapi/cgi cgi_main.c Log: - Fixed bug #42198 (SCRIPT_NAME and PHP_SELF truncated when inside a userdir and using PATH_INFO). - Fixed bug #31892 (PHP_SELF incorrect without cgi.fix_pathinfo, but turning on screws up PATH_INFO). http://cvs.php.net/viewvc.cgi/php-src/sapi/cgi/cgi_main.c?r1=1.328r2=1.329diff_format=u Index: php-src/sapi/cgi/cgi_main.c diff -u php-src/sapi/cgi/cgi_main.c:1.328 php-src/sapi/cgi/cgi_main.c:1.329 --- php-src/sapi/cgi/cgi_main.c:1.328 Wed Aug 8 10:00:20 2007 +++ php-src/sapi/cgi/cgi_main.c Wed Aug 8 13:02:01 2007 @@ -21,7 +21,7 @@ +--+ */ -/* $Id: cgi_main.c,v 1.328 2007/08/08 10:00:20 jani Exp $ */ +/* $Id: cgi_main.c,v 1.329 2007/08/08 13:02:01 dmitry Exp $ */ #include php.h #include php_globals.h @@ -498,16 +498,29 @@ static void sapi_cgi_register_variables(zval *track_vars_array TSRMLS_DC) { - unsigned int new_val_len; - char *val = SG(request_info).request_uri ? SG(request_info).request_uri : ; + char *script_name = SG(request_info).request_uri; + unsigned int script_name_len = script_name ? strlen(script_name) : 0; + char *path_info = sapi_cgibin_getenv(PATH_INFO, sizeof(PATH_INFO)-1 TSRMLS_CC); + unsigned int path_info_len = path_info ? strlen(path_info) : 0; + unsigned int php_self_len = script_name_len + path_info_len; + char *php_self = emalloc(php_self_len + 1); + + if (script_name) { + memcpy(php_self, script_name, script_name_len + 1); + } + if (path_info) { + memcpy(php_self + script_name_len, path_info, path_info_len + 1); + } + /* In CGI mode, we consider the environment to be a part of the server * variables */ php_import_environment_variables(track_vars_array TSRMLS_CC); /* Build the special-case PHP_SELF variable for the CGI version */ - if (sapi_module.input_filter(PARSE_SERVER, PHP_SELF, val, strlen(val), new_val_len TSRMLS_CC)) { - php_register_variable_safe(PHP_SELF, val, new_val_len, track_vars_array TSRMLS_CC); + if (sapi_module.input_filter(PARSE_SERVER, PHP_SELF, php_self, php_self_len, php_self_len TSRMLS_CC)) { + php_register_variable_safe(PHP_SELF, php_self, php_self_len, track_vars_array TSRMLS_CC); } + efree(php_self); } static void sapi_cgi_log_message(char *message) @@ -664,7 +677,7 @@ SCRIPT_NAME set to a URL path that could identify the CGI script - rather than the interpreter. PHP_SELF is set to this. + rather than the interpreter. PHP_SELF is set to this REQUEST_URI uri section following the domain:port part of a URI @@ -806,7 +819,21 @@ if (orig_path_info != path_info) { if (orig_path_info) { + char old; + _sapi_cgibin_putenv(ORIG_PATH_INFO, orig_path_info TSRMLS_CC); + old = path_info[0]; + path_info[0] = 0; + if (!orig_script_name || + strcmp(orig_script_name, env_path_info) != 0) { + if (orig_script_name) { + _sapi_cgibin_putenv(ORIG_SCRIPT_NAME, orig_script_name TSRMLS_CC); + } + SG(request_info).request_uri = _sapi_cgibin_putenv(SCRIPT_NAME, env_path_info TSRMLS_CC); + } else { + SG(request_info).request_uri = orig_script_name; + } + path_info[0] = old; } env_path_info = _sapi_cgibin_putenv(PATH_INFO, path_info TSRMLS_CC); } @@ -823,8 +850,7 @@ SCRIPT_FILENAME minus SCRIPT_NAME */ - if (env_document_root) - { +
[PHP-CVS] cvs: php-src(PHP_5_2) / NEWS /ext/soap php_encoding.c /ext/soap/tests/bugs bug42183.phpt
dmitry Wed Aug 22 14:18:11 2007 UTC Added files: (Branch: PHP_5_2) /php-src/ext/soap/tests/bugsbug42183.phpt Modified files: /php-srcNEWS /php-src/ext/soap php_encoding.c Log: Fixed bug #42183 (classmap cause crashr in non-wsdl mode) http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.903r2=1.2027.2.547.2.904diff_format=u Index: php-src/NEWS diff -u php-src/NEWS:1.2027.2.547.2.903 php-src/NEWS:1.2027.2.547.2.904 --- php-src/NEWS:1.2027.2.547.2.903 Wed Aug 22 13:19:47 2007 +++ php-src/NEWSWed Aug 22 14:18:09 2007 @@ -1,6 +1,7 @@ PHPNEWS ||| ?? Aug 2007, PHP 5.2.4 +- Fixed bug #42183 (classmap cause crashr in non-wsdl mode). (Dmitry) - Fixed bug #42009 (is_a() and is_subclass_of() should NOT call autoload, in the same way as instanceof operator). (Dmitry) - Fixed bug #41904 (proc_open(): empty env array should cause empty http://cvs.php.net/viewvc.cgi/php-src/ext/soap/php_encoding.c?r1=1.103.2.21.2.34r2=1.103.2.21.2.35diff_format=u Index: php-src/ext/soap/php_encoding.c diff -u php-src/ext/soap/php_encoding.c:1.103.2.21.2.34 php-src/ext/soap/php_encoding.c:1.103.2.21.2.35 --- php-src/ext/soap/php_encoding.c:1.103.2.21.2.34 Thu Jun 14 07:09:31 2007 +++ php-src/ext/soap/php_encoding.c Wed Aug 22 14:18:09 2007 @@ -17,7 +17,7 @@ | Dmitry Stogov [EMAIL PROTECTED] | +--+ */ -/* $Id: php_encoding.c,v 1.103.2.21.2.34 2007/06/14 07:09:31 dmitry Exp $ */ +/* $Id: php_encoding.c,v 1.103.2.21.2.35 2007/08/22 14:18:09 dmitry Exp $ */ #include time.h @@ -447,7 +447,10 @@ zend_hash_get_current_key_ex(SOAP_GLOBAL(class_map), type_name, type_len, idx, 0, pos) == HASH_KEY_IS_STRING) { /* TODO: namespace isn't stored */ - encodePtr enc = get_encoder(SOAP_GLOBAL(sdl), SOAP_GLOBAL(sdl)-target_ns, type_name); + encodePtr enc = NULL; + if (SOAP_GLOBAL(sdl)) { + enc = get_encoder(SOAP_GLOBAL(sdl), SOAP_GLOBAL(sdl)-target_ns, type_name); + } if (enc) { encode = enc; } else if (SOAP_GLOBAL(sdl)) { http://cvs.php.net/viewvc.cgi/php-src/ext/soap/tests/bugs/bug42183.phpt?view=markuprev=1.1 Index: php-src/ext/soap/tests/bugs/bug42183.phpt +++ php-src/ext/soap/tests/bugs/bug42183.phpt -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/soap php_encoding.c /ext/soap/tests/bugs bug42183.phpt
dmitry Wed Aug 22 14:18:29 2007 UTC Modified files: /php-src/ext/soap php_encoding.c /php-src/ext/soap/tests/bugsbug42183.phpt Log: Fixed bug #42183 (classmap cause crashr in non-wsdl mode) http://cvs.php.net/viewvc.cgi/php-src/ext/soap/php_encoding.c?r1=1.160r2=1.161diff_format=u Index: php-src/ext/soap/php_encoding.c diff -u php-src/ext/soap/php_encoding.c:1.160 php-src/ext/soap/php_encoding.c:1.161 --- php-src/ext/soap/php_encoding.c:1.160 Thu Jun 14 07:09:42 2007 +++ php-src/ext/soap/php_encoding.c Wed Aug 22 14:18:28 2007 @@ -17,7 +17,7 @@ | Dmitry Stogov [EMAIL PROTECTED] | +--+ */ -/* $Id: php_encoding.c,v 1.160 2007/06/14 07:09:42 dmitry Exp $ */ +/* $Id: php_encoding.c,v 1.161 2007/08/22 14:18:28 dmitry Exp $ */ #include time.h @@ -470,12 +470,14 @@ zend_uchar utype = zend_hash_get_current_key_ex(SOAP_GLOBAL(class_map), type_name, type_len, idx, 0, pos); if (utype == HASH_KEY_IS_STRING || utype == HASH_KEY_IS_UNICODE) { - encodePtr enc; + encodePtr enc = NULL; type_name.s = soap_encode_string_ex(utype, type_name, type_len TSRMLS_CC); /* TODO: namespace isn't stored */ - enc = get_encoder(SOAP_GLOBAL(sdl), SOAP_GLOBAL(sdl)-target_ns, type_name.s); + if (SOAP_GLOBAL(sdl)) { + enc = get_encoder(SOAP_GLOBAL(sdl), SOAP_GLOBAL(sdl)-target_ns, type_name.s); + } if (enc) { encode = enc; } else if (SOAP_GLOBAL(sdl)) { http://cvs.php.net/viewvc.cgi/php-src/ext/soap/tests/bugs/bug42183.phpt?r1=1.1r2=1.2diff_format=u Index: php-src/ext/soap/tests/bugs/bug42183.phpt diff -u /dev/null php-src/ext/soap/tests/bugs/bug42183.phpt:1.2 --- /dev/null Wed Aug 22 14:18:29 2007 +++ php-src/ext/soap/tests/bugs/bug42183.phpt Wed Aug 22 14:18:28 2007 @@ -0,0 +1,27 @@ +--TEST-- +Bug #42183 (classmap cause crash in non-wsdl mode ) +--SKIPIF-- +?php require_once('skipif.inc'); ? +--FILE-- +?php +class PHPObject { +} + +$req = EOF +?xml version=1.0 encoding=UTF-8? +SOAP-ENV:Envelope xmlns:SOAP-ENV=http://schemas.xmlsoap.org/soap/envelope/; xmlns:ns1=http://ws.sit.com; SOAP-ENV:encodingStyle=http://schemas.xmlsoap.org/soap/encoding/;SOAP-ENV:Bodyns1:test//SOAP-ENV:Body/SOAP-ENV:Envelope +EOF; + +function test() { + return new PHPObject(); +} + +$server = new SoapServer(NULL, array('uri' = 'http://ws.sit.com', + 'classmap' = array('Object' = 'PHPObject'))); +$server-addFunction(test); +ob_start(); +$server-handle($req); +ob_end_clean(); +echo ok\n; +--EXPECT-- +ok -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/standard basic_functions.c ZendEngine2 zend.c zend.h zend_builtin_functions.c zend_compile.c zend_compile.h zend_constants.c zend_constants.h zend_execute_API.c zend_langu
dmitry Fri Aug 24 13:50:52 2007 UTC Added files: /ZendEngine2/tests ns_039.phpt ns_040.phpt ns_041.phpt ns_042.phpt ns_043.phpt ns_044.phpt ns_045.phpt ns_046.phpt ns_047.phpt ns_048.phpt ns_049.phpt ns_050.phpt ns_051.phpt ns_052.phpt ns_053.phpt Modified files: /ZendEngine2zend.c zend.h zend_builtin_functions.c zend_compile.c zend_compile.h zend_constants.c zend_constants.h zend_execute_API.c zend_language_parser.y zend_variables.c zend_vm_def.h zend_vm_execute.h zend_vm_opcodes.h /ZendEngine2/tests bug41633_2.phpt /php-src/ext/standard basic_functions.c Log: Namespace constants http://cvs.php.net/viewvc.cgi/ZendEngine2/zend.c?r1=1.399r2=1.400diff_format=u Index: ZendEngine2/zend.c diff -u ZendEngine2/zend.c:1.399 ZendEngine2/zend.c:1.400 --- ZendEngine2/zend.c:1.399Sat Jul 21 00:34:41 2007 +++ ZendEngine2/zend.c Fri Aug 24 13:50:52 2007 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: zend.c,v 1.399 2007/07/21 00:34:41 jani Exp $ */ +/* $Id: zend.c,v 1.400 2007/08/24 13:50:52 dmitry Exp $ */ #include zend.h #include zend_extensions.h @@ -696,7 +696,7 @@ static void zval_copy_persistent(zval *zv) /* {{{ */ { - if (Z_TYPE_P(zv) == IS_STRING || Z_TYPE_P(zv) == IS_CONSTANT) { + if (Z_TYPE_P(zv) == IS_STRING || (Z_TYPE_P(zv) IS_CONSTANT_TYPE_MASK) == IS_CONSTANT) { UChar *ustr; ustr = malloc(UBYTES(Z_STRLEN_P(zv)+1)); @@ -783,7 +783,7 @@ free(c-name.s); c-name.u = uname; } - if (Z_TYPE(c-value) == IS_STRING || Z_TYPE(c-value) == IS_CONSTANT) { + if (Z_TYPE(c-value) == IS_STRING || (Z_TYPE(c-value) IS_CONSTANT_TYPE_MASK) == IS_CONSTANT) { UChar *ustr; ustr = malloc(UBYTES(Z_STRLEN(c-value)+1)); http://cvs.php.net/viewvc.cgi/ZendEngine2/zend.h?r1=1.335r2=1.336diff_format=u Index: ZendEngine2/zend.h diff -u ZendEngine2/zend.h:1.335 ZendEngine2/zend.h:1.336 --- ZendEngine2/zend.h:1.335Sat Jul 21 05:27:06 2007 +++ ZendEngine2/zend.h Fri Aug 24 13:50:52 2007 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: zend.h,v 1.335 2007/07/21 05:27:06 pollita Exp $ */ +/* $Id: zend.h,v 1.336 2007/08/24 13:50:52 dmitry Exp $ */ #ifndef ZEND_H #define ZEND_H @@ -467,7 +467,9 @@ #define IS_UNICODE 10 /* Ugly hack to support constants as static array indices */ -#define IS_CONSTANT_INDEX 0x80 +#define IS_CONSTANT_TYPE_MASK 0x0f +#define IS_CONSTANT_RT_NS_CHECK0x10 +#define IS_CONSTANT_INDEX 0x80 /* overloaded elements data types */ http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_builtin_functions.c?r1=1.348r2=1.349diff_format=u Index: ZendEngine2/zend_builtin_functions.c diff -u ZendEngine2/zend_builtin_functions.c:1.348 ZendEngine2/zend_builtin_functions.c:1.349 --- ZendEngine2/zend_builtin_functions.c:1.348 Wed Aug 22 13:20:09 2007 +++ ZendEngine2/zend_builtin_functions.cFri Aug 24 13:50:52 2007 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: zend_builtin_functions.c,v 1.348 2007/08/22 13:20:09 dmitry Exp $ */ +/* $Id: zend_builtin_functions.c,v 1.349 2007/08/24 13:50:52 dmitry Exp $ */ #include zend.h #include zend_API.h @@ -575,7 +575,7 @@ } convert_to_text_ex(var); - if (zend_u_get_constant(Z_TYPE_PP(var), Z_UNIVAL_PP(var), Z_UNILEN_PP(var), c, NULL TSRMLS_CC)) { + if (zend_u_get_constant_ex(Z_TYPE_PP(var), Z_UNIVAL_PP(var), Z_UNILEN_PP(var), c, NULL, 0 TSRMLS_CC)) { zval_dtor(c); RETURN_TRUE; } else { @@ -772,7 +772,7 @@ /* this is necessary to make it able to work with default array * properties, returned to user */ - if (Z_TYPE_P(prop_copy) == IS_CONSTANT_ARRAY || Z_TYPE_P(prop_copy) == IS_CONSTANT) { + if (Z_TYPE_P(prop_copy) == IS_CONSTANT_ARRAY || (Z_TYPE_P(prop_copy) IS_CONSTANT_TYPE_MASK) == IS_CONSTANT) { zval_update_constant(prop_copy, 0 TSRMLS_CC); } http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_compile.c?r1=1.764r2=1.765diff_format=u Index: ZendEngine2/zend_compile.c diff -u ZendEngine2/zend_compile.c:1.764 ZendEngine2/zend_compile.c:1.765 --- ZendEngine2/zend_compile.c:1.764Wed Aug 22 07:39:37 2007 +++ ZendEngine2/zend_compile.c Fri Aug 24 13:50:52 2007 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: zend_compile.c,v 1.764 2007/08/22 07:39:37 dmitry Exp $ */ +/* $Id:
[PHP-CVS] cvs: php-src(PHP_5_2) / NEWS /ext/soap php_encoding.c /ext/soap/tests/bugs bug42326.phpt bug42326.wsdl
dmitry Fri Aug 31 08:07:28 2007 UTC Added files: (Branch: PHP_5_2) /php-src/ext/soap/tests/bugsbug42326.phpt bug42326.wsdl Modified files: /php-srcNEWS /php-src/ext/soap php_encoding.c Log: Fixed bug #42326 (SoapServer crash) http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.917r2=1.2027.2.547.2.918diff_format=u Index: php-src/NEWS diff -u php-src/NEWS:1.2027.2.547.2.917 php-src/NEWS:1.2027.2.547.2.918 --- php-src/NEWS:1.2027.2.547.2.917 Thu Aug 30 16:32:54 2007 +++ php-src/NEWSFri Aug 31 08:07:27 2007 @@ -7,6 +7,7 @@ DOMElement). (Rob) - Fixed bug #42452 (PDO classes do not expose Reflection API information). (Hannes) +- Fixed bug #42326 (SoapServer crash). (Dmitry) 30 Aug 2007, PHP 5.2.4 - Removed --enable-versioning configure option. (Jani) http://cvs.php.net/viewvc.cgi/php-src/ext/soap/php_encoding.c?r1=1.103.2.21.2.35r2=1.103.2.21.2.36diff_format=u Index: php-src/ext/soap/php_encoding.c diff -u php-src/ext/soap/php_encoding.c:1.103.2.21.2.35 php-src/ext/soap/php_encoding.c:1.103.2.21.2.36 --- php-src/ext/soap/php_encoding.c:1.103.2.21.2.35 Wed Aug 22 14:18:09 2007 +++ php-src/ext/soap/php_encoding.c Fri Aug 31 08:07:27 2007 @@ -17,7 +17,7 @@ | Dmitry Stogov [EMAIL PROTECTED] | +--+ */ -/* $Id: php_encoding.c,v 1.103.2.21.2.35 2007/08/22 14:18:09 dmitry Exp $ */ +/* $Id: php_encoding.c,v 1.103.2.21.2.36 2007/08/31 08:07:27 dmitry Exp $ */ #include time.h @@ -357,7 +357,7 @@ return 0; } -xmlNodePtr master_to_xml(encodePtr encode, zval *data, int style, xmlNodePtr parent) +static xmlNodePtr master_to_xml_int(encodePtr encode, zval *data, int style, xmlNodePtr parent, int check_class_map) { xmlNodePtr node = NULL; TSRMLS_FETCH(); @@ -428,7 +428,7 @@ xmlSetNs(node, nsp); } } else { - if (SOAP_GLOBAL(class_map) data + if (check_class_map SOAP_GLOBAL(class_map) data Z_TYPE_P(data) == IS_OBJECT !Z_OBJPROP_P(data)-nApplyCount) { zend_class_entry *ce = Z_OBJCE_P(data); @@ -489,6 +489,11 @@ return node; } +xmlNodePtr master_to_xml(encodePtr encode, zval *data, int style, xmlNodePtr parent) +{ + return master_to_xml_int(encode, data, style, parent, 1); +} + static zval *master_to_zval_int(encodePtr encode, xmlNodePtr data) { zval *ret = NULL; @@ -2685,7 +2690,7 @@ } else { enc = get_conversion(IS_NULL); } - ret = master_to_xml(enc, data, style, parent); + ret = master_to_xml_int(enc, data, style, parent, 0); /* if (style == SOAP_LITERAL SOAP_GLOBAL(sdl)) { set_ns_and_type(ret, enc-details); http://cvs.php.net/viewvc.cgi/php-src/ext/soap/tests/bugs/bug42326.phpt?view=markuprev=1.1 Index: php-src/ext/soap/tests/bugs/bug42326.phpt +++ php-src/ext/soap/tests/bugs/bug42326.phpt http://cvs.php.net/viewvc.cgi/php-src/ext/soap/tests/bugs/bug42326.wsdl?view=markuprev=1.1 Index: php-src/ext/soap/tests/bugs/bug42326.wsdl +++ php-src/ext/soap/tests/bugs/bug42326.wsdl -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/soap php_encoding.c /ext/soap/tests/bugs bug42326.phpt bug42326.wsdl
dmitry Fri Aug 31 08:07:46 2007 UTC Modified files: /php-src/ext/soap php_encoding.c /php-src/ext/soap/tests/bugsbug42326.phpt bug42326.wsdl Log: Fixed bug #42326 (SoapServer crash) http://cvs.php.net/viewvc.cgi/php-src/ext/soap/php_encoding.c?r1=1.161r2=1.162diff_format=u Index: php-src/ext/soap/php_encoding.c diff -u php-src/ext/soap/php_encoding.c:1.161 php-src/ext/soap/php_encoding.c:1.162 --- php-src/ext/soap/php_encoding.c:1.161 Wed Aug 22 14:18:28 2007 +++ php-src/ext/soap/php_encoding.c Fri Aug 31 08:07:46 2007 @@ -17,7 +17,7 @@ | Dmitry Stogov [EMAIL PROTECTED] | +--+ */ -/* $Id: php_encoding.c,v 1.161 2007/08/22 14:18:28 dmitry Exp $ */ +/* $Id: php_encoding.c,v 1.162 2007/08/31 08:07:46 dmitry Exp $ */ #include time.h @@ -358,7 +358,7 @@ return 0; } -xmlNodePtr master_to_xml(encodePtr encode, zval *data, int style, xmlNodePtr parent) +static xmlNodePtr master_to_xml_int(encodePtr encode, zval *data, int style, xmlNodePtr parent, int use_class_map) { xmlNodePtr node = NULL; TSRMLS_FETCH(); @@ -445,7 +445,7 @@ xmlSetNs(node, nsp); } } else { - if (SOAP_GLOBAL(class_map) data + if (use_class_map SOAP_GLOBAL(class_map) data Z_TYPE_P(data) == IS_OBJECT !Z_OBJPROP_P(data)-nApplyCount) { zend_class_entry *ce = Z_OBJCE_P(data); @@ -518,6 +518,11 @@ return node; } +xmlNodePtr master_to_xml(encodePtr encode, zval *data, int style, xmlNodePtr parent) +{ + return master_to_xml_int(encode, data, style, parent, 1); +} + static zval *master_to_zval_int(encodePtr encode, xmlNodePtr data) { zval *ret = NULL; @@ -2662,7 +2667,7 @@ } else { enc = get_conversion(IS_NULL); } - ret = master_to_xml(enc, data, style, parent); + ret = master_to_xml_int(enc, data, style, parent, 0); /* if (style == SOAP_LITERAL SOAP_GLOBAL(sdl)) { set_ns_and_type(ret, enc-details); http://cvs.php.net/viewvc.cgi/php-src/ext/soap/tests/bugs/bug42326.phpt?r1=1.1r2=1.2diff_format=u Index: php-src/ext/soap/tests/bugs/bug42326.phpt diff -u /dev/null php-src/ext/soap/tests/bugs/bug42326.phpt:1.2 --- /dev/null Fri Aug 31 08:07:46 2007 +++ php-src/ext/soap/tests/bugs/bug42326.phpt Fri Aug 31 08:07:46 2007 @@ -0,0 +1,49 @@ +--TEST-- +Bug #42326 (SoapServer crash) +--SKIPIF-- +?php require_once('skipif.inc'); ? +--INI-- +soap.wsdl_cache_enabled=0 +--FILE-- +?php +$request = EOF +?xml version=1.0 encoding=UTF-8? +SOAP-ENV:Envelope xmlns:SOAP-ENV=http://schemas.xmlsoap.org/soap/envelope/; xmlns:ns1=http://www.example.com/;SOAP-ENV:Bodyns1:GetProductsRequesttime/time/ns1:GetProductsRequest/SOAP-ENV:Body/SOAP-ENV:Envelope +EOF; + + +$soap_admin_classmap = array('productDetailsType' = 'SOAP_productDetailsType', + 'GetProductsRequest' = 'SOAP_GetProductsRequest', + 'GetProductsResponse' = 'SOAP_GetProductsResponse'); + +class SOAP_productDetailsType { +public $id = 0; +} + +class SOAP_GetProductsRequest { +public $time = ''; +} + +class SOAP_GetProductsResponse { +public $products; +function __construct(){ +$this-products = new SOAP_productDetailsType(); + +} +} + +class SOAP_Admin { +public function GetProducts($time){ +return new SOAP_GetProductsResponse(); +} +} + +$soap = new SoapServer(dirname(__FILE__).'/bug42326.wsdl', array('classmap' = $soap_admin_classmap)); +$soap-setClass('SOAP_Admin'); +ob_start(); +$soap-handle($request); +ob_end_clean(); +echo ok\n; +? +--EXPECT-- +ok http://cvs.php.net/viewvc.cgi/php-src/ext/soap/tests/bugs/bug42326.wsdl?r1=1.1r2=1.2diff_format=u Index: php-src/ext/soap/tests/bugs/bug42326.wsdl diff -u /dev/null php-src/ext/soap/tests/bugs/bug42326.wsdl:1.2 --- /dev/null Fri Aug 31 08:07:46 2007 +++ php-src/ext/soap/tests/bugs/bug42326.wsdl Fri Aug 31 08:07:46 2007 @@ -0,0 +1,82 @@ +?xml version=1.0? +wsdl:definitions name=OSCAdmin.wsdl +targetNamespace=http://www.example.com/; +xmlns:tns=http://www.example.com/; +xmlns:wsdl=http://schemas.xmlsoap.org/wsdl/; +xmlns:xsd=http://www.w3.org/2001/XMLSchema; +xmlns:soap=http://schemas.xmlsoap.org/wsdl/soap/; +wsdl:types + + xsd:schema targetNamespace=http://www.example.com/; + xmlns=http://www.w3.org/2000/10/XMLSchema; + xsd:element name=productDetailsType + xsd:complexType + xsd:all + xsd:element name=id type=xsd:integer/ + + /xsd:all + /xsd:complexType + /xsd:element + /xsd:schema + + + xsd:schema targetNamespace=http://www.example.com/; + xmlns
[PHP-CVS] cvs: php-src(PHP_5_2) / NEWS /ext/soap soap.c /ext/soap/tests/bugs bug42086.phpt bug42086.wsdl
dmitry Fri Aug 31 09:36:02 2007 UTC Added files: (Branch: PHP_5_2) /php-src/ext/soap/tests/bugsbug42086.phpt bug42086.wsdl Modified files: /php-srcNEWS /php-src/ext/soap soap.c Log: Fixed bug #42086 (SoapServer return Procedure '' not present for WSIBasic compliant wsdl) http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.918r2=1.2027.2.547.2.919diff_format=u Index: php-src/NEWS diff -u php-src/NEWS:1.2027.2.547.2.918 php-src/NEWS:1.2027.2.547.2.919 --- php-src/NEWS:1.2027.2.547.2.918 Fri Aug 31 08:07:27 2007 +++ php-src/NEWSFri Aug 31 09:36:01 2007 @@ -8,6 +8,8 @@ - Fixed bug #42452 (PDO classes do not expose Reflection API information). (Hannes) - Fixed bug #42326 (SoapServer crash). (Dmitry) +- Fixed bug #42086 (SoapServer return Procedure '' not present for WSIBasic + compliant wsdl). (Dmitry) 30 Aug 2007, PHP 5.2.4 - Removed --enable-versioning configure option. (Jani) http://cvs.php.net/viewvc.cgi/php-src/ext/soap/soap.c?r1=1.156.2.28.2.27r2=1.156.2.28.2.28diff_format=u Index: php-src/ext/soap/soap.c diff -u php-src/ext/soap/soap.c:1.156.2.28.2.27 php-src/ext/soap/soap.c:1.156.2.28.2.28 --- php-src/ext/soap/soap.c:1.156.2.28.2.27 Wed Aug 1 10:39:33 2007 +++ php-src/ext/soap/soap.c Fri Aug 31 09:36:02 2007 @@ -17,7 +17,7 @@ | Dmitry Stogov [EMAIL PROTECTED] | +--+ */ -/* $Id: soap.c,v 1.156.2.28.2.27 2007/08/01 10:39:33 dmitry Exp $ */ +/* $Id: soap.c,v 1.156.2.28.2.28 2007/08/31 09:36:02 dmitry Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -3248,7 +3248,17 @@ } trav = trav-next; } - if (num_of_params 0) { + + if (num_of_params == 1 + function + function-binding + function-binding-bindingType == BINDING_SOAP + ((sdlSoapBindingFunctionPtr)function-bindingAttributes)-style == SOAP_DOCUMENT + (function-requestParameters == NULL || +zend_hash_num_elements(function-requestParameters) == 0) + strcmp(params-name, function-functionName) == 0) { + num_of_params = 0; + } else if (num_of_params 0) { tmp_parameters = safe_emalloc(num_of_params, sizeof(zval *), 0); trav = params; @@ -3289,7 +3299,11 @@ if (function function-binding function-binding-bindingType == BINDING_SOAP) { sdlSoapBindingFunctionPtr fnb = (sdlSoapBindingFunctionPtr)function-bindingAttributes; if (fnb-style == SOAP_DOCUMENT) { - function = NULL; + if (func-children != NULL || + (function-requestParameters != NULL + zend_hash_num_elements(function-requestParameters) 0)) { + function = NULL; + } } } if (sdl != NULL function == NULL) { http://cvs.php.net/viewvc.cgi/php-src/ext/soap/tests/bugs/bug42086.phpt?view=markuprev=1.1 Index: php-src/ext/soap/tests/bugs/bug42086.phpt +++ php-src/ext/soap/tests/bugs/bug42086.phpt http://cvs.php.net/viewvc.cgi/php-src/ext/soap/tests/bugs/bug42086.wsdl?view=markuprev=1.1 Index: php-src/ext/soap/tests/bugs/bug42086.wsdl +++ php-src/ext/soap/tests/bugs/bug42086.wsdl -- 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/bugs bug42086.phpt bug42086.wsdl
dmitry Fri Aug 31 09:36:14 2007 UTC Modified files: /php-src/ext/soap soap.c /php-src/ext/soap/tests/bugsbug42086.phpt bug42086.wsdl Log: Fixed bug #42086 (SoapServer return Procedure '' not present for WSIBasic compliant wsdl) http://cvs.php.net/viewvc.cgi/php-src/ext/soap/soap.c?r1=1.226r2=1.227diff_format=u Index: php-src/ext/soap/soap.c diff -u php-src/ext/soap/soap.c:1.226 php-src/ext/soap/soap.c:1.227 --- php-src/ext/soap/soap.c:1.226 Wed Aug 1 10:39:49 2007 +++ php-src/ext/soap/soap.c Fri Aug 31 09:36:14 2007 @@ -17,7 +17,7 @@ | Dmitry Stogov [EMAIL PROTECTED] | +--+ */ -/* $Id: soap.c,v 1.226 2007/08/01 10:39:49 dmitry Exp $ */ +/* $Id: soap.c,v 1.227 2007/08/31 09:36:14 dmitry Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -3655,7 +3655,17 @@ } trav = trav-next; } - if (num_of_params 0) { + + if (num_of_params == 1 + function + function-binding + function-binding-bindingType == BINDING_SOAP + ((sdlSoapBindingFunctionPtr)function-bindingAttributes)-style == SOAP_DOCUMENT + (function-requestParameters == NULL || +zend_hash_num_elements(function-requestParameters) == 0) + strcmp(params-name, function-functionName) == 0) { + num_of_params = 0; + } else if (num_of_params 0) { tmp_parameters = safe_emalloc(num_of_params, sizeof(zval *), 0); trav = params; @@ -3696,7 +3706,11 @@ if (function function-binding function-binding-bindingType == BINDING_SOAP) { sdlSoapBindingFunctionPtr fnb = (sdlSoapBindingFunctionPtr)function-bindingAttributes; if (fnb-style == SOAP_DOCUMENT) { - function = NULL; + if (func-children != NULL || + (function-requestParameters != NULL + zend_hash_num_elements(function-requestParameters) 0)) { + function = NULL; + } } } if (sdl != NULL function == NULL) { http://cvs.php.net/viewvc.cgi/php-src/ext/soap/tests/bugs/bug42086.phpt?r1=1.1r2=1.2diff_format=u Index: php-src/ext/soap/tests/bugs/bug42086.phpt diff -u /dev/null php-src/ext/soap/tests/bugs/bug42086.phpt:1.2 --- /dev/null Fri Aug 31 09:36:14 2007 +++ php-src/ext/soap/tests/bugs/bug42086.phpt Fri Aug 31 09:36:14 2007 @@ -0,0 +1,31 @@ +--TEST-- +Bug #42086 (SoapServer return Procedure '' not present for WSIBasic compliant wsdl) +--SKIPIF-- +?php require_once('skipif.inc'); ? +--INI-- +soap.wsdl_cache_enabled=0 +--FILE-- +?php +$request = EOF +?xml version=1.0 encoding=UTF-8? +SOAP-ENV:Envelope xmlns:SOAP-ENV=http://schemas.xmlsoap.org/soap/envelope/;SOAP-ENV:BodyfirstFunctionWithoutParam//SOAP-ENV:Body/SOAP-ENV:Envelope +EOF; + +class firstFunctionWithoutParamResponse { + public $param; +} + +function firstFunctionWithoutParam() { + $ret = new firstFunctionWithoutParamResponse(); + $ret-param = firstFunctionWithoutParam; + return $ret; +} + +$server = new SoapServer(dirname(__FILE__).'/bug42086.wsdl', + array('features'=SOAP_SINGLE_ELEMENT_ARRAYS)); +$server-addFunction('firstFunctionWithoutParam'); +$server-handle($request); +? +--EXPECT-- +?xml version=1.0 encoding=UTF-8? +SOAP-ENV:Envelope xmlns:SOAP-ENV=http://schemas.xmlsoap.org/soap/envelope/;SOAP-ENV:BodyfirstFunctionWithoutParamReturnparamfirstFunctionWithoutParam/param/firstFunctionWithoutParamReturn/SOAP-ENV:Body/SOAP-ENV:Envelope http://cvs.php.net/viewvc.cgi/php-src/ext/soap/tests/bugs/bug42086.wsdl?r1=1.1r2=1.2diff_format=u Index: php-src/ext/soap/tests/bugs/bug42086.wsdl diff -u /dev/null php-src/ext/soap/tests/bugs/bug42086.wsdl:1.2 --- /dev/null Fri Aug 31 09:36:14 2007 +++ php-src/ext/soap/tests/bugs/bug42086.wsdl Fri Aug 31 09:36:14 2007 @@ -0,0 +1,141 @@ +?xml version='1.0' encoding='UTF-8'? + +!-- WSDL file generated by Zend Studio. -- + +definitions name=LBAService targetNamespace=http://xml.avaya.com/ws/device-management/distributed-enterprise; xmlns:typens=http://xml.avaya.com/ws/device-management/distributed-enterprise; xmlns:xsd=http://www.w3.org/2001/XMLSchema; xmlns:soap=http://schemas.xmlsoap.org/wsdl/soap/; xmlns:soapenc=http://schemas.xmlsoap.org/soap/encoding/; xmlns:wsdl=http://schemas.xmlsoap.org/wsdl/; xmlns=http://schemas.xmlsoap.org/wsdl/; + types + xsd:schema xmlns=http://www.w3.org/2001/XMLSchema; targetNamespace=http://xml.avaya.com/ws/device-management/distributed-enterprise; + xsd:complexType name
[PHP-CVS] cvs: php-src(PHP_5_2) / NEWS /ext/soap php_schema.c soap.c /ext/soap/tests/bugs bug42359.phpt bug42359.wsdl
dmitry Fri Aug 31 10:48:45 2007 UTC Added files: (Branch: PHP_5_2) /php-src/ext/soap/tests/bugsbug42359.phpt bug42359.wsdl Modified files: /php-srcNEWS /php-src/ext/soap php_schema.c soap.c Log: Fixed bug #42359 (xsd:list type not parsed) http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.919r2=1.2027.2.547.2.920diff_format=u Index: php-src/NEWS diff -u php-src/NEWS:1.2027.2.547.2.919 php-src/NEWS:1.2027.2.547.2.920 --- php-src/NEWS:1.2027.2.547.2.919 Fri Aug 31 09:36:01 2007 +++ php-src/NEWSFri Aug 31 10:48:45 2007 @@ -7,6 +7,7 @@ DOMElement). (Rob) - Fixed bug #42452 (PDO classes do not expose Reflection API information). (Hannes) +- Fixed bug #42359 (xsd:list type not parsed). (Dmitry) - Fixed bug #42326 (SoapServer crash). (Dmitry) - Fixed bug #42086 (SoapServer return Procedure '' not present for WSIBasic compliant wsdl). (Dmitry) http://cvs.php.net/viewvc.cgi/php-src/ext/soap/php_schema.c?r1=1.58.2.6.2.5r2=1.58.2.6.2.6diff_format=u Index: php-src/ext/soap/php_schema.c diff -u php-src/ext/soap/php_schema.c:1.58.2.6.2.5 php-src/ext/soap/php_schema.c:1.58.2.6.2.6 --- php-src/ext/soap/php_schema.c:1.58.2.6.2.5 Thu Feb 15 17:01:29 2007 +++ php-src/ext/soap/php_schema.c Fri Aug 31 10:48:45 2007 @@ -17,7 +17,7 @@ | Dmitry Stogov [EMAIL PROTECTED] | +--+ */ -/* $Id: php_schema.c,v 1.58.2.6.2.5 2007/02/15 17:01:29 dmitry Exp $ */ +/* $Id: php_schema.c,v 1.58.2.6.2.6 2007/08/31 10:48:45 dmitry Exp $ */ #include php_soap.h #include libxml/uri.h @@ -453,7 +453,14 @@ newType = emalloc(sizeof(sdlType)); memset(newType, 0, sizeof(sdlType)); - newType-name = estrdup(anonymous); + { + smart_str anonymous = {0}; + + smart_str_appendl(anonymous, anonymous, sizeof(anonymous)-1); + smart_str_append_long(anonymous, zend_hash_num_elements(sdl-types)); + smart_str_0(anonymous); + newType-name = anonymous.c; + } newType-namens = estrdup((char*)tns-children-content); if (cur_type-elements == NULL) { @@ -463,6 +470,7 @@ zend_hash_next_index_insert(cur_type-elements, newType, sizeof(sdlTypePtr), (void **)tmp); schema_simpleType(sdl, tns, trav, newType); + trav = trav-next; } if (trav != NULL) { @@ -541,7 +549,14 @@ newType = emalloc(sizeof(sdlType)); memset(newType, 0, sizeof(sdlType)); - newType-name = estrdup(anonymous); + { + smart_str anonymous = {0}; + + smart_str_appendl(anonymous, anonymous, sizeof(anonymous)-1); + smart_str_append_long(anonymous, zend_hash_num_elements(sdl-types)); + smart_str_0(anonymous); + newType-name = anonymous.c; + } newType-namens = estrdup((char*)tns-children-content); if (cur_type-elements == NULL) { @@ -1879,7 +1894,14 @@ } dummy_type = emalloc(sizeof(sdlType)); memset(dummy_type, 0, sizeof(sdlType)); - dummy_type-name = estrdup(anonymous); + { + smart_str anonymous = {0}; + + smart_str_appendl(anonymous, anonymous, sizeof(anonymous)-1); + smart_str_append_long(anonymous, zend_hash_num_elements(sdl-types)); + smart_str_0(anonymous); + dummy_type-name = anonymous.c; + } dummy_type-namens = estrdup((char*)tns-children-content); schema_simpleType(sdl, tns, trav, dummy_type); newAttr-encode = dummy_type-encode; http://cvs.php.net/viewvc.cgi/php-src/ext/soap/soap.c?r1=1.156.2.28.2.28r2=1.156.2.28.2.29diff_format=u Index: php-src/ext/soap/soap.c diff -u php-src/ext/soap/soap.c:1.156.2.28.2.28 php-src/ext/soap/soap.c:1.156.2.28.2.29 --- php-src/ext/soap/soap.c:1.156.2.28.2.28 Fri Aug 31 09:36:02 2007 +++ php-src/ext/soap/soap.c Fri Aug 31 10:48:45 2007 @@ -17,7 +17,7 @@ | Dmitry Stogov [EMAIL PROTECTED] | +--+ */ -/* $Id: soap.c,v 1.156.2.28.2.28 2007/08/31 09:36:02 dmitry Exp $ */ +/* $Id: soap.c,v 1.156.2.28.2.29 2007/08
[PHP-CVS] cvs: php-src /ext/soap php_schema.c soap.c /ext/soap/tests/bugs bug42359.phpt bug42359.wsdl
dmitry Fri Aug 31 10:48:57 2007 UTC Modified files: /php-src/ext/soap php_schema.c soap.c /php-src/ext/soap/tests/bugsbug42359.phpt bug42359.wsdl Log: Fixed bug #42359 (xsd:list type not parsed) http://cvs.php.net/viewvc.cgi/php-src/ext/soap/php_schema.c?r1=1.70r2=1.71diff_format=u Index: php-src/ext/soap/php_schema.c diff -u php-src/ext/soap/php_schema.c:1.70 php-src/ext/soap/php_schema.c:1.71 --- php-src/ext/soap/php_schema.c:1.70 Thu Feb 15 17:00:52 2007 +++ php-src/ext/soap/php_schema.c Fri Aug 31 10:48:57 2007 @@ -17,7 +17,7 @@ | Dmitry Stogov [EMAIL PROTECTED] | +--+ */ -/* $Id: php_schema.c,v 1.70 2007/02/15 17:00:52 dmitry Exp $ */ +/* $Id: php_schema.c,v 1.71 2007/08/31 10:48:57 dmitry Exp $ */ #include php_soap.h #include libxml/uri.h @@ -453,7 +453,14 @@ newType = emalloc(sizeof(sdlType)); memset(newType, 0, sizeof(sdlType)); - newType-name = estrdup(anonymous); + { + smart_str anonymous = {0}; + + smart_str_appendl(anonymous, anonymous, sizeof(anonymous)-1); + smart_str_append_long(anonymous, zend_hash_num_elements(sdl-types)); + smart_str_0(anonymous); + newType-name = anonymous.c; + } newType-namens = estrdup((char*)tns-children-content); if (cur_type-elements == NULL) { @@ -463,6 +470,7 @@ zend_hash_next_index_insert(cur_type-elements, newType, sizeof(sdlTypePtr), (void **)tmp); schema_simpleType(sdl, tns, trav, newType); + trav = trav-next; } if (trav != NULL) { @@ -541,7 +549,14 @@ newType = emalloc(sizeof(sdlType)); memset(newType, 0, sizeof(sdlType)); - newType-name = estrdup(anonymous); + { + smart_str anonymous = {0}; + + smart_str_appendl(anonymous, anonymous, sizeof(anonymous)-1); + smart_str_append_long(anonymous, zend_hash_num_elements(sdl-types)); + smart_str_0(anonymous); + newType-name = anonymous.c; + } newType-namens = estrdup((char*)tns-children-content); if (cur_type-elements == NULL) { @@ -1879,7 +1894,14 @@ } dummy_type = emalloc(sizeof(sdlType)); memset(dummy_type, 0, sizeof(sdlType)); - dummy_type-name = estrdup(anonymous); + { + smart_str anonymous = {0}; + + smart_str_appendl(anonymous, anonymous, sizeof(anonymous)-1); + smart_str_append_long(anonymous, zend_hash_num_elements(sdl-types)); + smart_str_0(anonymous); + dummy_type-name = anonymous.c; + } dummy_type-namens = estrdup((char*)tns-children-content); schema_simpleType(sdl, tns, trav, dummy_type); newAttr-encode = dummy_type-encode; http://cvs.php.net/viewvc.cgi/php-src/ext/soap/soap.c?r1=1.227r2=1.228diff_format=u Index: php-src/ext/soap/soap.c diff -u php-src/ext/soap/soap.c:1.227 php-src/ext/soap/soap.c:1.228 --- php-src/ext/soap/soap.c:1.227 Fri Aug 31 09:36:14 2007 +++ php-src/ext/soap/soap.c Fri Aug 31 10:48:57 2007 @@ -17,7 +17,7 @@ | Dmitry Stogov [EMAIL PROTECTED] | +--+ */ -/* $Id: soap.c,v 1.227 2007/08/31 09:36:14 dmitry Exp $ */ +/* $Id: soap.c,v 1.228 2007/08/31 10:48:57 dmitry Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -3253,8 +3253,8 @@ while (zend_hash_get_current_data_ex(sdl-types, (void **)type, pos) != FAILURE) { type_to_string((*type), buf, 0); add_next_index_rt_stringl(return_value, buf.c, buf.len, 1); - zend_hash_move_forward_ex(sdl-types, pos); smart_str_free(buf); + zend_hash_move_forward_ex(sdl-types, pos); } } } @@ -5016,8 +5016,6 @@ switch (type-kind) { case XSD_TYPEKIND_SIMPLE: - case XSD_TYPEKIND_LIST: - case XSD_TYPEKIND_UNION: if (type-encode
[PHP-CVS] cvs: php-src(PHP_5_2) / NEWS /sapi/cgi cgi_main.c
dmitry Fri Aug 31 12:17:52 2007 UTC Modified files: (Branch: PHP_5_2) /php-srcNEWS /php-src/sapi/cgi cgi_main.c Log: Fixed bug #42453 (CGI SAPI does not shut down cleanly with -i/-m/-v cmdline options) http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.920r2=1.2027.2.547.2.921diff_format=u Index: php-src/NEWS diff -u php-src/NEWS:1.2027.2.547.2.920 php-src/NEWS:1.2027.2.547.2.921 --- php-src/NEWS:1.2027.2.547.2.920 Fri Aug 31 10:48:45 2007 +++ php-src/NEWSFri Aug 31 12:17:52 2007 @@ -5,6 +5,8 @@ - Fixed bug #42462 (Segmentation when trying to set an attribute in a DOMElement). (Rob) +- Fixed bug #42453 (CGI SAPI does not shut down cleanly with -i/-m/-v cmdline + options). (Dmitry) - Fixed bug #42452 (PDO classes do not expose Reflection API information). (Hannes) - Fixed bug #42359 (xsd:list type not parsed). (Dmitry) http://cvs.php.net/viewvc.cgi/php-src/sapi/cgi/cgi_main.c?r1=1.267.2.15.2.46r2=1.267.2.15.2.47diff_format=u Index: php-src/sapi/cgi/cgi_main.c diff -u php-src/sapi/cgi/cgi_main.c:1.267.2.15.2.46 php-src/sapi/cgi/cgi_main.c:1.267.2.15.2.47 --- php-src/sapi/cgi/cgi_main.c:1.267.2.15.2.46 Wed Aug 8 23:51:57 2007 +++ php-src/sapi/cgi/cgi_main.c Fri Aug 31 12:17:52 2007 @@ -21,7 +21,7 @@ +--+ */ -/* $Id: cgi_main.c,v 1.267.2.15.2.46 2007/08/08 23:51:57 stas Exp $ */ +/* $Id: cgi_main.c,v 1.267.2.15.2.47 2007/08/31 12:17:52 dmitry Exp $ */ #include php.h #include php_globals.h @@ -1471,8 +1471,8 @@ SG(headers_sent) = 1; php_cgi_usage(argv[0]); php_end_ob_buffers(1 TSRMLS_CC); - exit(1); - break; + exit_status = 0; + goto out; } } php_optind = orig_optind; @@ -1511,7 +1511,8 @@ SG(headers_sent) = 1; php_printf(You cannot use both -n and -c switch. Use -h for help.\n); php_end_ob_buffers(1 TSRMLS_CC); - exit(1); + exit_status = 1; + goto out; } while ((c = php_getopt(argc, argv, OPTIONS, php_optarg, php_optind, 0)) != -1) { @@ -1552,9 +1553,9 @@ SG(request_info).no_headers = 1; } php_print_info(0x TSRMLS_CC); - php_end_ob_buffers(1 TSRMLS_CC); - exit(0); - break; + php_request_shutdown((void *) 0); + exit_status = 0; + goto out; case 'l': /* syntax check mode */ no_headers = 1; @@ -1571,8 +1572,8 @@ print_extensions(TSRMLS_C); php_printf(\n); php_end_ob_buffers(1 TSRMLS_CC); - exit(0); - break; + exit_status = 0; + goto out; #if 0 /* not yet operational, see also below ... */ case '': /* generate indented source mode*/ @@ -1600,9 +1601,9 @@ #else php_printf(PHP %s (%s) (built: %s %s)\nCopyright (c) 1997-2007 The PHP Group\n%s, PHP_VERSION, sapi_module.name, __DATE__, __TIME__, get_zend_version()); #endif - php_end_ob_buffers(1 TSRMLS_CC); - exit(0); - break; + php_request_shutdown((void *) 0); + exit_status = 0; + goto out; case 'w': behavior = PHP_MODE_STRIP; @@ -1890,6 +1891,7 @@ exit_status = 255; } zend_end_try(); +out: SG(server_context) = NULL; php_module_shutdown(TSRMLS_C); sapi_shutdown(); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /sapi/cgi cgi_main.c
dmitry Fri Aug 31 12:18:04 2007 UTC Modified files: /php-src/sapi/cgi cgi_main.c Log: Fixed bug #42453 (CGI SAPI does not shut down cleanly with -i/-m/-v cmdline options) http://cvs.php.net/viewvc.cgi/php-src/sapi/cgi/cgi_main.c?r1=1.330r2=1.331diff_format=u Index: php-src/sapi/cgi/cgi_main.c diff -u php-src/sapi/cgi/cgi_main.c:1.330 php-src/sapi/cgi/cgi_main.c:1.331 --- php-src/sapi/cgi/cgi_main.c:1.330 Wed Aug 8 23:55:42 2007 +++ php-src/sapi/cgi/cgi_main.c Fri Aug 31 12:18:04 2007 @@ -21,7 +21,7 @@ +--+ */ -/* $Id: cgi_main.c,v 1.330 2007/08/08 23:55:42 stas Exp $ */ +/* $Id: cgi_main.c,v 1.331 2007/08/31 12:18:04 dmitry Exp $ */ #include php.h #include php_globals.h @@ -1410,9 +1410,9 @@ php_output_tearup(); SG(headers_sent) = 1; php_cgi_usage(argv[0]); - php_output_teardown(); - exit(1); - break; + php_output_end_all(TSRMLS_C); + exit_status = 0; + goto out; } } php_optind = orig_optind; @@ -1438,8 +1438,9 @@ php_output_tearup(); SG(headers_sent) = 1; php_printf(You cannot use both -n and -c switch. Use -h for help.\n); - php_output_teardown(); - exit(1); + php_output_end_all(TSRMLS_C); + exit_status = 1; + goto out; } while ((c = php_getopt(argc, argv, OPTIONS, php_optarg, php_optind, 0)) != -1) { @@ -1480,9 +1481,9 @@ SG(request_info).no_headers = 1; } php_print_info(0x TSRMLS_CC); - php_output_teardown(); - exit(0); - break; + php_request_shutdown((void *) 0); + exit_status = 0; + goto out; case 'l': /* syntax check mode */ no_headers = 1; @@ -1497,9 +1498,9 @@ php_printf(\n[Zend Modules]\n); print_extensions(TSRMLS_C); php_printf(\n); - php_output_teardown(); - exit(0); - break; + php_output_end_all(TSRMLS_C); + exit_status = 0; + goto out; #if 0 /* not yet operational, see also below ... */ case '': /* generate indented source mode*/ @@ -1527,9 +1528,9 @@ #else php_printf(PHP %s (%s) (built: %s %s)\nCopyright (c) 1997-2007 The PHP Group\n%s, PHP_VERSION, sapi_module.name, __DATE__, __TIME__, get_zend_version()); #endif - php_output_teardown(); - exit(0); - break; + php_request_shutdown((void *) 0); + exit_status = 0; + goto out; case 'w': behavior = PHP_MODE_STRIP; @@ -1802,6 +1803,7 @@ exit_status = 255; } zend_end_try(); +out: SG(server_context) = NULL; php_module_shutdown(TSRMLS_C); sapi_shutdown(); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_2) / NEWS /sapi/cgi cgi_main.c
dmitry Wed Sep 5 08:26:32 2007 UTC Modified files: (Branch: PHP_5_2) /php-srcNEWS /php-src/sapi/cgi cgi_main.c Log: Fixed bug #42523 (PHP_SELF duplicates path) http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.927r2=1.2027.2.547.2.928diff_format=u Index: php-src/NEWS diff -u php-src/NEWS:1.2027.2.547.2.927 php-src/NEWS:1.2027.2.547.2.928 --- php-src/NEWS:1.2027.2.547.2.927 Tue Sep 4 18:51:48 2007 +++ php-src/NEWSWed Sep 5 08:26:31 2007 @@ -9,6 +9,7 @@ - Upgraded PCRE to version 7.3 (Nuno) - Added optional parameter $provide_object to debug_backtrace(). (Sebastian) +- Fixed bug #42523 (PHP_SELF duplicates path). (Dmitry) - Fixed bug #42512 (ip2long('255.255.255.255') should return 4294967295 on 64-bit PHP). (Derick) - Fixed bug #42506 (php_pgsql_convert() timezone parse bug) (nonunnet at http://cvs.php.net/viewvc.cgi/php-src/sapi/cgi/cgi_main.c?r1=1.267.2.15.2.47r2=1.267.2.15.2.48diff_format=u Index: php-src/sapi/cgi/cgi_main.c diff -u php-src/sapi/cgi/cgi_main.c:1.267.2.15.2.47 php-src/sapi/cgi/cgi_main.c:1.267.2.15.2.48 --- php-src/sapi/cgi/cgi_main.c:1.267.2.15.2.47 Fri Aug 31 12:17:52 2007 +++ php-src/sapi/cgi/cgi_main.c Wed Sep 5 08:26:32 2007 @@ -21,7 +21,7 @@ +--+ */ -/* $Id: cgi_main.c,v 1.267.2.15.2.47 2007/08/31 12:17:52 dmitry Exp $ */ +/* $Id: cgi_main.c,v 1.267.2.15.2.48 2007/09/05 08:26:32 dmitry Exp $ */ #include php.h #include php_globals.h @@ -778,6 +778,21 @@ char *env_redirect_url = sapi_cgibin_getenv(REDIRECT_URL, sizeof(REDIRECT_URL)-1 TSRMLS_CC); char *env_document_root = sapi_cgibin_getenv(DOCUMENT_ROOT, sizeof(DOCUMENT_ROOT)-1 TSRMLS_CC); + /* Hack for buggy IIS that sets incorrect PATH_INFO */ + char *env_server_software = sapi_cgibin_getenv(SERVER_SOFTWARE, sizeof(SERVER_SOFTWARE)-1 TSRMLS_CC); + if (env_server_software + env_script_name + env_path_info + strncmp(env_server_software, Microsoft-IIS, sizeof(Microsoft-IIS)-1) == 0 + strncmp(env_path_info, env_script_name, strlen(env_script_name)) == 0) { + env_path_info = _sapi_cgibin_putenv(ORIG_PATH_INFO, env_path_info TSRMLS_CC); + env_path_info += strlen(env_script_name); + if (*env_path_info == 0) { + env_path_info = NULL; + } + env_path_info = _sapi_cgibin_putenv(PATH_INFO, env_path_info TSRMLS_CC); + } + if (CGIG(fix_pathinfo)) { char *real_path = NULL; char *orig_path_translated = env_path_translated; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /sapi/cgi cgi_main.c
dmitry Wed Sep 5 08:26:49 2007 UTC Modified files: /php-src/sapi/cgi cgi_main.c Log: Fixed bug #42523 (PHP_SELF duplicates path) http://cvs.php.net/viewvc.cgi/php-src/sapi/cgi/cgi_main.c?r1=1.331r2=1.332diff_format=u Index: php-src/sapi/cgi/cgi_main.c diff -u php-src/sapi/cgi/cgi_main.c:1.331 php-src/sapi/cgi/cgi_main.c:1.332 --- php-src/sapi/cgi/cgi_main.c:1.331 Fri Aug 31 12:18:04 2007 +++ php-src/sapi/cgi/cgi_main.c Wed Sep 5 08:26:49 2007 @@ -21,7 +21,7 @@ +--+ */ -/* $Id: cgi_main.c,v 1.331 2007/08/31 12:18:04 dmitry Exp $ */ +/* $Id: cgi_main.c,v 1.332 2007/09/05 08:26:49 dmitry Exp $ */ #include php.h #include php_globals.h @@ -751,6 +751,21 @@ char *env_path_info = sapi_cgibin_getenv(PATH_INFO, sizeof(PATH_INFO)-1 TSRMLS_CC); char *env_script_name = sapi_cgibin_getenv(SCRIPT_NAME, sizeof(SCRIPT_NAME)-1 TSRMLS_CC); + /* Hack for buggy IIS that sets incorrect PATH_INFO */ + char *env_server_software = sapi_cgibin_getenv(SERVER_SOFTWARE, sizeof(SERVER_SOFTWARE)-1 TSRMLS_CC); + if (env_server_software + env_script_name + env_path_info + strncmp(env_server_software, Microsoft-IIS, sizeof(Microsoft-IIS)-1) == 0 + strncmp(env_path_info, env_script_name, strlen(env_script_name)) == 0) { + env_path_info = _sapi_cgibin_putenv(ORIG_PATH_INFO, env_path_info TSRMLS_CC); + env_path_info += strlen(env_script_name); + if (*env_path_info == 0) { + env_path_info = NULL; + } + env_path_info = _sapi_cgibin_putenv(PATH_INFO, env_path_info TSRMLS_CC); + } + if (CGIG(fix_pathinfo)) { struct stat st; char *real_path = NULL; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_2) / NEWS /ext/soap php_encoding.c /ext/soap/tests/bugs bug42488.phpt
dmitry Wed Sep 5 10:18:24 2007 UTC Added files: (Branch: PHP_5_2) /php-src/ext/soap/tests/bugsbug42488.phpt Modified files: /php-srcNEWS /php-src/ext/soap php_encoding.c Log: Fixed bug #42488 (SoapServer reports an encoding error and the error itself breaks). http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.928r2=1.2027.2.547.2.929diff_format=u Index: php-src/NEWS diff -u php-src/NEWS:1.2027.2.547.2.928 php-src/NEWS:1.2027.2.547.2.929 --- php-src/NEWS:1.2027.2.547.2.928 Wed Sep 5 08:26:31 2007 +++ php-src/NEWSWed Sep 5 10:18:22 2007 @@ -22,6 +22,8 @@ (Hannes) - Fixed bug #42468 (Write lock on file_get_contents fails when using a compression stream). (Ilia) +- Fixed bug #42488 (SoapServer reports an encoding error and the error itself + breaks). (Dmitry) - Fixed bug #42359 (xsd:list type not parsed). (Dmitry) - Fixed bug #42326 (SoapServer crash). (Dmitry) - Fixed bug #42086 (SoapServer return Procedure '' not present for WSIBasic http://cvs.php.net/viewvc.cgi/php-src/ext/soap/php_encoding.c?r1=1.103.2.21.2.36r2=1.103.2.21.2.37diff_format=u Index: php-src/ext/soap/php_encoding.c diff -u php-src/ext/soap/php_encoding.c:1.103.2.21.2.36 php-src/ext/soap/php_encoding.c:1.103.2.21.2.37 --- php-src/ext/soap/php_encoding.c:1.103.2.21.2.36 Fri Aug 31 08:07:27 2007 +++ php-src/ext/soap/php_encoding.c Wed Sep 5 10:18:22 2007 @@ -17,7 +17,7 @@ | Dmitry Stogov [EMAIL PROTECTED] | +--+ */ -/* $Id: php_encoding.c,v 1.103.2.21.2.36 2007/08/31 08:07:27 dmitry Exp $ */ +/* $Id: php_encoding.c,v 1.103.2.21.2.37 2007/09/05 10:18:22 dmitry Exp $ */ #include time.h @@ -864,13 +864,50 @@ efree(str); str = estrdup((char*)xmlBufferContent(out)); new_len = n; - } else if (!php_libxml_xmlCheckUTF8(BAD_CAST(str))) { - soap_error1(E_ERROR, Encoding: string '%s' is not a valid utf-8 string, str); } xmlBufferFree(out); xmlBufferFree(in); - } else if (!php_libxml_xmlCheckUTF8(BAD_CAST(str))) { - soap_error1(E_ERROR, Encoding: string '%s' is not a valid utf-8 string, str); + } + + if (!php_libxml_xmlCheckUTF8(BAD_CAST(str))) { + char *err = emalloc(new_len + 8); + char c; + int i; + + memcpy(err, str, new_len+1); + for (i = 0; (c = err[i++]);) { + if ((c 0x80) == 0) { + } else if ((c 0xe0) == 0xc0) { + if ((err[i] 0xc0) != 0x80) { + break; + } + i++; + } else if ((c 0xf0) == 0xe0) { + if ((err[i] 0xc0) != 0x80 || (err[i+1] 0xc0) != 0x80) { + break; + } + i += 2; + } else if ((c 0xf8) == 0xf0) { + if ((err[i] 0xc0) != 0x80 || (err[i+1] 0xc0) != 0x80 || (err[i+2] 0xc0) != 0x80) { + break; + } + i += 3; + } else { + break; + } + } + if (c) { + err[i-1] = '\\'; + err[i++] = 'x'; + err[i++] = ((unsigned char)c 4) + unsigned char)c 4) 9) ? ('a' - 10) : '0'); + err[i++] = (c 15) + (((c 15) 9) ? ('a' - 10) : '0'); + err[i++] = '.'; + err[i++] = '.'; + err[i++] = '.'; + err[i++] = 0; + } + + soap_error1(E_ERROR, Encoding: string '%s' is not a valid utf-8 string, err); } text = xmlNewTextLen(BAD_CAST(str), new_len); http://cvs.php.net/viewvc.cgi/php-src/ext/soap/tests/bugs/bug42488.phpt?view=markuprev=1.1 Index: php-src/ext/soap/tests/bugs/bug42488.phpt +++ php-src/ext/soap/tests/bugs/bug42488.phpt -- 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/bugs bug42488.phpt
dmitry Wed Sep 5 10:18:38 2007 UTC Modified files: /php-src/ext/soap soap.c /php-src/ext/soap/tests/bugsbug42488.phpt Log: Fixed bug #42488 (SoapServer reports an encoding error and the error itself breaks). http://cvs.php.net/viewvc.cgi/php-src/ext/soap/soap.c?r1=1.228r2=1.229diff_format=u Index: php-src/ext/soap/soap.c diff -u php-src/ext/soap/soap.c:1.228 php-src/ext/soap/soap.c:1.229 --- php-src/ext/soap/soap.c:1.228 Fri Aug 31 10:48:57 2007 +++ php-src/ext/soap/soap.c Wed Sep 5 10:18:37 2007 @@ -17,7 +17,7 @@ | Dmitry Stogov [EMAIL PROTECTED] | +--+ */ -/* $Id: soap.c,v 1.228 2007/08/31 10:48:57 dmitry Exp $ */ +/* $Id: soap.c,v 1.229 2007/09/05 10:18:37 dmitry Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -343,13 +343,49 @@ if (n = 0) { efree(str); str = estrdup((char*)xmlBufferContent(out)); - } else if (!php_libxml_xmlCheckUTF8(BAD_CAST(str))) { - soap_error1(E_ERROR, Encoding: string '%s' is not a valid utf-8 string, str); } xmlBufferFree(out); xmlBufferFree(in); - } else if (!php_libxml_xmlCheckUTF8(BAD_CAST(str))) { - soap_error1(E_ERROR, Encoding: string '%s' is not a valid utf-8 string, str); + } + if (!php_libxml_xmlCheckUTF8(BAD_CAST(str))) { + char *err = emalloc(new_len + 8); + char c; + int i; + + memcpy(err, str, new_len+1); + for (i = 0; (c = err[i++]);) { + if ((c 0x80) == 0) { + } else if ((c 0xe0) == 0xc0) { + if ((err[i] 0xc0) != 0x80) { + break; + } + i++; + } else if ((c 0xf0) == 0xe0) { + if ((err[i] 0xc0) != 0x80 || (err[i+1] 0xc0) != 0x80) { + break; + } + i += 2; + } else if ((c 0xf8) == 0xf0) { + if ((err[i] 0xc0) != 0x80 || (err[i+1] 0xc0) != 0x80 || (err[i+2] 0xc0) != 0x80) { + break; + } + i += 3; + } else { + break; + } + } + if (c) { + err[i-1] = '\\'; + err[i++] = 'x'; + err[i++] = ((unsigned char)c 4) + unsigned char)c 4) 9) ? ('a' - 10) : '0'); + err[i++] = (c 15) + (((c 15) 9) ? ('a' - 10) : '0'); + err[i++] = '.'; + err[i++] = '.'; + err[i++] = '.'; + err[i++] = 0; + } + + soap_error1(E_ERROR, Encoding: string '%s' is not a valid utf-8 string, err); } } return str; @@ -386,13 +422,49 @@ efree(str); str = estrdup((char*)xmlBufferContent(out)); new_len = n; - } else if (!php_libxml_xmlCheckUTF8(BAD_CAST(str))) { - soap_error1(E_ERROR, Encoding: string '%s' is not a valid utf-8 string, str); } xmlBufferFree(out); xmlBufferFree(in); - } else if (!php_libxml_xmlCheckUTF8(BAD_CAST(str))) { - soap_error1(E_ERROR, Encoding: string '%s' is not a valid utf-8 string, str); + } + if (!php_libxml_xmlCheckUTF8(BAD_CAST(str))) { + char *err = emalloc(new_len + 8); + char c; + int i; + + memcpy(err, str, new_len+1); + for (i = 0; (c = err[i++]);) { + if ((c 0x80) == 0) { + } else if ((c 0xe0) == 0xc0) { + if ((err[i] 0xc0) != 0x80) { + break
[PHP-CVS] cvs: php-src(PHP_5_2) / NEWS /ext/soap php_soap.h soap.c /ext/soap/tests/bugs bug42214.phpt
dmitry Wed Sep 5 11:20:46 2007 UTC Added files: (Branch: PHP_5_2) /php-src/ext/soap/tests/bugsbug42214.phpt Modified files: /php-srcNEWS /php-src/ext/soap php_soap.h soap.c Log: Fixed bug #42214 (SoapServer sends clients internal PHP errors) http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.929r2=1.2027.2.547.2.930diff_format=u Index: php-src/NEWS diff -u php-src/NEWS:1.2027.2.547.2.929 php-src/NEWS:1.2027.2.547.2.930 --- php-src/NEWS:1.2027.2.547.2.929 Wed Sep 5 10:18:22 2007 +++ php-src/NEWSWed Sep 5 11:20:45 2007 @@ -26,6 +26,7 @@ breaks). (Dmitry) - Fixed bug #42359 (xsd:list type not parsed). (Dmitry) - Fixed bug #42326 (SoapServer crash). (Dmitry) +- Fixed bug #42214 (SoapServer sends clients internal PHP errors). (Dmitry) - Fixed bug #42086 (SoapServer return Procedure '' not present for WSIBasic compliant wsdl). (Dmitry) http://cvs.php.net/viewvc.cgi/php-src/ext/soap/php_soap.h?r1=1.38.2.6.2.5r2=1.38.2.6.2.6diff_format=u Index: php-src/ext/soap/php_soap.h diff -u php-src/ext/soap/php_soap.h:1.38.2.6.2.5 php-src/ext/soap/php_soap.h:1.38.2.6.2.6 --- php-src/ext/soap/php_soap.h:1.38.2.6.2.5Mon Apr 2 13:43:08 2007 +++ php-src/ext/soap/php_soap.h Wed Sep 5 11:20:45 2007 @@ -17,7 +17,7 @@ | Dmitry Stogov [EMAIL PROTECTED] | +--+ */ -/* $Id: php_soap.h,v 1.38.2.6.2.5 2007/04/02 13:43:08 dmitry Exp $ */ +/* $Id: php_soap.h,v 1.38.2.6.2.6 2007/09/05 11:20:45 dmitry Exp $ */ #ifndef PHP_SOAP_H #define PHP_SOAP_H @@ -106,6 +106,7 @@ HashTable *class_map; intfeatures; struct _soapHeader **soap_headers_ptr; + int send_errors; }; #define SOAP_CLASS 1 http://cvs.php.net/viewvc.cgi/php-src/ext/soap/soap.c?r1=1.156.2.28.2.29r2=1.156.2.28.2.30diff_format=u Index: php-src/ext/soap/soap.c diff -u php-src/ext/soap/soap.c:1.156.2.28.2.29 php-src/ext/soap/soap.c:1.156.2.28.2.30 --- php-src/ext/soap/soap.c:1.156.2.28.2.29 Fri Aug 31 10:48:45 2007 +++ php-src/ext/soap/soap.c Wed Sep 5 11:20:45 2007 @@ -17,7 +17,7 @@ | Dmitry Stogov [EMAIL PROTECTED] | +--+ */ -/* $Id: soap.c,v 1.156.2.28.2.29 2007/08/31 10:48:45 dmitry Exp $ */ +/* $Id: soap.c,v 1.156.2.28.2.30 2007/09/05 11:20:45 dmitry Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -1035,6 +1035,7 @@ service = emalloc(sizeof(soapService)); memset(service, 0, sizeof(soapService)); + service-send_errors = 1; cache_wsdl = SOAP_GLOBAL(cache); @@ -1099,6 +1100,11 @@ cache_wsdl = Z_LVAL_PP(tmp); } + if (zend_hash_find(ht, send_errors, sizeof(send_errors), (void**)tmp) == SUCCESS + (Z_TYPE_PP(tmp) == IS_BOOL || Z_TYPE_PP(tmp) == IS_LONG)) { + service-send_errors = Z_LVAL_PP(tmp); + } + } else if (wsdl == NULL) { php_error_docref(NULL TSRMLS_CC, E_ERROR, Invalid arguments. 'uri' option is required in nonWSDL mode.); } @@ -2129,34 +2135,46 @@ char* code = SOAP_GLOBAL(error_code); char buffer[1024]; - int buffer_len; zval *outbuf = NULL; - zval outbuflen; + zval **tmp; + soapServicePtr service; - INIT_ZVAL(outbuflen); + if (code == NULL) { + code = Server; + } + if (SOAP_GLOBAL(error_object) + Z_TYPE_P(SOAP_GLOBAL(error_object)) == IS_OBJECT + instanceof_function(Z_OBJCE_P(SOAP_GLOBAL(error_object)), soap_server_class_entry TSRMLS_CC) + zend_hash_find(Z_OBJPROP_P(SOAP_GLOBAL(error_object)), service, sizeof(service), (void **)tmp) != FAILURE + (service = (soapServicePtr)zend_fetch_resource(tmp TSRMLS_CC, -1, service, NULL, 1, le_service)) + !service-send_errors) { + strcpy(buffer, Internal Error); + } else { + int buffer_len; + zval outbuflen; + + INIT_ZVAL(outbuflen); #ifdef va_copy - va_copy(argcopy, args); - buffer_len = vslprintf(buffer, sizeof(buffer)-1, format, argcopy); - va_end(argcopy); + va_copy(argcopy, args); + buffer_len = vslprintf(buffer, sizeof(buffer)-1, format, argcopy
[PHP-CVS] cvs: php-src /ext/soap php_soap.h soap.c /ext/soap/tests/bugs bug42214.phpt
dmitry Wed Sep 5 11:21:01 2007 UTC Modified files: /php-src/ext/soap php_soap.h soap.c /php-src/ext/soap/tests/bugsbug42214.phpt Log: Fixed bug #42214 (SoapServer sends clients internal PHP errors) http://cvs.php.net/viewvc.cgi/php-src/ext/soap/php_soap.h?r1=1.52r2=1.53diff_format=u Index: php-src/ext/soap/php_soap.h diff -u php-src/ext/soap/php_soap.h:1.52 php-src/ext/soap/php_soap.h:1.53 --- php-src/ext/soap/php_soap.h:1.52Mon Apr 2 13:43:29 2007 +++ php-src/ext/soap/php_soap.h Wed Sep 5 11:21:01 2007 @@ -17,7 +17,7 @@ | Dmitry Stogov [EMAIL PROTECTED] | +--+ */ -/* $Id: php_soap.h,v 1.52 2007/04/02 13:43:29 dmitry Exp $ */ +/* $Id: php_soap.h,v 1.53 2007/09/05 11:21:01 dmitry Exp $ */ #ifndef PHP_SOAP_H #define PHP_SOAP_H @@ -105,6 +105,7 @@ inttype; char *actor; struct _soapHeader **soap_headers_ptr; + int send_errors; } soap_server_object; typedef struct _soap_client_object { http://cvs.php.net/viewvc.cgi/php-src/ext/soap/soap.c?r1=1.229r2=1.230diff_format=u Index: php-src/ext/soap/soap.c diff -u php-src/ext/soap/soap.c:1.229 php-src/ext/soap/soap.c:1.230 --- php-src/ext/soap/soap.c:1.229 Wed Sep 5 10:18:37 2007 +++ php-src/ext/soap/soap.c Wed Sep 5 11:21:01 2007 @@ -17,7 +17,7 @@ | Dmitry Stogov [EMAIL PROTECTED] | +--+ */ -/* $Id: soap.c,v 1.229 2007/09/05 10:18:37 dmitry Exp $ */ +/* $Id: soap.c,v 1.230 2007/09/05 11:21:01 dmitry Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -1382,6 +1382,7 @@ } service = (soap_server_object*)zend_object_store_get_object(this_ptr TSRMLS_CC); + service-send_errors = 1; cache_wsdl = SOAP_GLOBAL(cache); @@ -1457,6 +1458,11 @@ Z_TYPE_PP(tmp) == IS_LONG) { cache_wsdl = Z_LVAL_PP(tmp); } + + if (zend_ascii_hash_find(ht, send_errors, sizeof(send_errors), (void**)tmp) == SUCCESS + (Z_TYPE_PP(tmp) == IS_BOOL || Z_TYPE_PP(tmp) == IS_LONG)) { + service-send_errors = Z_LVAL_PP(tmp); + } } if (wsdl == NULL service-uri == NULL) { @@ -2504,30 +2510,41 @@ error_num == E_PARSE) { char* code = SOAP_GLOBAL(error_code); + soap_server_object *server; char *buffer; - int buffer_len; zval *outbuf = NULL; - zval outbuflen; - INIT_ZVAL(outbuflen); + if (code == NULL) { + code = Server; + } + + if (SOAP_GLOBAL(error_object) + Z_TYPE_P(SOAP_GLOBAL(error_object)) == IS_OBJECT + instanceof_function(Z_OBJCE_P(SOAP_GLOBAL(error_object)), soap_server_class_entry TSRMLS_CC) + (server = (soap_server_object*)zend_object_store_get_object(SOAP_GLOBAL(error_object) TSRMLS_CC)) + !server-send_errors) { + buffer = estrdup(Internal Error); + } else { + int buffer_len; + zval outbuflen; + + INIT_ZVAL(outbuflen); #ifdef va_copy - va_copy(argcopy, args); - buffer_len = vspprintf(buffer, 0, format, argcopy); - va_end(argcopy); + va_copy(argcopy, args); + buffer_len = vspprintf(buffer, 0, format, argcopy); + va_end(argcopy); #else - buffer_len = vspprintf(buffer, 0, format, args); + buffer_len = vspprintf(buffer, 0, format, args); #endif - if (code == NULL) { - code = Server; - } - /* Get output buffer and send as fault detials */ - if (php_output_get_length(outbuflen TSRMLS_CC) != FAILURE Z_LVAL(outbuflen) != 0) { - ALLOC_INIT_ZVAL(outbuf); - php_output_get_contents(outbuf TSRMLS_CC); + /* Get output buffer and send as fault detials */ + if (php_output_get_length(outbuflen TSRMLS_CC) != FAILURE Z_LVAL(outbuflen) != 0) { + ALLOC_INIT_ZVAL(outbuf); + php_output_get_contents(outbuf TSRMLS_CC
[PHP-CVS] cvs: php-src /sapi/cgi fastcgi.c
dmitry Fri Sep 7 08:30:11 2007 UTC Modified files: /php-src/sapi/cgi fastcgi.c Log: Added checks for malformated FastCGI requests (Mattias Bengtsson) http://cvs.php.net/viewvc.cgi/php-src/sapi/cgi/fastcgi.c?r1=1.40r2=1.41diff_format=u Index: php-src/sapi/cgi/fastcgi.c diff -u php-src/sapi/cgi/fastcgi.c:1.40 php-src/sapi/cgi/fastcgi.c:1.41 --- php-src/sapi/cgi/fastcgi.c:1.40 Mon Jul 9 11:48:53 2007 +++ php-src/sapi/cgi/fastcgi.c Fri Sep 7 08:30:10 2007 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: fastcgi.c,v 1.40 2007/07/09 11:48:53 dmitry Exp $ */ +/* $Id: fastcgi.c,v 1.41 2007/09/07 08:30:10 dmitry Exp $ */ #include php.h #include fastcgi.h @@ -620,7 +620,8 @@ val_len |= (*p++ 8); val_len |= *p++; } - if (p + name_len + val_len end) { + if (name_len + val_len 0 || + name_len + val_len end - p) { /* Malformated request */ ret = 0; break; @@ -676,6 +677,10 @@ padding = hdr.paddingLength; } + if (len + padding FCGI_MAX_LENGTH) { + return 0; + } + req-id = (hdr.requestIdB1 8) + hdr.requestIdB0; if (hdr.type == FCGI_BEGIN_REQUEST len == sizeof(fcgi_begin_request)) { -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_2) /sapi/cgi fastcgi.c
dmitry Fri Sep 7 08:26:48 2007 UTC Modified files: (Branch: PHP_5_2) /php-src/sapi/cgi fastcgi.c Log: Added checks for malformated FastCGI requests (Mattias Bengtsson) http://cvs.php.net/viewvc.cgi/php-src/sapi/cgi/fastcgi.c?r1=1.4.2.13.2.27r2=1.4.2.13.2.28diff_format=u Index: php-src/sapi/cgi/fastcgi.c diff -u php-src/sapi/cgi/fastcgi.c:1.4.2.13.2.27 php-src/sapi/cgi/fastcgi.c:1.4.2.13.2.28 --- php-src/sapi/cgi/fastcgi.c:1.4.2.13.2.27Mon Jul 9 11:48:39 2007 +++ php-src/sapi/cgi/fastcgi.c Fri Sep 7 08:26:47 2007 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: fastcgi.c,v 1.4.2.13.2.27 2007/07/09 11:48:39 dmitry Exp $ */ +/* $Id: fastcgi.c,v 1.4.2.13.2.28 2007/09/07 08:26:47 dmitry Exp $ */ #include php.h #include fastcgi.h @@ -620,7 +620,8 @@ val_len |= (*p++ 8); val_len |= *p++; } - if (p + name_len + val_len end) { + if (name_len + val_len 0 || + name_len + val_len end - p) { /* Malformated request */ ret = 0; break; @@ -676,6 +677,10 @@ padding = hdr.paddingLength; } + if (len + padding FCGI_MAX_LENGTH) { + return 0; + } + req-id = (hdr.requestIdB1 8) + hdr.requestIdB0; if (hdr.type == FCGI_BEGIN_REQUEST len == sizeof(fcgi_begin_request)) { @@ -712,6 +717,10 @@ padding = hdr.paddingLength; while (hdr.type == FCGI_PARAMS len 0) { + if (len + padding FCGI_MAX_LENGTH) { + return 0; + } + if (safe_read(req, buf, len+padding) != len+padding) { req-keep = 0; return 0; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /sapi/cgi fastcgi.c
dmitry Fri Sep 7 08:42:33 2007 UTC Modified files: /php-src/sapi/cgi fastcgi.c Log: forgotten part http://cvs.php.net/viewvc.cgi/php-src/sapi/cgi/fastcgi.c?r1=1.41r2=1.42diff_format=u Index: php-src/sapi/cgi/fastcgi.c diff -u php-src/sapi/cgi/fastcgi.c:1.41 php-src/sapi/cgi/fastcgi.c:1.42 --- php-src/sapi/cgi/fastcgi.c:1.41 Fri Sep 7 08:30:10 2007 +++ php-src/sapi/cgi/fastcgi.c Fri Sep 7 08:42:33 2007 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: fastcgi.c,v 1.41 2007/09/07 08:30:10 dmitry Exp $ */ +/* $Id: fastcgi.c,v 1.42 2007/09/07 08:42:33 dmitry Exp $ */ #include php.h #include fastcgi.h @@ -717,6 +717,10 @@ padding = hdr.paddingLength; while (hdr.type == FCGI_PARAMS len 0) { + if (len + padding FCGI_MAX_LENGTH) { + return 0; + } + if (safe_read(req, buf, len+padding) != len+padding) { req-keep = 0; return 0; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_2) / NEWS /sapi/cgi cgi_main.c
dmitry Mon Sep 10 10:55:27 2007 UTC Modified files: (Branch: PHP_5_2) /php-srcNEWS /php-src/sapi/cgi cgi_main.c Log: Fixed bug #42587 (behaviour change regarding symlinked .php files) http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.938r2=1.2027.2.547.2.939diff_format=u Index: php-src/NEWS diff -u php-src/NEWS:1.2027.2.547.2.938 php-src/NEWS:1.2027.2.547.2.939 --- php-src/NEWS:1.2027.2.547.2.938 Sun Sep 9 16:34:05 2007 +++ php-src/NEWSMon Sep 10 10:55:26 2007 @@ -14,6 +14,7 @@ - Fixed bug #42590 (Make the engine recornize \v and \f escape sequences). (Ilia) +- Fixed bug #42587 (behaviour change regarding symlinked .php files). (Dmitry) - Fixed bug #42579 (apache_reset_timeout() does not exist). (Jani) - Fixed bug #42549 (ext/mysql failed to compile with libmysql 3.23). (Scott) - Fixed bug #42523 (PHP_SELF duplicates path). (Dmitry) http://cvs.php.net/viewvc.cgi/php-src/sapi/cgi/cgi_main.c?r1=1.267.2.15.2.48r2=1.267.2.15.2.49diff_format=u Index: php-src/sapi/cgi/cgi_main.c diff -u php-src/sapi/cgi/cgi_main.c:1.267.2.15.2.48 php-src/sapi/cgi/cgi_main.c:1.267.2.15.2.49 --- php-src/sapi/cgi/cgi_main.c:1.267.2.15.2.48 Wed Sep 5 08:26:32 2007 +++ php-src/sapi/cgi/cgi_main.c Mon Sep 10 10:55:26 2007 @@ -21,7 +21,7 @@ +--+ */ -/* $Id: cgi_main.c,v 1.267.2.15.2.48 2007/09/05 08:26:32 dmitry Exp $ */ +/* $Id: cgi_main.c,v 1.267.2.15.2.49 2007/09/10 10:55:26 dmitry Exp $ */ #include php.h #include php_globals.h @@ -777,6 +777,7 @@ struct stat st; char *env_redirect_url = sapi_cgibin_getenv(REDIRECT_URL, sizeof(REDIRECT_URL)-1 TSRMLS_CC); char *env_document_root = sapi_cgibin_getenv(DOCUMENT_ROOT, sizeof(DOCUMENT_ROOT)-1 TSRMLS_CC); + int script_path_translated_len; /* Hack for buggy IIS that sets incorrect PATH_INFO */ char *env_server_software = sapi_cgibin_getenv(SERVER_SOFTWARE, sizeof(SERVER_SOFTWARE)-1 TSRMLS_CC); @@ -829,9 +830,11 @@ * this fixes url's like /info.php/test */ if (script_path_translated - (real_path = tsrm_realpath(script_path_translated, NULL TSRMLS_CC)) == NULL) { - char *pt = estrdup(script_path_translated); - int len = strlen(pt); + (script_path_translated_len = strlen(script_path_translated)) 0 + (script_path_translated[script_path_translated_len-1] == '/' || +(real_path = tsrm_realpath(script_path_translated, NULL TSRMLS_CC)) == NULL)) { + char *pt = estrndup(script_path_translated, script_path_translated_len); + int len = script_path_translated_len; char *ptr; while ((ptr = strrchr(pt, '/')) || (ptr = strrchr(pt, '\\'))) { @@ -971,9 +974,6 @@ SG(request_info).path_translated = estrdup(script_path_translated); } } else { - if (real_path) { - script_path_translated = real_path; - } /* make sure path_info/translated are empty */ if (!orig_script_filename || (script_path_translated != orig_script_filename @@ -1006,9 +1006,7 @@ if (script_path_translated !strstr(script_path_translated, ..)) { SG(request_info).path_translated = estrdup(script_path_translated); } - if (real_path) { - free(real_path); - } + free(real_path); } } else { #endif -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /sapi/cgi cgi_main.c
dmitry Mon Sep 10 10:55:41 2007 UTC Modified files: /php-src/sapi/cgi cgi_main.c Log: Fixed bug #42587 (behaviour change regarding symlinked .php files) http://cvs.php.net/viewvc.cgi/php-src/sapi/cgi/cgi_main.c?r1=1.333r2=1.334diff_format=u Index: php-src/sapi/cgi/cgi_main.c diff -u php-src/sapi/cgi/cgi_main.c:1.333 php-src/sapi/cgi/cgi_main.c:1.334 --- php-src/sapi/cgi/cgi_main.c:1.333 Sat Sep 8 11:10:37 2007 +++ php-src/sapi/cgi/cgi_main.c Mon Sep 10 10:55:41 2007 @@ -21,7 +21,7 @@ +--+ */ -/* $Id: cgi_main.c,v 1.333 2007/09/08 11:10:37 tony2001 Exp $ */ +/* $Id: cgi_main.c,v 1.334 2007/09/10 10:55:41 dmitry Exp $ */ #include php.h #include php_globals.h @@ -775,6 +775,7 @@ char *orig_path_info = env_path_info; char *orig_script_name = env_script_name; char *orig_script_filename = env_script_filename; + int script_path_translated_len; if (!env_document_root PG(doc_root)) { env_document_root = _sapi_cgibin_putenv(DOCUMENT_ROOT, PG(doc_root) TSRMLS_CC); @@ -805,9 +806,11 @@ * this fixes url's like /info.php/test */ if (script_path_translated - (real_path = tsrm_realpath(script_path_translated, NULL TSRMLS_CC)) == NULL) { - char *pt = estrdup(script_path_translated); - int len = strlen(pt); + (script_path_translated_len = strlen(script_path_translated)) 0 + (script_path_translated[script_path_translated_len-1] == '/' || +(real_path = tsrm_realpath(script_path_translated, NULL TSRMLS_CC)) == NULL)) { + char *pt = estrndup(script_path_translated, script_path_translated_len); + int len = script_path_translated_len; char *ptr; while ((ptr = strrchr(pt, '/')) || (ptr = strrchr(pt, '\\'))) { @@ -947,9 +950,6 @@ SG(request_info).path_translated = estrdup(script_path_translated); } } else { - if (real_path) { - script_path_translated = real_path; - } /* make sure path_info/translated are empty */ if (!orig_script_filename || (script_path_translated != orig_script_filename @@ -982,9 +982,7 @@ if (script_path_translated !strstr(script_path_translated, ..)) { SG(request_info).path_translated = estrdup(script_path_translated); } - if (real_path) { - free(real_path); - } + free(real_path); } } else { /* pre 4.3 behaviour, shouldn't be used but provides BC */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/reflection php_reflection.c
dmitry Tue Sep 11 11:16:46 2007 UTC Modified files: /php-src/ext/reflection php_reflection.c Log: Simplify (the prototype of zend_u_get_constant_ex() is going to be changed) http://cvs.php.net/viewvc.cgi/php-src/ext/reflection/php_reflection.c?r1=1.282r2=1.283diff_format=u Index: php-src/ext/reflection/php_reflection.c diff -u php-src/ext/reflection/php_reflection.c:1.282 php-src/ext/reflection/php_reflection.c:1.283 --- php-src/ext/reflection/php_reflection.c:1.282 Mon Aug 20 17:01:59 2007 +++ php-src/ext/reflection/php_reflection.c Tue Sep 11 11:16:46 2007 @@ -20,7 +20,7 @@ +--+ */ -/* $Id: php_reflection.c,v 1.282 2007/08/20 17:01:59 sebastian Exp $ */ +/* $Id: php_reflection.c,v 1.283 2007/09/11 11:16:46 dmitry Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -2058,7 +2058,7 @@ return; } pce= ce-parent; - } else if (zend_u_lookup_class_ex(UG(unicode)?IS_UNICODE:IS_STRING, param-arg_info-class_name, param-arg_info-class_name_len, 1, 1, pce TSRMLS_CC) == FAILURE) { + } else if (zend_u_lookup_class(UG(unicode)?IS_UNICODE:IS_STRING, param-arg_info-class_name, param-arg_info-class_name_len, pce TSRMLS_CC) == FAILURE) { zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, Class %v does not exist, param-arg_info-class_name); return; @@ -5022,7 +5022,7 @@ php_info_print_table_start(); php_info_print_table_header(2, Reflection, enabled); - php_info_print_table_row(2, Version, $Id: php_reflection.c,v 1.282 2007/08/20 17:01:59 sebastian Exp $); + php_info_print_table_row(2, Version, $Id: php_reflection.c,v 1.283 2007/09/11 11:16:46 dmitry Exp $); php_info_print_table_end(); } /* }}} */ -- 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 dir.c
It seems you've broken ext/standard/tests/file/bug41655_1.phpt Thanks. Dmitry. -Original Message- From: Ilia Alshanetsky [mailto:[EMAIL PROTECTED] Sent: Thursday, September 20, 2007 2:40 AM To: php-cvs@lists.php.net Subject: [PHP-CVS] cvs: php-src /ext/standard dir.c iliaa Wed Sep 19 22:40:02 2007 UTC Modified files: /php-src/ext/standard dir.c Log: MFB: Fixed regression in glob() when enforcing safe_mode/open_basedir checks on paths containing '*' http://cvs.php.net/viewvc.cgi/php-src/ext/standard/dir.c?r1=1. 169r2=1.170diff_format=u Index: php-src/ext/standard/dir.c diff -u php-src/ext/standard/dir.c:1.169 php-src/ext/standard/dir.c:1.170 --- php-src/ext/standard/dir.c:1.169 Wed Sep 5 12:55:36 2007 +++ php-src/ext/standard/dir.cWed Sep 19 22:40:02 2007 @@ -16,7 +16,7 @@ +- -+ */ -/* $Id: dir.c,v 1.169 2007/09/05 12:55:36 iliaa Exp $ */ +/* $Id: dir.c,v 1.170 2007/09/19 22:40:02 iliaa Exp $ */ /* {{{ includes/startup/misc */ @@ -421,6 +421,7 @@ glob_t globbuf; unsigned int n; int ret; + zend_bool basedir_limit = 0; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, Z|l, pppattern, flags) == FAILURE || php_stream_path_param_encode(pppattern, pattern, pattern_len, REPORT_ERRORS, FG(default_context)) == FAILURE) { @@ -455,18 +456,6 @@ } #endif - if (PG(open_basedir) *PG(open_basedir)) { - int pattern_len = strlen(pattern); - char *basename = estrndup(pattern, pattern_len); - - php_dirname(basename, pattern_len); - if (php_check_open_basedir(basename TSRMLS_CC)) { - efree(basename); - RETURN_FALSE; - } - efree(basename); - } - memset(globbuf, 0, sizeof(glob_t)); globbuf.gl_offs = 0; if (0 != (ret = glob(pattern, flags GLOB_FLAGMASK, NULL, globbuf))) { @@ -480,8 +469,7 @@ can be used for simple glob() calls without further error checking. */ - array_init(return_value); - return; + goto no_results; } #endif RETURN_FALSE; @@ -489,12 +477,26 @@ /* now catch the FreeBSD style of no matches */ if (!globbuf.gl_pathc || !globbuf.gl_pathv) { +no_results: + if (PG(open_basedir) *PG(open_basedir)) { + struct stat s; + + if (0 != VCWD_STAT(pattern, s) || S_IFDIR != (s.st_mode S_IFMT)) { + RETURN_FALSE; + } + } array_init(return_value); return; } array_init(return_value); for (n = 0; n globbuf.gl_pathc; n++) { + if (PG(open_basedir) *PG(open_basedir)) { + if (php_check_open_basedir_ex(globbuf.gl_pathv[n], 0 TSRMLS_CC)) { + basedir_limit = 1; + continue; + } + } /* we need to do this everytime since GLOB_ONLYDIR does not guarantee that * all directories will be filtered. GNU libc documentation states the * following: @@ -531,6 +533,11 @@ } globfree(globbuf); + + if (basedir_limit !zend_hash_num_elements(Z_ARRVAL_P(return_value))) { + zval_dtor(return_value); + RETURN_FALSE; + } } /* }}} */ #endif -- 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(PHP_5_2) / NEWS /ext/standard array.c
dmitry Thu Sep 20 09:23:00 2007 UTC Modified files: (Branch: PHP_5_2) /php-srcNEWS /php-src/ext/standard array.c Log: Improved speed of array_intersect_key(), array_intersect_assoc() and array_uintersect_assoc(). (100 times faster on arrays with 10 elements) http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.957r2=1.2027.2.547.2.958diff_format=u Index: php-src/NEWS diff -u php-src/NEWS:1.2027.2.547.2.957 php-src/NEWS:1.2027.2.547.2.958 --- php-src/NEWS:1.2027.2.547.2.957 Wed Sep 19 22:37:58 2007 +++ php-src/NEWSThu Sep 20 09:22:59 2007 @@ -5,6 +5,9 @@ - Added optional parameter $provide_object to debug_backtrace(). (Sebastian) - Added alpha support for imagefilter() IMG_FILTER_COLORIZE. (Pierre) +- Improved speed of array_intersect_key(), array_intersect_assoc() and + array_uintersect_assoc(). (Dmitry) + - Fixed regression in glob() when enforcing safe_mode/open_basedir checks on paths containing '*'. (Ilia) - Fixed mail.force_extra_parameters php.ini directive not to be modifiable http://cvs.php.net/viewvc.cgi/php-src/ext/standard/array.c?r1=1.308.2.21.2.32r2=1.308.2.21.2.33diff_format=u Index: php-src/ext/standard/array.c diff -u php-src/ext/standard/array.c:1.308.2.21.2.32 php-src/ext/standard/array.c:1.308.2.21.2.33 --- php-src/ext/standard/array.c:1.308.2.21.2.32Fri Aug 10 12:17:26 2007 +++ php-src/ext/standard/array.cThu Sep 20 09:22:59 2007 @@ -21,7 +21,7 @@ +--+ */ -/* $Id: array.c,v 1.308.2.21.2.32 2007/08/10 12:17:26 jani Exp $ */ +/* $Id: array.c,v 1.308.2.21.2.33 2007/09/20 09:22:59 dmitry Exp $ */ #include php.h #include php_ini.h @@ -86,6 +86,7 @@ #define INTERSECT_NORMAL 1 #define INTERSECT_KEY 2 #define INTERSECT_ASSOC6 +#define INTERSECT_COMP_DATA_NONE-1 #define INTERSECT_COMP_DATA_INTERNAL 0 #define INTERSECT_COMP_DATA_USER 1 #define INTERSECT_COMP_KEY_INTERNAL 0 @@ -2869,6 +2870,149 @@ } /* }}} */ +static int zval_compare(zval **a, zval **b TSRMLS_DC) /* {{{ */ +{ + zval result; + zval *first; + zval *second; + + first = *((zval **) a); + second = *((zval **) b); + + if (string_compare_function(result, first, second TSRMLS_CC) == FAILURE) { + return 0; + } + + if (Z_TYPE(result) == IS_DOUBLE) { + if (Z_DVAL(result) 0) { + return -1; + } else if (Z_DVAL(result) 0) { + return 1; + } else { + return 0; + } + } + + convert_to_long(result); + + if (Z_LVAL(result) 0) { + return -1; + } else if (Z_LVAL(result) 0) { + return 1; + } + + return 0; +} +/* }}} */ + +static int zval_user_compare(zval **a, zval **b TSRMLS_DC) /* {{{ */ +{ + zval **args[2]; + zval *retval_ptr; + zend_fcall_info fci; + + args[0] = (zval **) a; + args[1] = (zval **) b; + + fci.size = sizeof(fci); + fci.function_table = EG(function_table); + fci.function_name = *BG(user_compare_func_name); + fci.symbol_table = NULL; + fci.object_pp = NULL; + fci.retval_ptr_ptr = retval_ptr; + fci.param_count = 2; + fci.params = args; + fci.no_separation = 0; + + if (zend_call_function(fci, BG(user_compare_fci_cache) TSRMLS_CC)== SUCCESS +retval_ptr) { + long retval; + + convert_to_long_ex(retval_ptr); + retval = Z_LVAL_P(retval_ptr); + zval_ptr_dtor(retval_ptr); + return retval 0 ? -1 : retval 0 ? 1 : 0;; + } else { + return 0; + } +} +/* }}} */ + +static void php_array_intersect_key(INTERNAL_FUNCTION_PARAMETERS, int data_compare_type) /* {{{ */ +{ + Bucket *p; + int argc, i; + zval ***args; + int (*intersect_data_compare_func)(zval **, zval ** TSRMLS_DC) = NULL; + zend_bool ok; + zval **data; + + /* Get the argument count */ + argc = ZEND_NUM_ARGS(); + /* Allocate arguments array and get the arguments, checking for errors. */ + args = (zval ***)safe_emalloc(argc, sizeof(zval **), 0); + if (argc 2 || zend_get_parameters_array_ex(argc, args) == FAILURE) { + efree(args); + WRONG_PARAM_COUNT; + } + if (data_compare_type == INTERSECT_COMP_DATA_USER) { + char *callback_name; + + if (argc 3) { + efree(args); + WRONG_PARAM_COUNT; + } + argc--; + if (!zend_is_callable(*args[argc], 0, callback_name)) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, Not a valid callback %s, callback_name); +
[PHP-CVS] cvs: php-src /ext/standard array.c
dmitry Thu Sep 20 09:23:11 2007 UTC Modified files: /php-src/ext/standard array.c Log: Improved speed of array_intersect_key(), array_intersect_assoc() and array_uintersect_assoc(). (100 times faster on arrays with 10 elements) http://cvs.php.net/viewvc.cgi/php-src/ext/standard/array.c?r1=1.416r2=1.417diff_format=u Index: php-src/ext/standard/array.c diff -u php-src/ext/standard/array.c:1.416 php-src/ext/standard/array.c:1.417 --- php-src/ext/standard/array.c:1.416 Fri Aug 10 13:20:22 2007 +++ php-src/ext/standard/array.cThu Sep 20 09:23:11 2007 @@ -21,7 +21,7 @@ +--+ */ -/* $Id: array.c,v 1.416 2007/08/10 13:20:22 tony2001 Exp $ */ +/* $Id: array.c,v 1.417 2007/09/20 09:23:11 dmitry Exp $ */ #include php.h #include php_ini.h @@ -81,6 +81,7 @@ #define INTERSECT_NORMAL 1 #define INTERSECT_KEY 2 #define INTERSECT_ASSOC6 +#define INTERSECT_COMP_DATA_NONE-1 #define INTERSECT_COMP_DATA_INTERNAL 0 #define INTERSECT_COMP_DATA_USER 1 #define INTERSECT_COMP_KEY_INTERNAL 0 @@ -2919,6 +2920,132 @@ } /* }}} */ +static int zval_compare(zval **a, zval **b TSRMLS_DC) /* {{{ */ +{ + zval result; + zval *first; + zval *second; + + first = *((zval **) a); + second = *((zval **) b); + + if (string_compare_function(result, first, second TSRMLS_CC) == FAILURE) { + return 0; + } + + if (Z_TYPE(result) == IS_DOUBLE) { + if (Z_DVAL(result) 0) { + return -1; + } else if (Z_DVAL(result) 0) { + return 1; + } else { + return 0; + } + } + + convert_to_long(result); + + if (Z_LVAL(result) 0) { + return -1; + } else if (Z_LVAL(result) 0) { + return 1; + } + + return 0; +} +/* }}} */ + +static int zval_user_compare(zval **a, zval **b TSRMLS_DC) /* {{{ */ +{ + zval **args[2]; + zval *retval_ptr; + + args[0] = (zval **) a; + args[1] = (zval **) b; + + BG(user_compare_fci).param_count = 2; + BG(user_compare_fci).params = args; + BG(user_compare_fci).retval_ptr_ptr = retval_ptr; + BG(user_compare_fci).no_separation = 0; + if (zend_call_function(BG(user_compare_fci), BG(user_compare_fci_cache) TSRMLS_CC)== SUCCESS +retval_ptr) { + long retval; + + convert_to_long_ex(retval_ptr); + retval = Z_LVAL_P(retval_ptr); + zval_ptr_dtor(retval_ptr); + return retval 0 ? -1 : retval 0 ? 1 : 0;; + } else { + return 0; + } +} +/* }}} */ + +static void php_array_intersect_key(INTERNAL_FUNCTION_PARAMETERS, int data_compare_type) /* {{{ */ +{ + Bucket *p; + int argc, i; + zval ***args; + int (*intersect_data_compare_func)(zval **, zval ** TSRMLS_DC) = NULL; + zend_bool ok; + zval **data; + + /* Get the argument count */ + argc = ZEND_NUM_ARGS(); + if (data_compare_type == INTERSECT_COMP_DATA_USER) { + if (argc 3 || + zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, +f, args, +argc, BG(user_compare_fci), BG(user_compare_fci_cache)) == FAILURE) { + return; + } + intersect_data_compare_func = zval_user_compare; + } else { + if (argc 2 || + zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, +, args, argc) == FAILURE) { + return; + } + if (data_compare_type == INTERSECT_COMP_DATA_INTERNAL) { + intersect_data_compare_func = zval_compare; + } + } + + array_init(return_value); + + for (p = Z_ARRVAL_PP(args[0])-pListHead; p != NULL; p = p-pListNext) { + if (p-nKeyLength == 0) { + ok = 1; + for (i = 1; i argc; i++) { + if (zend_hash_index_find(Z_ARRVAL_PP(args[i]), p-h, (void**)data) == FAILURE || + (intersect_data_compare_func + intersect_data_compare_func((zval**)p-pData, data TSRMLS_CC) != 0)) { + ok = 0; + break; + } + } + if (ok) { + (*((zval**)p-pData))-refcount++; + zend_hash_index_update(Z_ARRVAL_P(return_value), p-h, p-pData, sizeof(zval*), NULL); + } + } else { + ok = 1; + for (i = 1; i
[PHP-CVS] cvs: php-src(PHP_5_2) / NEWS /ext/standard array.c
dmitry Fri Sep 21 13:11:00 2007 UTC Modified files: (Branch: PHP_5_2) /php-srcNEWS /php-src/ext/standard array.c Log: Improved speed of array_diff_key(), array_diff_assoc() and array_udiff_assoc(). http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.959r2=1.2027.2.547.2.960diff_format=u Index: php-src/NEWS diff -u php-src/NEWS:1.2027.2.547.2.959 php-src/NEWS:1.2027.2.547.2.960 --- php-src/NEWS:1.2027.2.547.2.959 Thu Sep 20 09:32:31 2007 +++ php-src/NEWSFri Sep 21 13:10:59 2007 @@ -5,8 +5,9 @@ - Added optional parameter $provide_object to debug_backtrace(). (Sebastian) - Added alpha support for imagefilter() IMG_FILTER_COLORIZE. (Pierre) -- Improved speed of array_intersect_key(), array_intersect_assoc() and - array_uintersect_assoc(). (Dmitry) +- Improved speed of array_intersect_key(), array_intersect_assoc(), + array_uintersect_assoc(), array_diff_key(), array_diff_assoc() and + array_udiff_assoc(). (Dmitry) - Fixed regression in glob() when enforcing safe_mode/open_basedir checks on paths containing '*'. (Ilia) http://cvs.php.net/viewvc.cgi/php-src/ext/standard/array.c?r1=1.308.2.21.2.33r2=1.308.2.21.2.34diff_format=u Index: php-src/ext/standard/array.c diff -u php-src/ext/standard/array.c:1.308.2.21.2.33 php-src/ext/standard/array.c:1.308.2.21.2.34 --- php-src/ext/standard/array.c:1.308.2.21.2.33Thu Sep 20 09:22:59 2007 +++ php-src/ext/standard/array.cFri Sep 21 13:10:59 2007 @@ -21,7 +21,7 @@ +--+ */ -/* $Id: array.c,v 1.308.2.21.2.33 2007/09/20 09:22:59 dmitry Exp $ */ +/* $Id: array.c,v 1.308.2.21.2.34 2007/09/21 13:10:59 dmitry Exp $ */ #include php.h #include php_ini.h @@ -78,6 +78,7 @@ #define DIFF_NORMAL1 #define DIFF_KEY 2 #define DIFF_ASSOC 6 +#define DIFF_COMP_DATA_NONE-1 #define DIFF_COMP_DATA_INTERNAL 0 #define DIFF_COMP_DATA_USER 1 #define DIFF_COMP_KEY_INTERNAL 0 @@ -3394,6 +3395,81 @@ } /* }}} */ +static void php_array_diff_key(INTERNAL_FUNCTION_PARAMETERS, int data_compare_type) /* {{{ */ +{ + Bucket *p; + int argc, i; + zval ***args; + int (*diff_data_compare_func)(zval **, zval ** TSRMLS_DC) = NULL; + zend_bool ok; + zval **data; + + /* Get the argument count */ + argc = ZEND_NUM_ARGS(); + /* Allocate arguments array and get the arguments, checking for errors. */ + args = (zval ***)safe_emalloc(argc, sizeof(zval **), 0); + if (argc 2 || zend_get_parameters_array_ex(argc, args) == FAILURE) { + efree(args); + WRONG_PARAM_COUNT; + } + if (data_compare_type == DIFF_COMP_DATA_USER) { + char *callback_name; + + if (argc 3) { + efree(args); + WRONG_PARAM_COUNT; + } + argc--; + if (!zend_is_callable(*args[argc], 0, callback_name)) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, Not a valid callback %s, callback_name); + efree(callback_name); + efree(args); + return; + } + efree(callback_name); + diff_data_compare_func = zval_user_compare; + BG(user_compare_func_name) = args[argc]; + } else if (data_compare_type == DIFF_COMP_DATA_INTERNAL) { + diff_data_compare_func = zval_compare; + } + + array_init(return_value); + + for (p = Z_ARRVAL_PP(args[0])-pListHead; p != NULL; p = p-pListNext) { + if (p-nKeyLength == 0) { + ok = 1; + for (i = 1; i argc; i++) { + if (zend_hash_index_find(Z_ARRVAL_PP(args[i]), p-h, (void**)data) == SUCCESS + (!diff_data_compare_func || +diff_data_compare_func((zval**)p-pData, data TSRMLS_CC) == 0)) { + ok = 0; + break; + } + } + if (ok) { + (*((zval**)p-pData))-refcount++; + zend_hash_index_update(Z_ARRVAL_P(return_value), p-h, p-pData, sizeof(zval*), NULL); + } + } else { + ok = 1; + for (i = 1; i argc; i++) { + if (zend_hash_quick_find(Z_ARRVAL_PP(args[i]), p-arKey, p-nKeyLength, p-h, (void**)data) == SUCCESS + (!diff_data_compare_func || +diff_data_compare_func((zval**)p-pData, data TSRMLS_CC) == 0)) { + ok = 0; +
[PHP-CVS] cvs: php-src /ext/standard array.c
dmitry Fri Sep 21 13:11:16 2007 UTC Modified files: /php-src/ext/standard array.c Log: Improved speed of array_diff_key(), array_diff_assoc() and array_udiff_assoc(). http://cvs.php.net/viewvc.cgi/php-src/ext/standard/array.c?r1=1.417r2=1.418diff_format=u Index: php-src/ext/standard/array.c diff -u php-src/ext/standard/array.c:1.417 php-src/ext/standard/array.c:1.418 --- php-src/ext/standard/array.c:1.417 Thu Sep 20 09:23:11 2007 +++ php-src/ext/standard/array.cFri Sep 21 13:11:16 2007 @@ -21,7 +21,7 @@ +--+ */ -/* $Id: array.c,v 1.417 2007/09/20 09:23:11 dmitry Exp $ */ +/* $Id: array.c,v 1.418 2007/09/21 13:11:16 dmitry Exp $ */ #include php.h #include php_ini.h @@ -73,6 +73,7 @@ #define DIFF_NORMAL1 #define DIFF_KEY 2 #define DIFF_ASSOC 6 +#define DIFF_COMP_DATA_NONE-1 #define DIFF_COMP_DATA_INTERNAL 0 #define DIFF_COMP_DATA_USER 1 #define DIFF_COMP_KEY_INTERNAL 0 @@ -3392,7 +3393,8 @@ Returns the entries of arr1 that have values which are present in all the other arguments. Keys are used to do more restrictive check and they are compared by using an user-supplied callback. */ PHP_FUNCTION(array_intersect_uassoc) { - php_array_intersect_key(INTERNAL_FUNCTION_PARAM_PASSTHRU, INTERSECT_COMP_DATA_USER); + php_array_intersect(INTERNAL_FUNCTION_PARAM_PASSTHRU, INTERSECT_ASSOC, + INTERSECT_COMP_DATA_INTERNAL, INTERSECT_COMP_KEY_USER); } /* }}} */ @@ -3400,8 +3402,7 @@ Returns the entries of arr1 that have values which are present in all the other arguments. Keys are used to do more restrictive check. Data is compared by using an user-supplied callback. */ PHP_FUNCTION(array_uintersect_assoc) { - php_array_intersect(INTERNAL_FUNCTION_PARAM_PASSTHRU, INTERSECT_ASSOC, - INTERSECT_COMP_DATA_USER, INTERSECT_COMP_KEY_INTERNAL); + php_array_intersect_key(INTERNAL_FUNCTION_PARAM_PASSTHRU, INTERSECT_COMP_DATA_USER); } /* }}} */ @@ -3414,6 +3415,71 @@ } /* }}} */ +static void php_array_diff_key(INTERNAL_FUNCTION_PARAMETERS, int data_compare_type) /* {{{ */ +{ + Bucket *p; + int argc, i; + zval ***args; + int (*diff_data_compare_func)(zval **, zval ** TSRMLS_DC) = NULL; + zend_bool ok; + zval **data; + + /* Get the argument count */ + argc = ZEND_NUM_ARGS(); + if (data_compare_type == DIFF_COMP_DATA_USER) { + if (argc 3 || + zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, +f, args, +argc, BG(user_compare_fci), BG(user_compare_fci_cache)) == FAILURE) { + return; + } + diff_data_compare_func = zval_user_compare; + } else { + if (argc 2 || + zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, +, args, argc) == FAILURE) { + return; + } + if (data_compare_type == DIFF_COMP_DATA_INTERNAL) { + diff_data_compare_func = zval_compare; + } + } + + array_init(return_value); + + for (p = Z_ARRVAL_PP(args[0])-pListHead; p != NULL; p = p-pListNext) { + if (p-nKeyLength == 0) { + ok = 1; + for (i = 1; i argc; i++) { + if (zend_hash_index_find(Z_ARRVAL_PP(args[i]), p-h, (void**)data) == SUCCESS + (!diff_data_compare_func || +diff_data_compare_func((zval**)p-pData, data TSRMLS_CC) == 0)) { + ok = 0; + break; + } + } + if (ok) { + (*((zval**)p-pData))-refcount++; + zend_hash_index_update(Z_ARRVAL_P(return_value), p-h, p-pData, sizeof(zval*), NULL); + } + } else { + ok = 1; + for (i = 1; i argc; i++) { + if (zend_u_hash_quick_find(Z_ARRVAL_PP(args[i]), p-key.type, ZSTR(p-key.arKey.s), p-nKeyLength, p-h, (void**)data) == SUCCESS + (!diff_data_compare_func || +diff_data_compare_func((zval**)p-pData, data TSRMLS_CC) == 0)) { + ok = 0; + break; + } + } + if (ok) { + (*((zval**)p-pData))-refcount++; + zend_u_hash_quick_update(Z_ARRVAL_P(return_value), p-key.type,
[PHP-CVS] cvs: php-src(PHP_5_2) / NEWS /sapi/cgi cgi_main.c
dmitry Mon Sep 24 11:40:06 2007 UTC Modified files: (Branch: PHP_5_2) /php-srcNEWS /php-src/sapi/cgi cgi_main.c Log: Fixed bug #42699 (PHP_SELF duplicates path) http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.961r2=1.2027.2.547.2.962diff_format=u Index: php-src/NEWS diff -u php-src/NEWS:1.2027.2.547.2.961 php-src/NEWS:1.2027.2.547.2.962 --- php-src/NEWS:1.2027.2.547.2.961 Sun Sep 23 15:19:21 2007 +++ php-src/NEWSMon Sep 24 11:40:05 2007 @@ -32,6 +32,7 @@ - Fixed bug #42739 (mkdir() doesnt like a trailing slash when safe_mode is enabled). (Ilia) +- Fixed bug #42699 (PHP_SELF duplicates path). (Dmitry) - Fixed bug #42643 (CLI segfaults if using ATTR_PERSISTENT). (Ilia) - Fixed bug #42629 (Dynamically loaded PHP extensions need symbols exported on MacOSX). (jdolecek at NetBSD dot org) http://cvs.php.net/viewvc.cgi/php-src/sapi/cgi/cgi_main.c?r1=1.267.2.15.2.49r2=1.267.2.15.2.50diff_format=u Index: php-src/sapi/cgi/cgi_main.c diff -u php-src/sapi/cgi/cgi_main.c:1.267.2.15.2.49 php-src/sapi/cgi/cgi_main.c:1.267.2.15.2.50 --- php-src/sapi/cgi/cgi_main.c:1.267.2.15.2.49 Mon Sep 10 10:55:26 2007 +++ php-src/sapi/cgi/cgi_main.c Mon Sep 24 11:40:05 2007 @@ -21,7 +21,7 @@ +--+ */ -/* $Id: cgi_main.c,v 1.267.2.15.2.49 2007/09/10 10:55:26 dmitry Exp $ */ +/* $Id: cgi_main.c,v 1.267.2.15.2.50 2007/09/24 11:40:05 dmitry Exp $ */ #include php.h #include php_globals.h @@ -522,29 +522,44 @@ static void sapi_cgi_register_variables(zval *track_vars_array TSRMLS_DC) { - char *script_name = SG(request_info).request_uri; - unsigned int script_name_len = script_name ? strlen(script_name) : 0; - char *path_info = sapi_cgibin_getenv(PATH_INFO, sizeof(PATH_INFO)-1 TSRMLS_CC); - unsigned int path_info_len = path_info ? strlen(path_info) : 0; - unsigned int php_self_len = script_name_len + path_info_len; - char *php_self = emalloc(php_self_len + 1); - - if (script_name) { - memcpy(php_self, script_name, script_name_len + 1); - } - if (path_info) { - memcpy(php_self + script_name_len, path_info, path_info_len + 1); - } + unsigned int php_self_len; + char *php_self; /* In CGI mode, we consider the environment to be a part of the server * variables */ php_import_environment_variables(track_vars_array TSRMLS_CC); - /* Build the special-case PHP_SELF variable for the CGI version */ + +#if ENABLE_PATHINFO_CHECK + if (CGIG(fix_pathinfo)) { + char *script_name = SG(request_info).request_uri; + unsigned int script_name_len = script_name ? strlen(script_name) : 0; + char *path_info = sapi_cgibin_getenv(PATH_INFO, sizeof(PATH_INFO)-1 TSRMLS_CC); + unsigned int path_info_len = path_info ? strlen(path_info) : 0; + + php_self_len = script_name_len + path_info_len; + php_self = emalloc(php_self_len + 1); + if (script_name) { + memcpy(php_self, script_name, script_name_len + 1); + } + if (path_info) { + memcpy(php_self + script_name_len, path_info, path_info_len + 1); + } + + /* Build the special-case PHP_SELF variable for the CGI version */ + if (sapi_module.input_filter(PARSE_SERVER, PHP_SELF, php_self, php_self_len, php_self_len TSRMLS_CC)) { + php_register_variable_safe(PHP_SELF, php_self, php_self_len, track_vars_array TSRMLS_CC); + } + efree(php_self); + return; + } +#endif + + php_self = SG(request_info).request_uri ? SG(request_info).request_uri : ; + php_self_len = strlen(php_self); if (sapi_module.input_filter(PARSE_SERVER, PHP_SELF, php_self, php_self_len, php_self_len TSRMLS_CC)) { php_register_variable_safe(PHP_SELF, php_self, php_self_len, track_vars_array TSRMLS_CC); } - efree(php_self); } static void sapi_cgi_log_message(char *message) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /sapi/cgi cgi_main.c
dmitry Mon Sep 24 11:43:02 2007 UTC Modified files: /php-src/sapi/cgi cgi_main.c Log: Fixed bug #42699 (PHP_SELF duplicates path) http://cvs.php.net/viewvc.cgi/php-src/sapi/cgi/cgi_main.c?r1=1.334r2=1.335diff_format=u Index: php-src/sapi/cgi/cgi_main.c diff -u php-src/sapi/cgi/cgi_main.c:1.334 php-src/sapi/cgi/cgi_main.c:1.335 --- php-src/sapi/cgi/cgi_main.c:1.334 Mon Sep 10 10:55:41 2007 +++ php-src/sapi/cgi/cgi_main.c Mon Sep 24 11:43:02 2007 @@ -21,7 +21,7 @@ +--+ */ -/* $Id: cgi_main.c,v 1.334 2007/09/10 10:55:41 dmitry Exp $ */ +/* $Id: cgi_main.c,v 1.335 2007/09/24 11:43:02 dmitry Exp $ */ #include php.h #include php_globals.h @@ -498,29 +498,42 @@ static void sapi_cgi_register_variables(zval *track_vars_array TSRMLS_DC) { - char *script_name = SG(request_info).request_uri; - unsigned int script_name_len = script_name ? strlen(script_name) : 0; - char *path_info = sapi_cgibin_getenv(PATH_INFO, sizeof(PATH_INFO)-1 TSRMLS_CC); - unsigned int path_info_len = path_info ? strlen(path_info) : 0; - unsigned int php_self_len = script_name_len + path_info_len; - char *php_self = emalloc(php_self_len + 1); - - if (script_name) { - memcpy(php_self, script_name, script_name_len + 1); - } - if (path_info) { - memcpy(php_self + script_name_len, path_info, path_info_len + 1); - } + unsigned int php_self_len; + char *php_self; /* In CGI mode, we consider the environment to be a part of the server * variables */ php_import_environment_variables(track_vars_array TSRMLS_CC); - /* Build the special-case PHP_SELF variable for the CGI version */ - if (sapi_module.input_filter(PARSE_SERVER, PHP_SELF, php_self, php_self_len, php_self_len TSRMLS_CC)) { - php_register_variable_safe(PHP_SELF, php_self, php_self_len, track_vars_array TSRMLS_CC); + + if (CGIG(fix_pathinfo)) { + char *script_name = SG(request_info).request_uri; + unsigned int script_name_len = script_name ? strlen(script_name) : 0; + char *path_info = sapi_cgibin_getenv(PATH_INFO, sizeof(PATH_INFO)-1 TSRMLS_CC); + unsigned int path_info_len = path_info ? strlen(path_info) : 0; + + php_self_len = script_name_len + path_info_len; + php_self = emalloc(php_self_len + 1); + + if (script_name) { + memcpy(php_self, script_name, script_name_len + 1); + } + if (path_info) { + memcpy(php_self + script_name_len, path_info, path_info_len + 1); + } + + /* Build the special-case PHP_SELF variable for the CGI version */ + if (sapi_module.input_filter(PARSE_SERVER, PHP_SELF, php_self, php_self_len, php_self_len TSRMLS_CC)) { + php_register_variable_safe(PHP_SELF, php_self, php_self_len, track_vars_array TSRMLS_CC); + } + efree(php_self); + } else { + php_self = SG(request_info).request_uri ? SG(request_info).request_uri : ; + php_self_len = strlen(php_self); + if (sapi_module.input_filter(PARSE_SERVER, PHP_SELF, php_self, php_self_len, php_self_len TSRMLS_CC)) { + php_register_variable_safe(PHP_SELF, php_self, php_self_len, track_vars_array TSRMLS_CC); + } } - efree(php_self); } static void sapi_cgi_log_message(char *message) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_2) /main main.c
dmitry Mon Sep 24 11:53:40 2007 UTC Modified files: (Branch: PHP_5_2) /php-src/main main.c Log: Fixed crash on POST request after dl(mbstring.so) http://cvs.php.net/viewvc.cgi/php-src/main/main.c?r1=1.640.2.23.2.56r2=1.640.2.23.2.57diff_format=u Index: php-src/main/main.c diff -u php-src/main/main.c:1.640.2.23.2.56 php-src/main/main.c:1.640.2.23.2.57 --- php-src/main/main.c:1.640.2.23.2.56 Fri Sep 21 14:12:52 2007 +++ php-src/main/main.c Mon Sep 24 11:53:40 2007 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: main.c,v 1.640.2.23.2.56 2007/09/21 14:12:52 tony2001 Exp $ */ +/* $Id: main.c,v 1.640.2.23.2.57 2007/09/24 11:53:40 dmitry Exp $ */ /* {{{ includes */ @@ -1299,6 +1299,8 @@ retval = FAILURE; } zend_end_try(); + SG(sapi_started) = 1; + return retval; } # else -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /main main.c
dmitry Mon Sep 24 11:53:57 2007 UTC Modified files: /php-src/main main.c Log: Fixed crash on POST request after dl(mbstring.so) http://cvs.php.net/viewvc.cgi/php-src/main/main.c?r1=1.748r2=1.749diff_format=u Index: php-src/main/main.c diff -u php-src/main/main.c:1.748 php-src/main/main.c:1.749 --- php-src/main/main.c:1.748 Fri Sep 21 14:11:45 2007 +++ php-src/main/main.c Mon Sep 24 11:53:57 2007 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: main.c,v 1.748 2007/09/21 14:11:45 tony2001 Exp $ */ +/* $Id: main.c,v 1.749 2007/09/24 11:53:57 dmitry Exp $ */ /* {{{ includes */ @@ -1407,6 +1407,8 @@ retval = FAILURE; } zend_end_try(); + SG(sapi_started) = 1; + return retval; } # else -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /sapi/cgi cgi_main.c
dmitry Thu Sep 27 07:29:58 2007 UTC Modified files: /php-src/sapi/cgi cgi_main.c Log: ws http://cvs.php.net/viewvc.cgi/php-src/sapi/cgi/cgi_main.c?r1=1.335r2=1.336diff_format=u Index: php-src/sapi/cgi/cgi_main.c diff -u php-src/sapi/cgi/cgi_main.c:1.335 php-src/sapi/cgi/cgi_main.c:1.336 --- php-src/sapi/cgi/cgi_main.c:1.335 Mon Sep 24 11:43:02 2007 +++ php-src/sapi/cgi/cgi_main.c Thu Sep 27 07:29:58 2007 @@ -21,7 +21,7 @@ +--+ */ -/* $Id: cgi_main.c,v 1.335 2007/09/24 11:43:02 dmitry Exp $ */ +/* $Id: cgi_main.c,v 1.336 2007/09/27 07:29:58 dmitry Exp $ */ #include php.h #include php_globals.h @@ -148,8 +148,8 @@ zend_bool fix_pathinfo; zend_bool force_redirect; zend_bool discard_path; - char *redirect_status_env; zend_bool fcgi_logging; + char *redirect_status_env; #ifdef PHP_WIN32 zend_bool impersonate; #endif @@ -283,7 +283,7 @@ fcgi_request *request = (fcgi_request*) server_context; if ( #ifndef PHP_WIN32 - !parent + !parent #endif request !fcgi_flush(request, 0)) { php_handle_aborted_connection(); @@ -420,7 +420,7 @@ #if !HAVE_SETENV || !HAVE_UNSETENV /* if cgi, or fastcgi and not found in fcgi env - check the regular environment + check the regular environment this leaks, but it's only cgi anyway, we'll fix it for 5.0 */ @@ -457,19 +457,19 @@ Z_TYPE_P(PG(http_globals)[TRACK_VARS_ENV]) == IS_ARRAY zend_hash_num_elements(Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_ENV])) 0) { zval_dtor(array_ptr); - *array_ptr = *PG(http_globals)[TRACK_VARS_ENV]; - INIT_PZVAL(array_ptr); - zval_copy_ctor(array_ptr); - return; + *array_ptr = *PG(http_globals)[TRACK_VARS_ENV]; + INIT_PZVAL(array_ptr); + zval_copy_ctor(array_ptr); + return; } else if (PG(http_globals)[TRACK_VARS_SERVER] - array_ptr != PG(http_globals)[TRACK_VARS_SERVER] - Z_TYPE_P(PG(http_globals)[TRACK_VARS_SERVER]) == IS_ARRAY - zend_hash_num_elements(Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_SERVER])) 0) { + array_ptr != PG(http_globals)[TRACK_VARS_SERVER] + Z_TYPE_P(PG(http_globals)[TRACK_VARS_SERVER]) == IS_ARRAY + zend_hash_num_elements(Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_SERVER])) 0) { zval_dtor(array_ptr); - *array_ptr = *PG(http_globals)[TRACK_VARS_SERVER]; - INIT_PZVAL(array_ptr); - zval_copy_ctor(array_ptr); - return; + *array_ptr = *PG(http_globals)[TRACK_VARS_SERVER]; + INIT_PZVAL(array_ptr); + zval_copy_ctor(array_ptr); + return; } /* call php's original import as a catch-all */ @@ -511,7 +511,7 @@ unsigned int script_name_len = script_name ? strlen(script_name) : 0; char *path_info = sapi_cgibin_getenv(PATH_INFO, sizeof(PATH_INFO)-1 TSRMLS_CC); unsigned int path_info_len = path_info ? strlen(path_info) : 0; - + php_self_len = script_name_len + path_info_len; php_self = emalloc(php_self_len + 1); @@ -542,9 +542,9 @@ if (fcgi_is_fastcgi() CGIG(fcgi_logging)) { fcgi_request *request; - + request = (fcgi_request*) SG(server_context); - if (request) { + if (request) { int len = strlen(message); char *buf = malloc(len+2); @@ -565,7 +565,7 @@ { /* flush only when SAPI was started. The reasons are: 1. SAPI Deactivate is called from two places: module init and request shutdown - 2. When the first call occurs and the request is not set up, flush fails on + 2. When the first call occurs and the request is not set up, flush fails on FastCGI. */ if (SG(sapi_started)) { @@ -672,14 +672,14 @@ for: PATH_INFO - derived from the portion of the URI path following + derived from the portion of the URI path following the script name but preceding any query data may be empty PATH_TRANSLATED -derived by taking any path-info component of the - request URI and performing any virtual-to-physical - translation appropriate to map it onto the server's +derived by taking any path-info component of the + request URI and performing any virtual-to-physical + translation appropriate to map it onto the server's document
[PHP-CVS] cvs: php-src(PHP_5_3) / NEWS /sapi/cgi CHANGES cgi_main.c config.w32 config9.m4
dmitry Thu Sep 27 08:23:59 2007 UTC Added files: (Branch: PHP_5_3) /php-src/sapi/cgi CHANGES Modified files: /php-srcNEWS /php-src/sapi/cgi cgi_main.c config.w32 config9.m4 Log: MFH: Improved and cleaned CGI code. FastCGI is now always enabled and can not be disabled. See sapi/cgi/CHANGES for more details. http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.965.2.1r2=1.2027.2.547.2.965.2.2diff_format=u Index: php-src/NEWS diff -u php-src/NEWS:1.2027.2.547.2.965.2.1 php-src/NEWS:1.2027.2.547.2.965.2.2 --- php-src/NEWS:1.2027.2.547.2.965.2.1 Thu Sep 27 00:32:40 2007 +++ php-src/NEWSThu Sep 27 08:23:58 2007 @@ -1,6 +1,8 @@ PHPNEWS ||| ?? ??? 20??, PHP 5.3.0 +- Improved and cleaned CGI code. FastCGI is now always enabled and can not be + disabled. See sapi/cgi/CHANGES for more details. (Dmitry) - Added support for dynamic access of static members using $foo::myFunc(). (Etienne Kneuss) http://cvs.php.net/viewvc.cgi/php-src/sapi/cgi/cgi_main.c?r1=1.267.2.15.2.50r2=1.267.2.15.2.50.2.1diff_format=u Index: php-src/sapi/cgi/cgi_main.c diff -u php-src/sapi/cgi/cgi_main.c:1.267.2.15.2.50 php-src/sapi/cgi/cgi_main.c:1.267.2.15.2.50.2.1 --- php-src/sapi/cgi/cgi_main.c:1.267.2.15.2.50 Mon Sep 24 11:40:05 2007 +++ php-src/sapi/cgi/cgi_main.c Thu Sep 27 08:23:58 2007 @@ -21,7 +21,7 @@ +--+ */ -/* $Id: cgi_main.c,v 1.267.2.15.2.50 2007/09/24 11:40:05 dmitry Exp $ */ +/* $Id: cgi_main.c,v 1.267.2.15.2.50.2.1 2007/09/27 08:23:58 dmitry Exp $ */ #include php.h #include php_globals.h @@ -80,7 +80,6 @@ #include php_getopt.h -#if PHP_FASTCGI #include fastcgi.h #ifndef PHP_WIN32 @@ -109,8 +108,6 @@ static pid_t pgroup; #endif -#endif - #define PHP_MODE_STANDARD 1 #define PHP_MODE_HIGHLIGHT 2 #define PHP_MODE_INDENT3 @@ -148,18 +145,13 @@ zend_bool rfc2616_headers; zend_bool nph; zend_bool check_shebang_line; -#if ENABLE_PATHINFO_CHECK zend_bool fix_pathinfo; -#endif -#if FORCE_CGI_REDIRECT zend_bool force_redirect; - char *redirect_status_env; -#endif -#if PHP_FASTCGI + zend_bool discard_path; zend_bool fcgi_logging; -# ifdef PHP_WIN32 + char *redirect_status_env; +#ifdef PHP_WIN32 zend_bool impersonate; -# endif #endif } php_cgi_globals_struct; @@ -246,7 +238,6 @@ size_t ret; #endif -#if PHP_FASTCGI if (fcgi_is_fastcgi()) { fcgi_request *request = (fcgi_request*) SG(server_context); long ret = fcgi_write(request, FCGI_STDOUT, str, str_length); @@ -255,7 +246,7 @@ } return ret; } -#endif + #ifdef PHP_WRITE_STDOUT ret = write(STDOUT_FILENO, str, str_length); if (ret = 0) return 0; @@ -288,19 +279,17 @@ static void sapi_cgibin_flush(void *server_context) { -#if PHP_FASTCGI if (fcgi_is_fastcgi()) { fcgi_request *request = (fcgi_request*) server_context; if ( #ifndef PHP_WIN32 - !parent + !parent #endif request !fcgi_flush(request, 0)) { php_handle_aborted_connection(); } return; } -#endif if (fflush(stdout) == EOF) { php_handle_aborted_connection(); } @@ -367,17 +356,12 @@ count_bytes = MIN(count_bytes, (uint) SG(request_info).content_length - SG(read_post_bytes)); while (read_bytes count_bytes) { -#if PHP_FASTCGI if (fcgi_is_fastcgi()) { fcgi_request *request = (fcgi_request*) SG(server_context); tmp_read_bytes = fcgi_read(request, buffer + read_bytes, count_bytes - read_bytes); } else { tmp_read_bytes = read(0, buffer + read_bytes, count_bytes - read_bytes); } -#else - tmp_read_bytes = read(0, buffer + read_bytes, count_bytes - read_bytes); -#endif - if (tmp_read_bytes = 0) { break; } @@ -388,7 +372,6 @@ static char *sapi_cgibin_getenv(char *name, size_t name_len TSRMLS_DC) { -#if PHP_FASTCGI /* when php is started by mod_fastcgi, no regular environment is provided to PHP. It is always sent to PHP at the start of a request. So we have to do our own lookup to get env @@ -397,7 +380,6 @@ fcgi_request *request = (fcgi_request*) SG(server_context); return fcgi_getenv(request, name, name_len); } -#endif /* if cgi, or fastcgi and not found in fcgi env check the regular environment */
[PHP-CVS] cvs: php-src(PHP_5_3) / NEWS /ext/openssl openssl.c
dmitry Thu Sep 27 08:46:00 2007 UTC Modified files: (Branch: PHP_5_3) /php-srcNEWS /php-src/ext/opensslopenssl.c Log: MFH: Improved ext/openssl . Added support for OpenSSL digest functions . Added support for OpenSSL cipher functions . Added access to internal values of DSA, RSA and DH keys http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.965.2.2r2=1.2027.2.547.2.965.2.3diff_format=u Index: php-src/NEWS diff -u php-src/NEWS:1.2027.2.547.2.965.2.2 php-src/NEWS:1.2027.2.547.2.965.2.3 --- php-src/NEWS:1.2027.2.547.2.965.2.2 Thu Sep 27 08:23:58 2007 +++ php-src/NEWSThu Sep 27 08:45:59 2007 @@ -1,6 +1,10 @@ PHPNEWS ||| ?? ??? 20??, PHP 5.3.0 +- Improved ext/openssl (Dmitry) + . Added support for OpenSSL digest functions + . Added support for OpenSSL cipher functions + . Added access to internal values of DSA, RSA and DH keys - Improved and cleaned CGI code. FastCGI is now always enabled and can not be disabled. See sapi/cgi/CHANGES for more details. (Dmitry) - Added support for dynamic access of static members using $foo::myFunc(). http://cvs.php.net/viewvc.cgi/php-src/ext/openssl/openssl.c?r1=1.98.2.5.2.41r2=1.98.2.5.2.41.2.1diff_format=u Index: php-src/ext/openssl/openssl.c diff -u php-src/ext/openssl/openssl.c:1.98.2.5.2.41 php-src/ext/openssl/openssl.c:1.98.2.5.2.41.2.1 --- php-src/ext/openssl/openssl.c:1.98.2.5.2.41 Wed Aug 8 06:29:46 2007 +++ php-src/ext/openssl/openssl.c Thu Sep 27 08:46:00 2007 @@ -20,7 +20,7 @@ +--+ */ -/* $Id: openssl.c,v 1.98.2.5.2.41 2007/08/08 06:29:46 pajoye Exp $ */ +/* $Id: openssl.c,v 1.98.2.5.2.41.2.1 2007/09/27 08:46:00 dmitry Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -33,6 +33,8 @@ #include ext/standard/file.h #include ext/standard/info.h #include ext/standard/php_fopen_wrappers.h +#include ext/standard/md5.h +#include ext/standard/base64.h /* OpenSSL includes */ #include openssl/evp.h @@ -88,6 +90,15 @@ PHP_OPENSSL_CIPHER_DEFAULT = PHP_OPENSSL_CIPHER_RC2_40 }; +PHP_FUNCTION(openssl_get_md_methods); +PHP_FUNCTION(openssl_get_cipher_methods); + +PHP_FUNCTION(openssl_digest); +PHP_FUNCTION(openssl_encrypt); +PHP_FUNCTION(openssl_decrypt); + +PHP_FUNCTION(openssl_dh_compute_key); + /* {{{ openssl_functions[] */ zend_function_entry openssl_functions[] = { @@ -126,10 +137,13 @@ PHP_FE(openssl_csr_get_subject, NULL) PHP_FE(openssl_csr_get_public_key, NULL) - PHP_FE(openssl_sign,second_arg_force_ref) - PHP_FE(openssl_verify, NULL) - PHP_FE(openssl_seal,arg2and3_force_ref) - PHP_FE(openssl_open,second_arg_force_ref) + PHP_FE(openssl_digest, NULL) + PHP_FE(openssl_encrypt, NULL) + PHP_FE(openssl_decrypt, NULL) + PHP_FE(openssl_sign,second_arg_force_ref) + PHP_FE(openssl_verify, NULL) + PHP_FE(openssl_seal,arg2and3_force_ref) + PHP_FE(openssl_open,second_arg_force_ref) /* for S/MIME handling */ PHP_FE(openssl_pkcs7_verify,NULL) @@ -142,6 +156,11 @@ PHP_FE(openssl_public_encrypt, second_arg_force_ref) PHP_FE(openssl_public_decrypt, second_arg_force_ref) + PHP_FE(openssl_get_md_methods, NULL) + PHP_FE(openssl_get_cipher_methods, NULL) + + PHP_FE(openssl_dh_compute_key, NULL) + PHP_FE(openssl_error_string, NULL) {NULL, NULL, NULL} }; @@ -645,6 +664,34 @@ return mdtype; } /* }}} */ + +static const EVP_CIPHER * php_openssl_get_evp_cipher_from_algo(long algo) { /* {{{ */ + switch (algo) { +#ifndef OPENSSL_NO_RC2 + case PHP_OPENSSL_CIPHER_RC2_40: + return EVP_rc2_40_cbc(); + break; + case PHP_OPENSSL_CIPHER_RC2_64: + return EVP_rc2_64_cbc(); + break; + case PHP_OPENSSL_CIPHER_RC2_128: + return EVP_rc2_cbc(); + break; +#endif + +#ifndef OPENSSL_NO_DES + case PHP_OPENSSL_CIPHER_DES: + return EVP_des_cbc(); + break; + case PHP_OPENSSL_CIPHER_3DES: + return EVP_des_ede3_cbc(); + break; +#endif + default: + return NULL; + break; + } +} /* }}} */ /* {{{ PHP_MINIT_FUNCTION @@ -2433,6 +2480,25 @@ }
[PHP-CVS] cvs: php-src(PHP_5_3) / NEWS /ext/soap php_encoding.c /ext/soap/tests any.phpt
dmitry Thu Sep 27 10:01:44 2007 UTC Modified files: (Branch: PHP_5_3) /php-srcNEWS /php-src/ext/soap php_encoding.c /php-src/ext/soap/tests any.phpt Log: Improved ext/soap to support element names in context of XMLShema's any http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.965.2.3r2=1.2027.2.547.2.965.2.4diff_format=u Index: php-src/NEWS diff -u php-src/NEWS:1.2027.2.547.2.965.2.3 php-src/NEWS:1.2027.2.547.2.965.2.4 --- php-src/NEWS:1.2027.2.547.2.965.2.3 Thu Sep 27 08:45:59 2007 +++ php-src/NEWSThu Sep 27 10:01:43 2007 @@ -1,6 +1,8 @@ PHPNEWS ||| ?? ??? 20??, PHP 5.3.0 +- Improved ext/soap to support element names in context of XMLShema's any. + (Dmitry) - Improved ext/openssl (Dmitry) . Added support for OpenSSL digest functions . Added support for OpenSSL cipher functions http://cvs.php.net/viewvc.cgi/php-src/ext/soap/php_encoding.c?r1=1.103.2.21.2.37r2=1.103.2.21.2.37.2.1diff_format=u Index: php-src/ext/soap/php_encoding.c diff -u php-src/ext/soap/php_encoding.c:1.103.2.21.2.37 php-src/ext/soap/php_encoding.c:1.103.2.21.2.37.2.1 --- php-src/ext/soap/php_encoding.c:1.103.2.21.2.37 Wed Sep 5 10:18:22 2007 +++ php-src/ext/soap/php_encoding.c Thu Sep 27 10:01:43 2007 @@ -17,7 +17,7 @@ | Dmitry Stogov [EMAIL PROTECTED] | +--+ */ -/* $Id: php_encoding.c,v 1.103.2.21.2.37 2007/09/05 10:18:22 dmitry Exp $ */ +/* $Id: php_encoding.c,v 1.103.2.21.2.37.2.1 2007/09/27 10:01:43 dmitry Exp $ */ #include time.h @@ -1254,44 +1254,82 @@ static void model_to_zval_any(zval *ret, xmlNodePtr node TSRMLS_DC) { zval* any = NULL; + char* name = NULL; while (node != NULL) { if (get_zval_property(ret, (char*)node-name TSRMLS_CC) == NULL) { zval* val = master_to_zval(get_conversion(XSD_ANYXML), node); - if (get_attribute_ex(node-properties,type, XSI_NAMESPACE) == NULL - Z_TYPE_P(val) == IS_STRING) { - while (node-next != NULL - get_zval_property(ret, (char*)node-next-name TSRMLS_CC) == NULL - get_attribute_ex(node-next-properties,type, XSI_NAMESPACE) == NULL) { + + if (any Z_TYPE_P(any) != IS_ARRAY) { + /* Convert into array */ + zval *arr; + + MAKE_STD_ZVAL(arr); + array_init(arr); + if (name) { + add_assoc_zval(arr, name, any); + } else { + add_next_index_zval(arr, any); + } + any = arr; + } + + if (Z_TYPE_P(val) == IS_STRING *Z_STRVAL_P(val) == '') { + name = NULL; + while (node-next != NULL) { zval* val2 = master_to_zval(get_conversion(XSD_ANYXML), node-next); - if (Z_TYPE_P(val2) != IS_STRING) { + if (Z_TYPE_P(val2) != IS_STRING || *Z_STRVAL_P(val) != '') { break; } add_string_to_string(val, val, val2); zval_ptr_dtor(val2); node = node-next; } + } else { + name = (char*)node-name; } + if (any == NULL) { - any = val; - } else { - if (Z_TYPE_P(any) != IS_ARRAY) { + if (name) { /* Convert into array */ zval *arr; MAKE_STD_ZVAL(arr); array_init(arr); - add_next_index_zval(arr, any); + add_assoc_zval(arr, name, val); any = arr; + name = NULL; + } else { + any = val; } + } else
[PHP-CVS] cvs: php-src /ext/soap php_encoding.c /ext/soap/tests any.phpt
dmitry Thu Sep 27 10:02:04 2007 UTC Modified files: /php-src/ext/soap php_encoding.c /php-src/ext/soap/tests any.phpt Log: Improved ext/soap to support element names in context of XMLShema's any http://cvs.php.net/viewvc.cgi/php-src/ext/soap/php_encoding.c?r1=1.162r2=1.163diff_format=u Index: php-src/ext/soap/php_encoding.c diff -u php-src/ext/soap/php_encoding.c:1.162 php-src/ext/soap/php_encoding.c:1.163 --- php-src/ext/soap/php_encoding.c:1.162 Fri Aug 31 08:07:46 2007 +++ php-src/ext/soap/php_encoding.c Thu Sep 27 10:02:04 2007 @@ -17,7 +17,7 @@ | Dmitry Stogov [EMAIL PROTECTED] | +--+ */ -/* $Id: php_encoding.c,v 1.162 2007/08/31 08:07:46 dmitry Exp $ */ +/* $Id: php_encoding.c,v 1.163 2007/09/27 10:02:04 dmitry Exp $ */ #include time.h @@ -1182,44 +1182,84 @@ static void model_to_zval_any(zval *ret, xmlNodePtr node TSRMLS_DC) { zval* any = NULL; + char* name = NULL; while (node != NULL) { if (get_zval_property(ret, (char*)node-name TSRMLS_CC) == NULL) { zval* val = master_to_zval(get_conversion(XSD_ANYXML), node); - if (get_attribute_ex(node-properties,type, XSI_NAMESPACE) == NULL - (Z_TYPE_P(val) == IS_STRING || Z_TYPE_P(val) == IS_UNICODE)) { - while (node-next != NULL - get_zval_property(ret, (char*)node-next-name TSRMLS_CC) == NULL - get_attribute_ex(node-next-properties,type, XSI_NAMESPACE) == NULL) { + + if (any Z_TYPE_P(any) != IS_ARRAY) { + /* Convert into array */ + zval *arr; + + MAKE_STD_ZVAL(arr); + array_init(arr); + if (name) { + add_rt_assoc_zval(arr, name, any); + } else { + add_next_index_zval(arr, any); + } + any = arr; + } + + if ((Z_TYPE_P(val) == IS_STRING *Z_STRVAL_P(val) == '') || + (Z_TYPE_P(val) == IS_UNICODE *Z_USTRVAL_P(val) == '')) { + name = NULL; + while (node-next != NULL) { zval* val2 = master_to_zval(get_conversion(XSD_ANYXML), node-next); - if (Z_TYPE_P(val2) != IS_STRING Z_TYPE_P(val2) != IS_UNICODE) { + if ((Z_TYPE_P(val2) != IS_STRING || *Z_STRVAL_P(val) != '') + (Z_TYPE_P(val2) != IS_UNICODE || *Z_USTRVAL_P(val) != '')) { break; } add_string_to_string(val, val, val2); zval_ptr_dtor(val2); node = node-next; } + } else { + name = (char*)node-name; } + if (any == NULL) { - any = val; - } else { - if (Z_TYPE_P(any) != IS_ARRAY) { + if (name) { /* Convert into array */ zval *arr; MAKE_STD_ZVAL(arr); array_init(arr); - add_next_index_zval(arr, any); + add_rt_assoc_zval(arr, name, val); any = arr; + name = NULL; + } else { + any = val; } + } else { /* Add array element */ - add_next_index_zval(any, val); + if (name) { + zval **el; + if (zend_rt_hash_find(Z_ARRVAL_P(any), name, strlen(name)+1, (void**)el) == SUCCESS) { + if (Z_TYPE_PP(el) != IS_ARRAY) { + /* Convert into array */ + zval *arr
RE: [PHP-CVS] cvs: php-src(PHP_5_3) / NEWS /ext/bcmath bcmath.c /ext/bz2 bz2.c /ext/calendar calendar.c /ext/com_dotnet com_extension.c com_persist.c /ext/ctype ctype.c /ext/curl interface.c
Yes, of course. I'll update it soon. I am going to backport several other patches nearest days, so I'm not sure if I should update version every day. Thanks. Dmitry. -Original Message- From: Andrey Hristov [mailto:[EMAIL PROTECTED] Sent: Friday, September 28, 2007 7:18 PM To: Dmitry Stogov Cc: php-cvs@lists.php.net Subject: Re: [PHP-CVS] cvs: php-src(PHP_5_3) / NEWS /ext/bcmath bcmath.c /ext/bz2 bz2.c /ext/calendar calendar.c /ext/com_dotnet com_extension.c com_persist.c /ext/ctype ctype.c /ext/curl interface.c /ext/date php_date.c /ext/dba dba.c /e Dmitry Stogov wrote: dmitry Thu Sep 27 18:00:49 2007 UTC Modified files: (Branch: PHP_5_3) /php-srcNEWS /ZendEngine2zend.h zend_API.c zend_API.h zend_builtin_functions.c zend_compile.c zend_compile.h zend_exceptions.c zend_execute.c zend_execute.h zend_execute_API.c zend_hash.c zend_hash.h zend_ini.c zend_ini.h zend_interfaces.c zend_modules.h zend_opcode.c ... Log: Improved memory usage by movig constants to read only memory. (Dmitry, Pierre) Will there be an ABI version dump? Andrey -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_3) /ext/standard basic_functions.c
dmitry Fri Sep 28 19:53:42 2007 UTC Modified files: (Branch: PHP_5_3) /php-src/ext/standard basic_functions.c Log: Support for namespaces http://cvs.php.net/viewvc.cgi/php-src/ext/standard/basic_functions.c?r1=1.725.2.31.2.64.2.2r2=1.725.2.31.2.64.2.3diff_format=u Index: php-src/ext/standard/basic_functions.c diff -u php-src/ext/standard/basic_functions.c:1.725.2.31.2.64.2.2 php-src/ext/standard/basic_functions.c:1.725.2.31.2.64.2.3 --- php-src/ext/standard/basic_functions.c:1.725.2.31.2.64.2.2 Fri Sep 28 02:05:08 2007 +++ php-src/ext/standard/basic_functions.c Fri Sep 28 19:53:42 2007 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: basic_functions.c,v 1.725.2.31.2.64.2.2 2007/09/28 02:05:08 jani Exp $ */ +/* $Id: basic_functions.c,v 1.725.2.31.2.64.2.3 2007/09/28 19:53:42 dmitry Exp $ */ #include php.h #include php_streams.h @@ -4256,7 +4256,7 @@ } convert_to_string_ex(const_name); - if (!zend_get_constant(Z_STRVAL_PP(const_name), Z_STRLEN_PP(const_name), return_value TSRMLS_CC)) { + if (!zend_get_constant_ex(Z_STRVAL_PP(const_name), Z_STRLEN_PP(const_name), return_value, NULL, 0 TSRMLS_CC)) { php_error_docref(NULL TSRMLS_CC, E_WARNING, Couldn't find constant %s, Z_STRVAL_PP(const_name)); RETURN_NULL(); } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_3) / NEWS /ext/standard var_unserializer.c var_unserializer.re /ext/standard/tests/serialize bug42919.phpt
dmitry Wed Oct 17 10:36:33 2007 UTC Added files: (Branch: PHP_5_3) /php-src/ext/standard/tests/serialize bug42919.phpt Modified files: /php-srcNEWS /php-src/ext/standard var_unserializer.c var_unserializer.re Log: Fixed bug #42919 (Unserializing of namespaced class object fails) http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.965.2.27r2=1.2027.2.547.2.965.2.28diff_format=u Index: php-src/NEWS diff -u php-src/NEWS:1.2027.2.547.2.965.2.27 php-src/NEWS:1.2027.2.547.2.965.2.28 --- php-src/NEWS:1.2027.2.547.2.965.2.27Wed Oct 17 10:01:21 2007 +++ php-src/NEWSWed Oct 17 10:36:33 2007 @@ -40,6 +40,7 @@ - Improved and cleaned CGI code. FastCGI is now always enabled and can not be disabled. See sapi/cgi/CHANGES for more details. (Dmitry) +- Fixed bug #42919 (Unserializing of namespaced class object fails). (Dmitry) - Fixed bug #42859 (import always conflicts with internal classes). ([EMAIL PROTECTED], Dmitry) - Fixed bug #42820 (defined() on constant with namespace prefixes tries to load http://cvs.php.net/viewvc.cgi/php-src/ext/standard/var_unserializer.c?r1=1.70.2.4.2.7.2.2r2=1.70.2.4.2.7.2.3diff_format=u Index: php-src/ext/standard/var_unserializer.c diff -u php-src/ext/standard/var_unserializer.c:1.70.2.4.2.7.2.2 php-src/ext/standard/var_unserializer.c:1.70.2.4.2.7.2.3 --- php-src/ext/standard/var_unserializer.c:1.70.2.4.2.7.2.2Sun Oct 7 05:22:07 2007 +++ php-src/ext/standard/var_unserializer.c Wed Oct 17 10:36:33 2007 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: var_unserializer.c,v 1.70.2.4.2.7.2.2 2007/10/07 05:22:07 davidw Exp $ */ +/* $Id: var_unserializer.c,v 1.70.2.4.2.7.2.3 2007/10/17 10:36:33 dmitry Exp $ */ #include php.h #include ext/standard/php_var.h @@ -581,7 +581,7 @@ return 0; } - len3 = strspn(class_name, 0123456789_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\177\200\201\202\203\204\205\206\207\210\211\212\213\214\215\216\217\220\221\222\223\224\225\226\227\230\231\232\233\234\235\236\237\240\241\242\243\244\245\246\247\250\251\252\253\254\255\256\257\260\261\262\263\264\265\266\267\270\271\272\273\274\275\276\277\300\301\302\303\304\305\306\307\310\311\312\313\314\315\316\317\320\321\322\323\324\325\326\327\330\331\332\333\334\335\336\337\340\341\342\343\344\345\346\347\350\351\352\353\354\355\356\357\360\361\362\363\364\365\366\367\370\371\372\373\374\375\376\377); + len3 = strspn(class_name, 0123456789_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\177\200\201\202\203\204\205\206\207\210\211\212\213\214\215\216\217\220\221\222\223\224\225\226\227\230\231\232\233\234\235\236\237\240\241\242\243\244\245\246\247\250\251\252\253\254\255\256\257\260\261\262\263\264\265\266\267\270\271\272\273\274\275\276\277\300\301\302\303\304\305\306\307\310\311\312\313\314\315\316\317\320\321\322\323\324\325\326\327\330\331\332\333\334\335\336\337\340\341\342\343\344\345\346\347\350\351\352\353\354\355\356\357\360\361\362\363\364\365\366\367\370\371\372\373\374\375\376\377:); if (len3 != len) { *p = YYCURSOR + len3 - len; http://cvs.php.net/viewvc.cgi/php-src/ext/standard/var_unserializer.re?r1=1.52.2.2.2.6.2.2r2=1.52.2.2.2.6.2.3diff_format=u Index: php-src/ext/standard/var_unserializer.re diff -u php-src/ext/standard/var_unserializer.re:1.52.2.2.2.6.2.2 php-src/ext/standard/var_unserializer.re:1.52.2.2.2.6.2.3 --- php-src/ext/standard/var_unserializer.re:1.52.2.2.2.6.2.2 Sun Oct 7 05:22:07 2007 +++ php-src/ext/standard/var_unserializer.reWed Oct 17 10:36:33 2007 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: var_unserializer.re,v 1.52.2.2.2.6.2.2 2007/10/07 05:22:07 davidw Exp $ */ +/* $Id: var_unserializer.re,v 1.52.2.2.2.6.2.3 2007/10/17 10:36:33 dmitry Exp $ */ #include php.h #include ext/standard/php_var.h @@ -617,7 +617,7 @@ return 0; } - len3 = strspn(class_name, 0123456789_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\177\200\201\202\203\204\205\206\207\210\211\212\213\214\215\216\217\220\221\222\223\224\225\226\227\230\231\232\233\234\235\236\237\240\241\242\243\244\245\246\247\250\251\252\253\254\255\256\257\260\261\262\263\264\265\266\267\270\271\272\273\274\275\276\277\300\301\302\303\304\305\306\307\310\311\312\313\314\315\316\317\320\321\322\323\324\325\326\327\330\331\332\333\334\335\336\337\340\341\342\343\344\345\346\347\350\351\352\353\354\355\356\357\360\361\362\363\364\365\366\367\370\371\372\373\374\375\376\377); + len3 = strspn(class_name,
[PHP-CVS] cvs: php-src /ext/standard var_unserializer.c var_unserializer.re /ext/standard/tests/serialize bug42919.phpt
dmitry Wed Oct 17 10:36:45 2007 UTC Modified files: /php-src/ext/standard var_unserializer.c var_unserializer.re /php-src/ext/standard/tests/serialize bug42919.phpt Log: Fixed bug #42919 (Unserializing of namespaced class object fails) http://cvs.php.net/viewvc.cgi/php-src/ext/standard/var_unserializer.c?r1=1.92r2=1.93diff_format=u Index: php-src/ext/standard/var_unserializer.c diff -u php-src/ext/standard/var_unserializer.c:1.92 php-src/ext/standard/var_unserializer.c:1.93 --- php-src/ext/standard/var_unserializer.c:1.92Sun Oct 7 05:15:06 2007 +++ php-src/ext/standard/var_unserializer.c Wed Oct 17 10:36:45 2007 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: var_unserializer.c,v 1.92 2007/10/07 05:15:06 davidw Exp $ */ +/* $Id: var_unserializer.c,v 1.93 2007/10/17 10:36:45 dmitry Exp $ */ #include php.h #include ext/standard/php_var.h @@ -641,7 +641,7 @@ if (UG(unicode)) { class_name.u = unserialize_ustr(YYCURSOR, len); } else { - len3 = strspn((char*)YYCURSOR, 0123456789_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\177\200\201\202\203\204\205\206\207\210\211\212\213\214\215\216\217\220\221\222\223\224\225\226\227\230\231\232\233\234\235\236\237\240\241\242\243\244\245\246\247\250\251\252\253\254\255\256\257\260\261\262\263\264\265\266\267\270\271\272\273\274\275\276\277\300\301\302\303\304\305\306\307\310\311\312\313\314\315\316\317\320\321\322\323\324\325\326\327\330\331\332\333\334\335\336\337\340\341\342\343\344\345\346\347\350\351\352\353\354\355\356\357\360\361\362\363\364\365\366\367\370\371\372\373\374\375\376\377); + len3 = strspn((char*)YYCURSOR, 0123456789_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\177\200\201\202\203\204\205\206\207\210\211\212\213\214\215\216\217\220\221\222\223\224\225\226\227\230\231\232\233\234\235\236\237\240\241\242\243\244\245\246\247\250\251\252\253\254\255\256\257\260\261\262\263\264\265\266\267\270\271\272\273\274\275\276\277\300\301\302\303\304\305\306\307\310\311\312\313\314\315\316\317\320\321\322\323\324\325\326\327\330\331\332\333\334\335\336\337\340\341\342\343\344\345\346\347\350\351\352\353\354\355\356\357\360\361\362\363\364\365\366\367\370\371\372\373\374\375\376\377:); if (len3 != len) { *p = YYCURSOR + len3 - len; return 0; http://cvs.php.net/viewvc.cgi/php-src/ext/standard/var_unserializer.re?r1=1.71r2=1.72diff_format=u Index: php-src/ext/standard/var_unserializer.re diff -u php-src/ext/standard/var_unserializer.re:1.71 php-src/ext/standard/var_unserializer.re:1.72 --- php-src/ext/standard/var_unserializer.re:1.71 Sun Oct 7 05:15:06 2007 +++ php-src/ext/standard/var_unserializer.reWed Oct 17 10:36:45 2007 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: var_unserializer.re,v 1.71 2007/10/07 05:15:06 davidw Exp $ */ +/* $Id: var_unserializer.re,v 1.72 2007/10/17 10:36:45 dmitry Exp $ */ #include php.h #include ext/standard/php_var.h @@ -701,7 +701,7 @@ if (UG(unicode)) { class_name.u = unserialize_ustr(YYCURSOR, len); } else { - len3 = strspn((char*)YYCURSOR, 0123456789_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\177\200\201\202\203\204\205\206\207\210\211\212\213\214\215\216\217\220\221\222\223\224\225\226\227\230\231\232\233\234\235\236\237\240\241\242\243\244\245\246\247\250\251\252\253\254\255\256\257\260\261\262\263\264\265\266\267\270\271\272\273\274\275\276\277\300\301\302\303\304\305\306\307\310\311\312\313\314\315\316\317\320\321\322\323\324\325\326\327\330\331\332\333\334\335\336\337\340\341\342\343\344\345\346\347\350\351\352\353\354\355\356\357\360\361\362\363\364\365\366\367\370\371\372\373\374\375\376\377); + len3 = strspn((char*)YYCURSOR, 0123456789_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\177\200\201\202\203\204\205\206\207\210\211\212\213\214\215\216\217\220\221\222\223\224\225\226\227\230\231\232\233\234\235\236\237\240\241\242\243\244\245\246\247\250\251\252\253\254\255\256\257\260\261\262\263\264\265\266\267\270\271\272\273\274\275\276\277\300\301\302\303\304\305\306\307\310\311\312\313\314\315\316\317\320\321\322\323\324\325\326\327\330\331\332\333\334\335\336\337\340\341\342\343\344\345\346\347\350\351\352\353\354\355\356\357\360\361\362\363\364\365\366\367\370\371\372\373\374\375\376\377:); if (len3 != len) { *p = YYCURSOR + len3 - len; return 0; http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/serialize/bug42919.phpt?r1=1.1r2=1.2diff_format=u Index: php-src/ext/standard/tests/serialize/bug42919.phpt diff -u /dev/null php-src/ext/standard/tests/serialize/bug42919.phpt:1.2 --- /dev/null Wed Oct 17 10:36:45 2007 +++
[PHP-CVS] cvs: php-src(PHP_5_3) / NEWS /ext/soap php_http.c
dmitry Wed Oct 17 11:18:34 2007 UTC Modified files: (Branch: PHP_5_3) /php-srcNEWS /php-src/ext/soap php_http.c Log: Fixed bug #42637 (SoapFault : Only http and https are allowed). (Bill Moran) http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.965.2.28r2=1.2027.2.547.2.965.2.29diff_format=u Index: php-src/NEWS diff -u php-src/NEWS:1.2027.2.547.2.965.2.28 php-src/NEWS:1.2027.2.547.2.965.2.29 --- php-src/NEWS:1.2027.2.547.2.965.2.28Wed Oct 17 10:36:33 2007 +++ php-src/NEWSWed Oct 17 11:18:34 2007 @@ -50,6 +50,7 @@ - Fixed bug #42737 (preg_split('//u') triggers a E_NOTICE with newlines). (Nuno) - Fixed bug #42657 (ini_get() returns incorrect value when default is NULL). (Jani) +- Fixed bug #42637 (SoapFault : Only http and https are allowed). (Bill Moran) - Fixed bug #42069 (parse_ini_file() allows using some non-alpha numeric characters). (Jani) - Fixed bug #37911 (preg_replace_callback() ignores named groups). (Nuno) http://cvs.php.net/viewvc.cgi/php-src/ext/soap/php_http.c?r1=1.77.2.11.2.12.2.1r2=1.77.2.11.2.12.2.2diff_format=u Index: php-src/ext/soap/php_http.c diff -u php-src/ext/soap/php_http.c:1.77.2.11.2.12.2.1 php-src/ext/soap/php_http.c:1.77.2.11.2.12.2.2 --- php-src/ext/soap/php_http.c:1.77.2.11.2.12.2.1 Sun Oct 7 05:22:06 2007 +++ php-src/ext/soap/php_http.c Wed Oct 17 11:18:34 2007 @@ -17,7 +17,7 @@ | Dmitry Stogov [EMAIL PROTECTED] | +--+ */ -/* $Id: php_http.c,v 1.77.2.11.2.12.2.1 2007/10/07 05:22:06 davidw Exp $ */ +/* $Id: php_http.c,v 1.77.2.11.2.12.2.2 2007/10/17 11:18:34 dmitry Exp $ */ #include php_soap.h #include ext/standard/base64.h @@ -918,7 +918,7 @@ efree(http_body); efree(loc); if (new_url-scheme == NULL new_url-path != NULL) { - new_url-scheme = NULL; + new_url-scheme = phpurl-scheme ? estrdup(phpurl-scheme) : NULL; new_url-host = phpurl-host ? estrdup(phpurl-host) : NULL; new_url-port = phpurl-port; if (new_url-path new_url-path[0] != '/') { -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/soap php_http.c
dmitry Wed Oct 17 11:18:49 2007 UTC Modified files: /php-src/ext/soap php_http.c Log: Fixed bug #42637 (SoapFault : Only http and https are allowed). (Bill Moran) http://cvs.php.net/viewvc.cgi/php-src/ext/soap/php_http.c?r1=1.109r2=1.110diff_format=u Index: php-src/ext/soap/php_http.c diff -u php-src/ext/soap/php_http.c:1.109 php-src/ext/soap/php_http.c:1.110 --- php-src/ext/soap/php_http.c:1.109 Tue Jul 24 09:28:12 2007 +++ php-src/ext/soap/php_http.c Wed Oct 17 11:18:49 2007 @@ -17,7 +17,7 @@ | Dmitry Stogov [EMAIL PROTECTED] | +--+ */ -/* $Id: php_http.c,v 1.109 2007/07/24 09:28:12 dmitry Exp $ */ +/* $Id: php_http.c,v 1.110 2007/10/17 11:18:49 dmitry Exp $ */ #include php_soap.h #include ext/standard/base64.h @@ -925,7 +925,7 @@ efree(http_body); efree(loc); if (new_url-scheme == NULL new_url-path != NULL) { - new_url-scheme = NULL; + new_url-scheme = phpurl-scheme ? estrdup(phpurl-scheme) : NULL; new_url-host = phpurl-host ? estrdup(phpurl-host) : NULL; new_url-port = phpurl-port; if (new_url-path new_url-path[0] != '/') { -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php