[PHP-CVS] cvs: php-src(PHP_5_3) / configure.in /main spprintf.c
nlopess Fri Dec 12 23:43:18 2008 UTC Modified files: (Branch: PHP_5_3) /php-srcconfigure.in /php-src/main spprintf.c Log: make *printf() functions do not read strings past their specified length (if any) http://cvs.php.net/viewvc.cgi/php-src/configure.in?r1=1.579.2.52.2.77.2.37r2=1.579.2.52.2.77.2.38diff_format=u Index: php-src/configure.in diff -u php-src/configure.in:1.579.2.52.2.77.2.37 php-src/configure.in:1.579.2.52.2.77.2.38 --- php-src/configure.in:1.579.2.52.2.77.2.37 Wed Dec 3 21:01:51 2008 +++ php-src/configure.inFri Dec 12 23:43:17 2008 @@ -1,4 +1,4 @@ -## $Id: configure.in,v 1.579.2.52.2.77.2.37 2008/12/03 21:01:51 johannes Exp $ -*- autoconf -*- +## $Id: configure.in,v 1.579.2.52.2.77.2.38 2008/12/12 23:43:17 nlopess Exp $ -*- autoconf -*- dnl ## Process this file with autoconf to produce a configure script. divert(1) @@ -625,6 +625,7 @@ strdup \ strerror \ strftime \ +strnlen \ strptime \ strstr \ strtok_r \ http://cvs.php.net/viewvc.cgi/php-src/main/spprintf.c?r1=1.25.2.2.2.10.2.4r2=1.25.2.2.2.10.2.5diff_format=u Index: php-src/main/spprintf.c diff -u php-src/main/spprintf.c:1.25.2.2.2.10.2.4 php-src/main/spprintf.c:1.25.2.2.2.10.2.5 --- php-src/main/spprintf.c:1.25.2.2.2.10.2.4 Thu Feb 7 18:41:35 2008 +++ php-src/main/spprintf.c Fri Dec 12 23:43:18 2008 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: spprintf.c,v 1.25.2.2.2.10.2.4 2008/02/07 18:41:35 helly Exp $ */ +/* $Id: spprintf.c,v 1.25.2.2.2.10.2.5 2008/12/12 23:43:18 nlopess Exp $ */ /* This is the spprintf implementation. * It has emerged from apache snprintf. See original header: @@ -76,6 +76,7 @@ * SIO stdio-replacement strx_* functions by Panos Tsirigotis * pa...@alumni.cs.colorado.edu for xinetd. */ +#define _GNU_SOURCE #include php.h #include stddef.h @@ -180,6 +181,14 @@ /* }}} */ + +#if !HAVE_STRNLEN +static size_t strnlen(const char *s, size_t maxlen) { + char *r = memchr(s, '\0', maxlen); + return r ? r-s : maxlen; +} +#endif + /* * Do format conversion placing the output in buffer */ @@ -561,9 +570,11 @@ case 'v': s = va_arg(ap, char *); if (s != NULL) { - s_len = strlen(s); - if (adjust_precision precision s_len) - s_len = precision; + if (!adjust_precision) { + s_len = strlen(s); + } else { + s_len = strnlen(s, precision); + } } else { s = S_NULL; s_len = S_NULL_LEN; -- 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/pdo pdo_stmt.c
nlopess Fri Dec 12 23:46:05 2008 UTC Modified files: (Branch: PHP_5_3) /php-src/ext/pdopdo_stmt.c Log: we do not need the strndup() now that php_stream_printf() handles non-null terminated strings correctly http://cvs.php.net/viewvc.cgi/php-src/ext/pdo/pdo_stmt.c?r1=1.118.2.38.2.24.2.40r2=1.118.2.38.2.24.2.41diff_format=u Index: php-src/ext/pdo/pdo_stmt.c diff -u php-src/ext/pdo/pdo_stmt.c:1.118.2.38.2.24.2.40 php-src/ext/pdo/pdo_stmt.c:1.118.2.38.2.24.2.41 --- php-src/ext/pdo/pdo_stmt.c:1.118.2.38.2.24.2.40 Thu Dec 11 15:32:24 2008 +++ php-src/ext/pdo/pdo_stmt.c Fri Dec 12 23:46:05 2008 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: pdo_stmt.c,v 1.118.2.38.2.24.2.40 2008/12/11 15:32:24 iliaa Exp $ */ +/* $Id: pdo_stmt.c,v 1.118.2.38.2.24.2.41 2008/12/12 23:46:05 nlopess Exp $ */ /* The PDO Statement Handle Class */ @@ -2209,9 +2209,7 @@ if (res == HASH_KEY_IS_LONG) { php_stream_printf(out TSRMLS_CC, Key: Position #%ld:\n, num); } else if (res == HASH_KEY_IS_STRING) { - char *s = estrndup(str, len); - php_stream_printf(out TSRMLS_CC, Key: Name: [%d] %.*s\n, len, len, s); - efree(s); + php_stream_printf(out TSRMLS_CC, Key: Name: [%d] %.*s\n, len, len, str); } php_stream_printf(out TSRMLS_CC, paramno=%d\nname=[%d] \%.*s\\nis_param=%d\nparam_type=%d\n, -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src / configure.in /main spprintf.c
nlopess Fri Dec 12 23:55:49 2008 UTC Modified files: /php-srcconfigure.in /php-src/main spprintf.c Log: MFB http://cvs.php.net/viewvc.cgi/php-src/configure.in?r1=1.668r2=1.669diff_format=u Index: php-src/configure.in diff -u php-src/configure.in:1.668 php-src/configure.in:1.669 --- php-src/configure.in:1.668 Thu Dec 4 00:41:17 2008 +++ php-src/configure.inFri Dec 12 23:55:48 2008 @@ -1,4 +1,4 @@ -## $Id: configure.in,v 1.668 2008/12/04 00:41:17 dsp Exp $ -*- autoconf -*- +## $Id: configure.in,v 1.669 2008/12/12 23:55:48 nlopess Exp $ -*- autoconf -*- dnl ## Process this file with autoconf to produce a configure script. divert(1) @@ -625,6 +625,7 @@ strdup \ strerror \ strftime \ +strnlen \ strptime \ strstr \ strtok_r \ http://cvs.php.net/viewvc.cgi/php-src/main/spprintf.c?r1=1.53r2=1.54diff_format=u Index: php-src/main/spprintf.c diff -u php-src/main/spprintf.c:1.53 php-src/main/spprintf.c:1.54 --- php-src/main/spprintf.c:1.53Thu Feb 7 18:40:29 2008 +++ php-src/main/spprintf.c Fri Dec 12 23:55:48 2008 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: spprintf.c,v 1.53 2008/02/07 18:40:29 helly Exp $ */ +/* $Id: spprintf.c,v 1.54 2008/12/12 23:55:48 nlopess Exp $ */ /* This is the spprintf implementation. * It has emerged from apache snprintf. See original header: @@ -77,6 +77,7 @@ * pa...@alumni.cs.colorado.edu for xinetd. */ +#define _GNU_SOURCE #include php.h #include stddef.h @@ -209,6 +210,14 @@ /* }}} */ + +#if !HAVE_STRNLEN +static size_t strnlen(const char *s, size_t maxlen) { + char *r = memchr(s, '\0', maxlen); + return r ? r-s : maxlen; +} +#endif + /* * Do format conversion placing the output in buffer */ @@ -656,9 +665,11 @@ fmt_string: s = va_arg(ap, char *); if (s != NULL) { - s_len = strlen(s); - if (adjust_precision precision s_len) - s_len = precision; + if (!adjust_precision) { + s_len = strlen(s); + } else { + s_len = strnlen(s, precision); + } } else { s = S_NULL; s_len = S_NULL_LEN; -- 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_3) /ext/pdo pdo_stmt.c
I've commited a little fix to *printf() functions, so that they won't read past the specified length. Nuno - Original Message - It does not really read past it, but internally it does a strlen() on the %s argument, which is where the valgrind shows the message. Technically that code needs to be reviewed, but just from general use case I think its safer not to pass non-terminated char pointers around. On 11-Dec-08, at 11:50 AM, Nuno Lopes wrote: Weird.. Isn't that a bug in php_stream_printf() then? I would say it shouldn't read past the specified length.. otherwise the same bug may appear in other places. What do you think? Nuno - Original Message - The patch was already n 5.2, the issue is that the str (key) is not guaranteed to be NULL terminated (nor does it need to be), so when strlen() is attempted on top of it you could end up reading more data then necessary. On 11-Dec-08, at 10:43 AM, Nuno Lopes wrote: Modified files: (Branch: PHP_5_3) /php-src/ext/pdo pdo_stmt.c Log: Fixed a possible corruption inside PDOStatement::debugDumpParams() http://cvs.php.net/viewvc.cgi/php-src/ext/pdo/pdo_stmt.c?r1=1.118.2.38.2.24.2.39r2=1.118.2.38.2.24.2.40diff_format=u Index: php-src/ext/pdo/pdo_stmt.c diff -u php-src/ext/pdo/pdo_stmt.c:1.118.2.38.2.24.2.39 php-src/ ext/ pdo/pdo_stmt.c:1.118.2.38.2.24.2.40 @@ -2209,7 +2209,9 @@ if (res == HASH_KEY_IS_LONG) { php_stream_printf(out TSRMLS_CC, Key: Position #%ld:\n, num); } else if (res == HASH_KEY_IS_STRING) { - php_stream_printf(out TSRMLS_CC, Key: Name: [%d] %.*s\n, len, len, str); + char *s = estrndup(str, len); + php_stream_printf(out TSRMLS_CC, Key: Name: [%d] %.*s\n, len, len, s); + efree(s); } Sorry for my ignorance, but isn't the new code exactly equivalent to the old one, albeit a bit slower? I can't really see how a strndup() can fix a corruption there.. If there's some problem, probably it's deeper than this.. Nuno Ilia Alshanetsky -- 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_3) /ext/pdo pdo_stmt.c
Modified files: (Branch: PHP_5_3) /php-src/ext/pdo pdo_stmt.c Log: Fixed a possible corruption inside PDOStatement::debugDumpParams() http://cvs.php.net/viewvc.cgi/php-src/ext/pdo/pdo_stmt.c?r1=1.118.2.38.2.24.2.39r2=1.118.2.38.2.24.2.40diff_format=u Index: php-src/ext/pdo/pdo_stmt.c diff -u php-src/ext/pdo/pdo_stmt.c:1.118.2.38.2.24.2.39 php-src/ext/pdo/pdo_stmt.c:1.118.2.38.2.24.2.40 @@ -2209,7 +2209,9 @@ if (res == HASH_KEY_IS_LONG) { php_stream_printf(out TSRMLS_CC, Key: Position #%ld:\n, num); } else if (res == HASH_KEY_IS_STRING) { - php_stream_printf(out TSRMLS_CC, Key: Name: [%d] %.*s\n, len, len, str); + char *s = estrndup(str, len); + php_stream_printf(out TSRMLS_CC, Key: Name: [%d] %.*s\n, len, len, s); + efree(s); } Sorry for my ignorance, but isn't the new code exactly equivalent to the old one, albeit a bit slower? I can't really see how a strndup() can fix a corruption there.. If there's some problem, probably it's deeper than this.. Nuno -- 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_3) /ext/pdo pdo_stmt.c
Weird.. Isn't that a bug in php_stream_printf() then? I would say it shouldn't read past the specified length.. otherwise the same bug may appear in other places. What do you think? Nuno - Original Message - The patch was already n 5.2, the issue is that the str (key) is not guaranteed to be NULL terminated (nor does it need to be), so when strlen() is attempted on top of it you could end up reading more data then necessary. On 11-Dec-08, at 10:43 AM, Nuno Lopes wrote: Modified files: (Branch: PHP_5_3) /php-src/ext/pdo pdo_stmt.c Log: Fixed a possible corruption inside PDOStatement::debugDumpParams() http://cvs.php.net/viewvc.cgi/php-src/ext/pdo/pdo_stmt.c?r1=1.118.2.38.2.24.2.39r2=1.118.2.38.2.24.2.40diff_format=u Index: php-src/ext/pdo/pdo_stmt.c diff -u php-src/ext/pdo/pdo_stmt.c:1.118.2.38.2.24.2.39 php-src/ext/ pdo/pdo_stmt.c:1.118.2.38.2.24.2.40 @@ -2209,7 +2209,9 @@ if (res == HASH_KEY_IS_LONG) { php_stream_printf(out TSRMLS_CC, Key: Position #%ld:\n, num); } else if (res == HASH_KEY_IS_STRING) { - php_stream_printf(out TSRMLS_CC, Key: Name: [%d] %.*s\n, len, len, str); + char *s = estrndup(str, len); + php_stream_printf(out TSRMLS_CC, Key: Name: [%d] %.*s\n, len, len, s); + efree(s); } Sorry for my ignorance, but isn't the new code exactly equivalent to the old one, albeit a bit slower? I can't really see how a strndup() can fix a corruption there.. If there's some problem, probably it's deeper than this.. Nuno Ilia Alshanetsky -- 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/pcre upgrade-pcre.php /ext/pcre/pcrelib config.h
nlopess Wed Dec 10 10:16:14 2008 UTC Modified files: (Branch: PHP_5_3) /php-src/ext/pcre upgrade-pcre.php /php-src/ext/pcre/pcrelib config.h Log: export the pcre API when compiling with gcc 4. this fixes e.g. the linkage of APC (reported by shire) http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/upgrade-pcre.php?r1=1.1.2.3.2.1r2=1.1.2.3.2.2diff_format=u Index: php-src/ext/pcre/upgrade-pcre.php diff -u php-src/ext/pcre/upgrade-pcre.php:1.1.2.3.2.1 php-src/ext/pcre/upgrade-pcre.php:1.1.2.3.2.2 --- php-src/ext/pcre/upgrade-pcre.php:1.1.2.3.2.1 Mon Jan 14 09:40:29 2008 +++ php-src/ext/pcre/upgrade-pcre.php Wed Dec 10 10:16:14 2008 @@ -106,6 +106,16 @@ #define SUPPORT_UCP #define SUPPORT_UTF8 +#if defined(__GNUC__) __GNUC__ = 4 +# ifdef __cplusplus +# define PCRE_EXP_DECLextern C __attribute__ ((visibility(default))) +# else +# define PCRE_EXP_DECLextern __attribute__ ((visibility(default))) +# endif +# define PCRE_EXP_DEFN __attribute__ ((visibility(default))) +# define PCRE_EXP_DATA_DEFN__attribute__ ((visibility(default))) +#endif + '; http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/pcrelib/config.h?r1=1.2.2.4.2.5r2=1.2.2.4.2.6diff_format=u Index: php-src/ext/pcre/pcrelib/config.h diff -u php-src/ext/pcre/pcrelib/config.h:1.2.2.4.2.5 php-src/ext/pcre/pcrelib/config.h:1.2.2.4.2.6 --- php-src/ext/pcre/pcrelib/config.h:1.2.2.4.2.5 Tue Sep 9 07:55:08 2008 +++ php-src/ext/pcre/pcrelib/config.h Wed Dec 10 10:16:14 2008 @@ -8,6 +8,16 @@ #define SUPPORT_UCP #define SUPPORT_UTF8 +#if defined(__GNUC__) __GNUC__ = 4 +# ifdef __cplusplus +# define PCRE_EXP_DECLextern C __attribute__ ((visibility(default))) +# else +# define PCRE_EXP_DECLextern __attribute__ ((visibility(default))) +# endif +# define PCRE_EXP_DEFN __attribute__ ((visibility(default))) +# define PCRE_EXP_DATA_DEFN__attribute__ ((visibility(default))) +#endif + /* config.h. Generated from config.h.in by configure. */ /* config.h.in. Generated from configure.ac by autoheader. */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/pcre upgrade-pcre.php /ext/pcre/pcrelib config.h
nlopess Wed Dec 10 10:16:22 2008 UTC Modified files: /php-src/ext/pcre upgrade-pcre.php /php-src/ext/pcre/pcrelib config.h Log: MFB: export pcre API when using gcc 4 http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/upgrade-pcre.php?r1=1.3r2=1.4diff_format=u Index: php-src/ext/pcre/upgrade-pcre.php diff -u php-src/ext/pcre/upgrade-pcre.php:1.3 php-src/ext/pcre/upgrade-pcre.php:1.4 --- php-src/ext/pcre/upgrade-pcre.php:1.3 Mon Jan 14 09:40:53 2008 +++ php-src/ext/pcre/upgrade-pcre.php Wed Dec 10 10:16:20 2008 @@ -106,6 +106,16 @@ #define SUPPORT_UCP #define SUPPORT_UTF8 +#if defined(__GNUC__) __GNUC__ = 4 +# ifdef __cplusplus +# define PCRE_EXP_DECLextern C __attribute__ ((visibility(default))) +# else +# define PCRE_EXP_DECLextern __attribute__ ((visibility(default))) +# endif +# define PCRE_EXP_DEFN __attribute__ ((visibility(default))) +# define PCRE_EXP_DATA_DEFN__attribute__ ((visibility(default))) +#endif + '; http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/pcrelib/config.h?r1=1.8r2=1.9diff_format=u Index: php-src/ext/pcre/pcrelib/config.h diff -u php-src/ext/pcre/pcrelib/config.h:1.8 php-src/ext/pcre/pcrelib/config.h:1.9 --- php-src/ext/pcre/pcrelib/config.h:1.8 Sun Sep 14 14:37:10 2008 +++ php-src/ext/pcre/pcrelib/config.h Wed Dec 10 10:16:20 2008 @@ -8,6 +8,16 @@ #define SUPPORT_UCP #define SUPPORT_UTF8 +#if defined(__GNUC__) __GNUC__ = 4 +# ifdef __cplusplus +# define PCRE_EXP_DECLextern C __attribute__ ((visibility(default))) +# else +# define PCRE_EXP_DECLextern __attribute__ ((visibility(default))) +# endif +# define PCRE_EXP_DEFN __attribute__ ((visibility(default))) +# define PCRE_EXP_DATA_DEFN__attribute__ ((visibility(default))) +#endif + /* config.h. Generated from config.h.in by configure. */ /* config.h.in. Generated from configure.ac by autoheader. */ -- 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 php_compat.h
nlopess Tue Dec 9 22:00:20 2008 UTC Modified files: (Branch: PHP_5_2) /php-src/main php_compat.h Log: update PCRE symbol list (sync with php 5.3). this should fix bug #46800 http://cvs.php.net/viewvc.cgi/php-src/main/php_compat.h?r1=1.25.2.3.2.5r2=1.25.2.3.2.6diff_format=u Index: php-src/main/php_compat.h diff -u php-src/main/php_compat.h:1.25.2.3.2.5 php-src/main/php_compat.h:1.25.2.3.2.6 --- php-src/main/php_compat.h:1.25.2.3.2.5 Mon Dec 31 07:20:15 2007 +++ php-src/main/php_compat.h Tue Dec 9 22:00:19 2008 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: php_compat.h,v 1.25.2.3.2.5 2007/12/31 07:20:15 sebastian Exp $ */ +/* $Id: php_compat.h,v 1.25.2.3.2.6 2008/12/09 22:00:19 nlopess Exp $ */ #ifndef PHP_COMPAT_H #define PHP_COMPAT_H @@ -28,36 +28,34 @@ #endif #if defined(HAVE_BUNDLED_PCRE) || !defined(PHP_VERSION) -#define pcre_compile php_pcre_compile -#define pcre_compile2 php_pcre_compile2 +#define pcre_compile php_pcre_compile +#define pcre_compile2 php_pcre_compile2 #define pcre_copy_substringphp_pcre_copy_substring -#define pcre_exec php_pcre_exec +#define pcre_exec php_pcre_exec #define pcre_get_substring php_pcre_get_substring -#define pcre_get_substring_listphp_pcre_get_substring_list -#define pcre_info php_pcre_info +#define pcre_get_substring_listphp_pcre_get_substring_list +#define pcre_info php_pcre_info #define pcre_maketablesphp_pcre_maketables -#define pcre_study php_pcre_study +#define pcre_study php_pcre_study #define pcre_version php_pcre_version #define pcre_fullinfo php_pcre_fullinfo -#define pcre_free php_pcre_free -#define pcre_mallocphp_pcre_malloc -#define pcre_configphp_pcre_config -#define pcre_copy_named_substring php_pcre_copy_named_substring -#define pcre_free_substringphp_pcre_free_substring -#define pcre_free_substring_list php_pcre_free_substring_list -#define pcre_get_named_substring php_pcre_get_named_substring -#define pcre_get_stringnumber php_pcre_get_stringnumber -#define pcre_refcount php_pcre_refcount -#define _pcre_ord2utf8 php__pcre_ord2utf8 -#define _pcre_try_flipped php__pcre_try_flipped -#define _pcre_ucp_findprop php__pcre_ucp_findprop -#define _pcre_ucp_othercasephp__pcre_ucp_othercase -#define _pcre_valid_utf8 php__pcre_valid_utf8 -#define _pcre_xclass php__pcre_xclass +#define pcre_free php_pcre_free +#define pcre_mallocphp_pcre_malloc +#define pcre_configphp_pcre_config +#define pcre_copy_named_substring php_pcre_copy_named_substring +#define pcre_free_substringphp_pcre_free_substring +#define pcre_free_substring_list php_pcre_free_substring_list +#define pcre_get_named_substring php_pcre_get_named_substring +#define pcre_get_stringnumber php_pcre_get_stringnumber +#define pcre_refcount php_pcre_refcount +#define _pcre_ord2utf8 php__pcre_ord2utf8 +#define _pcre_try_flipped php__pcre_try_flipped +#define _pcre_valid_utf8 php__pcre_valid_utf8 +#define _pcre_xclass php__pcre_xclass #define pcre_callout php_pcre_callout #define _pcre_OP_lengths php__pcre_OP_lengths -/* this one doesn't work because pcre.h isn't included from the pcre_chartables.c file -#define _pcre_default_tables php__pcre_default_tables */ +#define _pcre_utt_namesphp__pcre_utt_names +#define _pcre_default_tables php__pcre_default_tables #define pcre_get_stringtable_entries php_pcre_get_stringtable_entries #define _pcre_is_newline php__pcre_is_newline #define pcre_stack_freephp_pcre_stack_free @@ -70,6 +68,10 @@ #define _pcre_utt php__pcre_utt #define _pcre_utt_size php__pcre_utt_size #define _pcre_was_newline php__pcre_was_newline +#define _pcre_ucd_records php__pcre_ucd_records +#define _pcre_ucd_stage1 php__pcre_ucd_stage1 +#define _pcre_ucd_stage2 php__pcre_ucd_stage2 +#define _pcre_ucp_gentype php__pcre_ucp_gentype #endif #define lookup php_lookup -- 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/pcre/pcrelib ucptable.h
nlopess Mon Dec 8 20:18:15 2008 UTC Removed files: (Branch: PHP_5_2) /php-src/ext/pcre/pcrelib ucptable.h Log: remove unused file to avoid confusion -- 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_3) /ext/standard array.c assert.c basic_functions.c browscap.c crypt.c file.c filestat.c head.c html.c http.c info.c mail.c math.c proc_open.c rand.c streamsfuncs.c st
Hey, hey, what are you doing? I assume you're reading the http://gcov.php.net/viewer.php?version=PHP_5_3func=params page. That script is very dumb and unfortunately shows many false positives. I did a cursory review of your commits and most of the changes you did aren't necessary (in fact they can degrade the performance). This year I was hoping to get a student from the GSoC project to improve this analyzer, but I didn't. Let's hope next year we can get one :P (if someone is interested please contact me!) In the mean time, please don't assume that script is 100% right. Please always look to the code first to check if the initialization is really needed. Thanks, Nuno - Original Message - From: Arnaud Le Blanc [EMAIL PROTECTED] To: php-cvs@lists.php.net Sent: Tuesday, October 21, 2008 11:08 PM Subject: [PHP-CVS] cvs: php-src(PHP_5_3) /ext/standard array.c assert.c basic_functions.c browscap.c crypt.c file.c filestat.c head.c html.c http.c info.c mail.c math.c proc_open.c rand.c streamsfuncs.c string.c type.c versioning.c lbarnaud Tue Oct 21 22:08:39 2008 UTC Modified files: (Branch: PHP_5_3) /php-src/ext/standard array.c assert.c basic_functions.c browscap.c crypt.c file.c filestat.c head.c html.c http.c info.c mail.c math.c proc_open.c rand.c streamsfuncs.c string.c type.c versioning.c Log: MFH: initialize optional vars -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/iconv iconv.c /ext/pcre php_pcre.c /ext/standard array.c base64.c image.c versioning.c /main rfc1867.c /main/streams glob_wrapper.c ZendEngine2 zend_constants.c
nlopess Tue Sep 23 15:22:05 2008 UTC Modified files: /ZendEngine2zend_constants.c /php-src/ext/iconv iconv.c /php-src/ext/pcre php_pcre.c /php-src/ext/standard array.c base64.c image.c versioning.c /php-src/main rfc1867.c /php-src/main/streams glob_wrapper.c Log: MFB: clean some dead code http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_constants.c?r1=1.113r2=1.114diff_format=u Index: ZendEngine2/zend_constants.c diff -u ZendEngine2/zend_constants.c:1.113 ZendEngine2/zend_constants.c:1.114 --- ZendEngine2/zend_constants.c:1.113 Tue Aug 12 17:15:59 2008 +++ ZendEngine2/zend_constants.cTue Sep 23 15:22:05 2008 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: zend_constants.c,v 1.113 2008/08/12 17:15:59 felipe Exp $ */ +/* $Id: zend_constants.c,v 1.114 2008/09/23 15:22:05 nlopess Exp $ */ #include zend.h #include zend_constants.h @@ -458,7 +458,6 @@ name = constant_name; name_len = const_name_len; efree(class_name.v); - retval = 1; return zend_u_get_constant(type, name, name_len, result TSRMLS_CC); } if ((flags ZEND_FETCH_CLASS_SILENT) == 0) { http://cvs.php.net/viewvc.cgi/php-src/ext/iconv/iconv.c?r1=1.165r2=1.166diff_format=u Index: php-src/ext/iconv/iconv.c diff -u php-src/ext/iconv/iconv.c:1.165 php-src/ext/iconv/iconv.c:1.166 --- php-src/ext/iconv/iconv.c:1.165 Wed May 21 15:03:11 2008 +++ php-src/ext/iconv/iconv.c Tue Sep 23 15:22:05 2008 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: iconv.c,v 1.165 2008/05/21 15:03:11 tony2001 Exp $ */ +/* $Id: iconv.c,v 1.166 2008/09/23 15:22:05 nlopess Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -1357,7 +1357,6 @@ char_cnt -= 3; } } - prev_in_left = in_left; smart_str_appendl(pretval, ?=, sizeof(?=) - 1); char_cnt -= 2; http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/php_pcre.c?r1=1.240r2=1.241diff_format=u Index: php-src/ext/pcre/php_pcre.c diff -u php-src/ext/pcre/php_pcre.c:1.240 php-src/ext/pcre/php_pcre.c:1.241 --- php-src/ext/pcre/php_pcre.c:1.240 Tue Sep 2 19:13:24 2008 +++ php-src/ext/pcre/php_pcre.c Tue Sep 23 15:22:05 2008 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: php_pcre.c,v 1.240 2008/09/02 19:13:24 nlopess Exp $ */ +/* $Id: php_pcre.c,v 1.241 2008/09/23 15:22:05 nlopess Exp $ */ /* TODO * php_pcre_replace_impl(): @@ -1023,7 +1023,6 @@ } else { esc_match = ; esc_match_len = 0; - match_len = 0; } smart_str_appendl(code, esc_match, esc_match_len); http://cvs.php.net/viewvc.cgi/php-src/ext/standard/array.c?r1=1.463r2=1.464diff_format=u Index: php-src/ext/standard/array.c diff -u php-src/ext/standard/array.c:1.463 php-src/ext/standard/array.c:1.464 --- php-src/ext/standard/array.c:1.463 Fri Aug 29 02:48:28 2008 +++ php-src/ext/standard/array.cTue Sep 23 15:22:05 2008 @@ -21,7 +21,7 @@ +--+ */ -/* $Id: array.c,v 1.463 2008/08/29 02:48:28 felipe Exp $ */ +/* $Id: array.c,v 1.464 2008/09/23 15:22:05 nlopess Exp $ */ #include php.h #include php_ini.h @@ -3574,7 +3574,6 @@ } else if (behavior DIFF_ASSOC) { /* triggered also if DIFF_KEY */ /* DIFF_KEY is subset of DIFF_ASSOC. When having the former * no comparison of the data is done (part of DIFF_ASSOC) */ - diff_key_compare_func = php_array_key_compare; if (data_compare_type == DIFF_COMP_DATA_INTERNAL key_compare_type == DIFF_COMP_KEY_INTERNAL) { /* array_diff_assoc() or array_diff_key() */ http://cvs.php.net/viewvc.cgi/php-src/ext/standard/base64.c?r1=1.55r2=1.56diff_format=u Index: php-src/ext/standard/base64.c diff -u php-src/ext/standard/base64.c:1.55 php-src/ext/standard/base64.c:1.56 --- php-src/ext/standard/base64.c:1.55 Mon Dec 31 07:12:15 2007 +++ php-src/ext/standard/base64.c Tue Sep 23 15:22:05 2008 @@ -15,7 +15,7 @@ | Author: Jim Winstead [EMAIL PROTECTED] | +--+ */ -/* $Id: base64.c,v 1.55
[PHP-CVS] cvs: php-src(PHP_5_3) /main php_compat.h
nlopess Sun Sep 14 14:15:52 2008 UTC Modified files: (Branch: PHP_5_3) /php-src/main php_compat.h Log: update list of pcre symbols http://cvs.php.net/viewvc.cgi/php-src/main/php_compat.h?r1=1.25.2.3.2.4.2.2r2=1.25.2.3.2.4.2.3diff_format=u Index: php-src/main/php_compat.h diff -u php-src/main/php_compat.h:1.25.2.3.2.4.2.2 php-src/main/php_compat.h:1.25.2.3.2.4.2.3 --- php-src/main/php_compat.h:1.25.2.3.2.4.2.2 Thu Jul 17 14:34:51 2008 +++ php-src/main/php_compat.h Sun Sep 14 14:15:52 2008 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: php_compat.h,v 1.25.2.3.2.4.2.2 2008/07/17 14:34:51 nlopess Exp $ */ +/* $Id: php_compat.h,v 1.25.2.3.2.4.2.3 2008/09/14 14:15:52 nlopess Exp $ */ #ifndef PHP_COMPAT_H #define PHP_COMPAT_H @@ -28,32 +28,30 @@ #endif #if defined(HAVE_BUNDLED_PCRE) || !defined(PHP_VERSION) -#define pcre_compile php_pcre_compile -#define pcre_compile2 php_pcre_compile2 +#define pcre_compile php_pcre_compile +#define pcre_compile2 php_pcre_compile2 #define pcre_copy_substringphp_pcre_copy_substring -#define pcre_exec php_pcre_exec +#define pcre_exec php_pcre_exec #define pcre_get_substring php_pcre_get_substring -#define pcre_get_substring_listphp_pcre_get_substring_list -#define pcre_info php_pcre_info +#define pcre_get_substring_listphp_pcre_get_substring_list +#define pcre_info php_pcre_info #define pcre_maketablesphp_pcre_maketables -#define pcre_study php_pcre_study +#define pcre_study php_pcre_study #define pcre_version php_pcre_version #define pcre_fullinfo php_pcre_fullinfo -#define pcre_free php_pcre_free -#define pcre_mallocphp_pcre_malloc -#define pcre_configphp_pcre_config -#define pcre_copy_named_substring php_pcre_copy_named_substring -#define pcre_free_substringphp_pcre_free_substring -#define pcre_free_substring_list php_pcre_free_substring_list -#define pcre_get_named_substring php_pcre_get_named_substring -#define pcre_get_stringnumber php_pcre_get_stringnumber -#define pcre_refcount php_pcre_refcount -#define _pcre_ord2utf8 php__pcre_ord2utf8 -#define _pcre_try_flipped php__pcre_try_flipped -#define _pcre_ucp_findprop php__pcre_ucp_findprop -#define _pcre_ucp_othercasephp__pcre_ucp_othercase -#define _pcre_valid_utf8 php__pcre_valid_utf8 -#define _pcre_xclass php__pcre_xclass +#define pcre_free php_pcre_free +#define pcre_mallocphp_pcre_malloc +#define pcre_configphp_pcre_config +#define pcre_copy_named_substring php_pcre_copy_named_substring +#define pcre_free_substringphp_pcre_free_substring +#define pcre_free_substring_list php_pcre_free_substring_list +#define pcre_get_named_substring php_pcre_get_named_substring +#define pcre_get_stringnumber php_pcre_get_stringnumber +#define pcre_refcount php_pcre_refcount +#define _pcre_ord2utf8 php__pcre_ord2utf8 +#define _pcre_try_flipped php__pcre_try_flipped +#define _pcre_valid_utf8 php__pcre_valid_utf8 +#define _pcre_xclass php__pcre_xclass #define pcre_callout php_pcre_callout #define _pcre_OP_lengths php__pcre_OP_lengths #define _pcre_utt_namesphp__pcre_utt_names @@ -70,6 +68,10 @@ #define _pcre_utt php__pcre_utt #define _pcre_utt_size php__pcre_utt_size #define _pcre_was_newline php__pcre_was_newline +#define _pcre_ucd_records php__pcre_ucd_records +#define _pcre_ucd_stage1 php__pcre_ucd_stage1 +#define _pcre_ucd_stage2 php__pcre_ucd_stage2 +#define _pcre_ucp_gentype php__pcre_ucp_gentype #endif #define lookup php_lookup -- 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/pcre php_pcre.c
nlopess Tue Sep 2 19:10:39 2008 UTC Modified files: (Branch: PHP_5_3) /php-src/ext/pcre php_pcre.c Log: kill dead variables. found by LLVM's clang static analyzer http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/php_pcre.c?r1=1.168.2.9.2.21.2.22r2=1.168.2.9.2.21.2.23diff_format=u Index: php-src/ext/pcre/php_pcre.c diff -u php-src/ext/pcre/php_pcre.c:1.168.2.9.2.21.2.22 php-src/ext/pcre/php_pcre.c:1.168.2.9.2.21.2.23 --- php-src/ext/pcre/php_pcre.c:1.168.2.9.2.21.2.22 Fri Aug 29 12:13:54 2008 +++ php-src/ext/pcre/php_pcre.c Tue Sep 2 19:10:38 2008 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: php_pcre.c,v 1.168.2.9.2.21.2.22 2008/08/29 12:13:54 helly Exp $ */ +/* $Id: php_pcre.c,v 1.168.2.9.2.21.2.23 2008/09/02 19:10:38 nlopess Exp $ */ #include php.h #include php_ini.h @@ -532,7 +532,6 @@ int matched; /* Has anything matched */ int g_notempty = 0;/* If the match should not be empty */ const char **stringlist;/* Holds list of subpatterns */ - char*match; /* The current match */ char **subpat_names; /* Array for named subpatterns */ int i, rc; int subpats_order; /* Order of subpattern matches */ @@ -611,7 +610,6 @@ } } - match = NULL; matched = 0; PCRE_G(error_code) = PHP_PCRE_NO_ERROR; @@ -632,7 +630,6 @@ /* If something has matched */ if (count 0) { matched++; - match = subject + offsets[0]; /* If subpatterns array has been passed, fill it in with values. */ if (subpats != NULL) { @@ -1451,8 +1448,7 @@ int start_offset; /* Where the new search starts */ int next_offset; /* End of the last delimiter match + 1 */ int g_notempty = 0;/* If the match should not be empty */ - char*match, /* The current match */ - *last_match;/* Location of last match */ + char*last_match;/* Location of last match */ int rc; int no_empty; /* If NO_EMPTY flag is set */ int delim_capture; /* If delimiters should be captured */ @@ -1489,7 +1485,6 @@ start_offset = 0; next_offset = 0; last_match = subject; - match = NULL; PCRE_G(error_code) = PHP_PCRE_NO_ERROR; /* Get next piece if no limit or limit not yet reached and something matched*/ @@ -1509,8 +1504,6 @@ /* If something matched */ if (count 0) { - match = subject + offsets[0]; - if (!no_empty || subject[offsets[0]] != last_match) { if (offset_capture) { -- 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
nlopess Tue Sep 2 19:13:24 2008 UTC Modified files: /php-src/ext/pcre php_pcre.c Log: MFB: kill unused var http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/php_pcre.c?r1=1.239r2=1.240diff_format=u Index: php-src/ext/pcre/php_pcre.c diff -u php-src/ext/pcre/php_pcre.c:1.239 php-src/ext/pcre/php_pcre.c:1.240 --- php-src/ext/pcre/php_pcre.c:1.239 Sun Aug 24 12:34:02 2008 +++ php-src/ext/pcre/php_pcre.c Tue Sep 2 19:13:24 2008 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: php_pcre.c,v 1.239 2008/08/24 12:34:02 helly Exp $ */ +/* $Id: php_pcre.c,v 1.240 2008/09/02 19:13:24 nlopess Exp $ */ /* TODO * php_pcre_replace_impl(): @@ -602,7 +602,6 @@ int matched; /* Has anything matched */ int g_notempty = 0;/* If the match should not be empty */ const char **stringlist;/* Holds list of subpatterns */ - char*match; /* The current match */ char **subpat_names; /* Array for named subpatterns */ int i, rc; int subpats_order; /* Order of subpattern matches */ @@ -696,7 +695,6 @@ } } - match = NULL; matched = 0; PCRE_G(error_code) = PHP_PCRE_NO_ERROR; @@ -717,7 +715,6 @@ /* If something has matched */ if (count 0) { matched++; - match = subject + offsets[0]; /* If subpatterns array has been passed, fill it in with values. */ if (subpats != NULL) { @@ -1636,8 +1633,7 @@ int start_offset; /* Where the new search starts */ int next_offset; /* End of the last delimiter match + 1 */ int g_notempty = 0;/* If the match should not be empty */ - char*match, /* The current match */ - *last_match;/* Location of last match */ + char*last_match;/* Location of last match */ int rc; int no_empty; /* If NO_EMPTY flag is set */ int delim_capture; /* If delimiters should be captured */ @@ -1675,7 +1671,6 @@ start_offset = 0; next_offset = 0; last_match = subject; - match = NULL; PCRE_G(error_code) = PHP_PCRE_NO_ERROR; if (utype != IS_UNICODE !(pce-compile_options PCRE_UTF8)) { @@ -1699,8 +1694,6 @@ /* If something matched */ if (count 0) { - match = subject + offsets[0]; - if (!no_empty || subject[offsets[0]] != last_match) { if (offset_capture) { -- 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/pcre/tests preg_filter.phpt
nlopess Sun Aug 31 15:28:35 2008 UTC Modified files: (Branch: PHP_5_3) /php-src/ext/pcre/tests preg_filter.phpt Log: remove unicode skipif, as the test doesnt require such support http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/tests/preg_filter.phpt?r1=1.1.2.2r2=1.1.2.3diff_format=u Index: php-src/ext/pcre/tests/preg_filter.phpt diff -u php-src/ext/pcre/tests/preg_filter.phpt:1.1.2.2 php-src/ext/pcre/tests/preg_filter.phpt:1.1.2.3 --- php-src/ext/pcre/tests/preg_filter.phpt:1.1.2.2 Fri Aug 29 12:13:54 2008 +++ php-src/ext/pcre/tests/preg_filter.phpt Sun Aug 31 15:28:35 2008 @@ -1,11 +1,5 @@ --TEST-- preg_filter() ---SKIPIF-- -?php -if (@preg_match_all('/./u', , $matches) === false) { - die(skip no utf8 support in PCRE library); -} -? --FILE-- ?php -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/pcre/tests preg_filter.phpt
nlopess Sun Aug 31 15:28:52 2008 UTC Modified files: /php-src/ext/pcre/tests preg_filter.phpt Log: MFB: remove extra skipif http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/tests/preg_filter.phpt?r1=1.1r2=1.2diff_format=u Index: php-src/ext/pcre/tests/preg_filter.phpt diff -u php-src/ext/pcre/tests/preg_filter.phpt:1.1 php-src/ext/pcre/tests/preg_filter.phpt:1.2 --- php-src/ext/pcre/tests/preg_filter.phpt:1.1 Sun Aug 24 12:34:02 2008 +++ php-src/ext/pcre/tests/preg_filter.phpt Sun Aug 31 15:28:52 2008 @@ -1,11 +1,5 @@ --TEST-- preg_filter() ---SKIPIF-- -?php -if (@preg_match_all('/./u', , $matches) === false) { - die(skip no utf8 support in PCRE library); -} -? --FILE-- ?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_3) / NEWS /ext/pcre php_pcre.c /ext/pcre/tests bug44925.phpt
nlopess Thu Aug 14 13:12:42 2008 UTC Added files: (Branch: PHP_5_3) /php-src/ext/pcre/tests bug44925.phpt Modified files: /php-srcNEWS /php-src/ext/pcre php_pcre.c Log: Fixed bug #44925 (preg_grep() modifies input array) http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.965.2.268r2=1.2027.2.547.2.965.2.269diff_format=u Index: php-src/NEWS diff -u php-src/NEWS:1.2027.2.547.2.965.2.268 php-src/NEWS:1.2027.2.547.2.965.2.269 --- php-src/NEWS:1.2027.2.547.2.965.2.268 Thu Aug 14 10:13:23 2008 +++ php-src/NEWSThu Aug 14 13:12:42 2008 @@ -30,6 +30,7 @@ - Fixed bug #45545 (DateInterval has 4 char limitation for ISO durations). (Derick) - Fixed bug #45044 (relative paths not resolved correctly). (Dmitry) +- Fixed bug #44925 (preg_grep() modifies input array). (Nuno) - Fixed bug #44100 (Inconsistent handling of static array declarations with duplicate keys). (Dmitry) - Fixed bug #43817 (opendir() fails on Windows directories with parent http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/php_pcre.c?r1=1.168.2.9.2.21.2.19r2=1.168.2.9.2.21.2.20diff_format=u Index: php-src/ext/pcre/php_pcre.c diff -u php-src/ext/pcre/php_pcre.c:1.168.2.9.2.21.2.19 php-src/ext/pcre/php_pcre.c:1.168.2.9.2.21.2.20 --- php-src/ext/pcre/php_pcre.c:1.168.2.9.2.21.2.19 Sat Aug 2 04:46:06 2008 +++ php-src/ext/pcre/php_pcre.c Thu Aug 14 13:12:42 2008 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: php_pcre.c,v 1.168.2.9.2.21.2.19 2008/08/02 04:46:06 felipe Exp $ */ +/* $Id: php_pcre.c,v 1.168.2.9.2.21.2.20 2008/08/14 13:12:42 nlopess Exp $ */ #include php.h #include php_ini.h @@ -1743,13 +1743,30 @@ /* Go through the input array */ zend_hash_internal_pointer_reset(Z_ARRVAL_P(input)); - while(zend_hash_get_current_data(Z_ARRVAL_P(input), (void **)entry) == SUCCESS) { + while (zend_hash_get_current_data(Z_ARRVAL_P(input), (void **)entry) == SUCCESS) { + zend_bool is_copy; + zval *str; + + switch (Z_TYPE_PP(entry)) { + case IS_STRING: + is_copy = 0; + str = *entry; + break; + + default: + is_copy = 1; - convert_to_string_ex(entry); + ALLOC_ZVAL(str); + Z_ADDREF_PP(entry); /* the function below decreases the ref counting */ + COPY_PZVAL_TO_ZVAL(*str, *entry); + + convert_to_string(str); + break; + } /* Perform the match */ - count = pcre_exec(pce-re, extra, Z_STRVAL_PP(entry), - Z_STRLEN_PP(entry), 0, + count = pcre_exec(pce-re, extra, Z_STRVAL_P(str), + Z_STRLEN_P(str), 0, 0, offsets, size_offsets); /* Check for too many substrings condition. */ @@ -1762,25 +1779,30 @@ } /* If the entry fits our requirements */ - if ((count 0 !invert) || - (count == PCRE_ERROR_NOMATCH invert)) { - Z_ADDREF_PP(entry); + if ((count 0 !invert) || (count == PCRE_ERROR_NOMATCH invert)) { + + if (!is_copy) { + SEPARATE_ARG_IF_REF(str); + } /* Add to return array */ switch (zend_hash_get_current_key(Z_ARRVAL_P(input), string_key, num_key, 0)) { case HASH_KEY_IS_STRING: zend_hash_update(Z_ARRVAL_P(return_value), string_key, - strlen(string_key)+1, entry, sizeof(zval *), NULL); + strlen(string_key)+1, str, sizeof(zval *), NULL); break; case HASH_KEY_IS_LONG: - zend_hash_index_update(Z_ARRVAL_P(return_value), num_key, entry, + zend_hash_index_update(Z_ARRVAL_P(return_value), num_key, str, sizeof(zval *), NULL); break; } + } else if (is_copy) { + zval_dtor(str); + FREE_ZVAL(str); } - +
[PHP-CVS] cvs: php-src /ext/pcre php_pcre.c /ext/pcre/tests bug44925.phpt
nlopess Thu Aug 14 14:35:23 2008 UTC Modified files: /php-src/ext/pcre php_pcre.c /php-src/ext/pcre/tests bug44925.phpt Log: sync with 5.3 branch. add test for bug #44925 http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/php_pcre.c?r1=1.237r2=1.238diff_format=u Index: php-src/ext/pcre/php_pcre.c diff -u php-src/ext/pcre/php_pcre.c:1.237 php-src/ext/pcre/php_pcre.c:1.238 --- php-src/ext/pcre/php_pcre.c:1.237 Sat Aug 2 04:40:44 2008 +++ php-src/ext/pcre/php_pcre.c Thu Aug 14 14:35:22 2008 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: php_pcre.c,v 1.237 2008/08/02 04:40:44 felipe Exp $ */ +/* $Id: php_pcre.c,v 1.238 2008/08/14 14:35:22 nlopess Exp $ */ /* TODO * php_pcre_replace_impl(): @@ -1976,9 +1976,8 @@ /* Go through the input array */ zend_hash_internal_pointer_reset(Z_ARRVAL_P(input)); while(zend_hash_get_current_data(Z_ARRVAL_P(input), (void **)entry) == SUCCESS) { - zval subject; + zval subject = **entry; - subject = **entry; if (Z_TYPE_PP(entry) != IS_STRING) { zval_copy_ctor(subject); convert_to_string_with_converter(subject, UG(utf8_conv)); @@ -2001,8 +2000,8 @@ } /* If the entry fits our requirements */ - if ((count 0 !invert) || - (count == PCRE_ERROR_NOMATCH invert)) { + if ((count 0 !invert) || (count == PCRE_ERROR_NOMATCH invert)) { + Z_ADDREF_PP(entry); /* Add to return array */ http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/tests/bug44925.phpt?r1=1.1r2=1.2diff_format=u Index: php-src/ext/pcre/tests/bug44925.phpt diff -u /dev/null php-src/ext/pcre/tests/bug44925.phpt:1.2 --- /dev/null Thu Aug 14 14:35:23 2008 +++ php-src/ext/pcre/tests/bug44925.phptThu Aug 14 14:35:22 2008 @@ -0,0 +1,107 @@ +--TEST-- +Bug #44925 (preg_grep() modifies input array) +--FILE-- +?php +$str1 = 'a'; +$str2 = 'b'; + +$array=Array(1,2,3,1.1,FALSE,NULL,Array(), $str1, $str2); + +var_dump($array); + +var_dump(preg_grep('/do not match/',$array)); + +$a = preg_grep('/./',$array); +var_dump($a); + +$str1 = 'x'; +$str2 = 'y'; + +var_dump($a); // check if array is still ok + +var_dump($array); + +? +--EXPECTF-- +array(9) { + [0]= + unicode(1) 1 + [1]= + int(2) + [2]= + int(3) + [3]= + float(1.1) + [4]= + bool(false) + [5]= + NULL + [6]= + array(0) { + } + [7]= + unicode(1) a + [8]= + unicode(1) b +} + +Notice: Array to string conversion in %sbug44925.php on line 9 +array(0) { +} + +Notice: Array to string conversion in %sbug44925.php on line 11 +array(7) { + [0]= + unicode(1) 1 + [1]= + int(2) + [2]= + int(3) + [3]= + float(1.1) + [6]= + array(0) { + } + [7]= + unicode(1) a + [8]= + unicode(1) b +} +array(7) { + [0]= + unicode(1) 1 + [1]= + int(2) + [2]= + int(3) + [3]= + float(1.1) + [6]= + array(0) { + } + [7]= + unicode(1) a + [8]= + unicode(1) y +} +array(9) { + [0]= + unicode(1) 1 + [1]= + int(2) + [2]= + int(3) + [3]= + float(1.1) + [4]= + bool(false) + [5]= + NULL + [6]= + array(0) { + } + [7]= + unicode(1) a + [8]= + unicode(1) y +} -- 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/pcre php_pcre.c /ext/pcre/tests bug44925.phpt
nlopess Thu Aug 14 14:37:39 2008 UTC Modified files: (Branch: PHP_5_3) /php-src/ext/pcre php_pcre.c /php-src/ext/pcre/tests bug44925.phpt Log: after rereading the documentation about preg_grep(), lets match the behavior in HEAD (return the original array elements instead of the new string). tune the test accordingly http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/php_pcre.c?r1=1.168.2.9.2.21.2.20r2=1.168.2.9.2.21.2.21diff_format=u Index: php-src/ext/pcre/php_pcre.c diff -u php-src/ext/pcre/php_pcre.c:1.168.2.9.2.21.2.20 php-src/ext/pcre/php_pcre.c:1.168.2.9.2.21.2.21 --- php-src/ext/pcre/php_pcre.c:1.168.2.9.2.21.2.20 Thu Aug 14 13:12:42 2008 +++ php-src/ext/pcre/php_pcre.c Thu Aug 14 14:37:39 2008 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: php_pcre.c,v 1.168.2.9.2.21.2.20 2008/08/14 13:12:42 nlopess Exp $ */ +/* $Id: php_pcre.c,v 1.168.2.9.2.21.2.21 2008/08/14 14:37:39 nlopess Exp $ */ #include php.h #include php_ini.h @@ -1744,29 +1744,16 @@ /* Go through the input array */ zend_hash_internal_pointer_reset(Z_ARRVAL_P(input)); while (zend_hash_get_current_data(Z_ARRVAL_P(input), (void **)entry) == SUCCESS) { - zend_bool is_copy; - zval *str; + zval subject = **entry; - switch (Z_TYPE_PP(entry)) { - case IS_STRING: - is_copy = 0; - str = *entry; - break; - - default: - is_copy = 1; - - ALLOC_ZVAL(str); - Z_ADDREF_PP(entry); /* the function below decreases the ref counting */ - COPY_PZVAL_TO_ZVAL(*str, *entry); - - convert_to_string(str); - break; + if (Z_TYPE_PP(entry) != IS_STRING) { + zval_copy_ctor(subject); + convert_to_string(subject); } /* Perform the match */ - count = pcre_exec(pce-re, extra, Z_STRVAL_P(str), - Z_STRLEN_P(str), 0, + count = pcre_exec(pce-re, extra, Z_STRVAL(subject), + Z_STRLEN(subject), 0, 0, offsets, size_offsets); /* Check for too many substrings condition. */ @@ -1781,26 +1768,25 @@ /* If the entry fits our requirements */ if ((count 0 !invert) || (count == PCRE_ERROR_NOMATCH invert)) { - if (!is_copy) { - SEPARATE_ARG_IF_REF(str); - } + Z_ADDREF_PP(entry); /* Add to return array */ switch (zend_hash_get_current_key(Z_ARRVAL_P(input), string_key, num_key, 0)) { case HASH_KEY_IS_STRING: zend_hash_update(Z_ARRVAL_P(return_value), string_key, - strlen(string_key)+1, str, sizeof(zval *), NULL); + strlen(string_key)+1, entry, sizeof(zval *), NULL); break; case HASH_KEY_IS_LONG: - zend_hash_index_update(Z_ARRVAL_P(return_value), num_key, str, + zend_hash_index_update(Z_ARRVAL_P(return_value), num_key, entry, sizeof(zval *), NULL); break; } - } else if (is_copy) { - zval_dtor(str); - FREE_ZVAL(str); + } + + if (Z_TYPE_PP(entry) != IS_STRING) { + zval_dtor(subject); } zend_hash_move_forward(Z_ARRVAL_P(input)); http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/tests/bug44925.phpt?r1=1.1.2.1r2=1.1.2.2diff_format=u Index: php-src/ext/pcre/tests/bug44925.phpt diff -u php-src/ext/pcre/tests/bug44925.phpt:1.1.2.1 php-src/ext/pcre/tests/bug44925.phpt:1.1.2.2 --- php-src/ext/pcre/tests/bug44925.phpt:1.1.2.1Thu Aug 14 13:12:42 2008 +++ php-src/ext/pcre/tests/bug44925.phptThu Aug 14 14:37:39 2008 @@ -54,33 +54,35 @@ [0]= string(1) 1 [1]= - string(1) 2 + int(2) [2]= - string(1) 3 + int(3) [3]= - string(3) 1.1 + float(1.1) [6]= - string(5) Array + array(0) { + } [7]= string(1) a [8]= - string(1) b +
Re: [PHP-CVS] cvs: php-src(PHP_5_3) / NEWS /ext/pcre php_pcre.c /ext/pcre/tests bug44925.phpt
I think this change is too intrusive for a bug fix only branch. This introduces a little BC break (to better match the manual description), so I think it should only go with 5.3. Nuno - Original Message - Doesn't this bug exist in PHP_5_2 branch? That's not (AFAIK) dead branch yet so bug fixes MUST go there too. In which case you move that NEWS entry to the PHP_5_2 NEWS.. --Jani Nuno Lopes [EMAIL PROTECTED] kirjoitti: nlopess Thu Aug 14 13:12:42 2008 UTC Added files: (Branch: PHP_5_3) /php-src/ext/pcre/tests bug44925.phpt Modified files: /php-src NEWS /php-src/ext/pcre php_pcre.c Log: Fixed bug #44925 (preg_grep() modifies input array) http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.965.2.268r2=1.2027.2.547.2.965.2.269diff_format=u Index: php-src/NEWS diff -u php-src/NEWS:1.2027.2.547.2.965.2.268 php-src/NEWS:1.2027.2.547.2.965.2.269 --- php-src/NEWS:1.2027.2.547.2.965.2.268 Thu Aug 14 10:13:23 2008 +++ php-src/NEWS Thu Aug 14 13:12:42 2008 @@ -30,6 +30,7 @@ - Fixed bug #45545 (DateInterval has 4 char limitation for ISO durations). (Derick) - Fixed bug #45044 (relative paths not resolved correctly). (Dmitry) +- Fixed bug #44925 (preg_grep() modifies input array). (Nuno) - Fixed bug #44100 (Inconsistent handling of static array declarations with duplicate keys). (Dmitry) - Fixed bug #43817 (opendir() fails on Windows directories with parent http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/php_pcre.c?r1=1.168.2.9.2.21.2.19r2=1.168.2.9.2.21.2.20diff_format=u Index: php-src/ext/pcre/php_pcre.c diff -u php-src/ext/pcre/php_pcre.c:1.168.2.9.2.21.2.19 php-src/ext/pcre/php_pcre.c:1.168.2.9.2.21.2.20 --- php-src/ext/pcre/php_pcre.c:1.168.2.9.2.21.2.19 Sat Aug 2 04:46:06 2008 +++ php-src/ext/pcre/php_pcre.c Thu Aug 14 13:12:42 2008 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: php_pcre.c,v 1.168.2.9.2.21.2.19 2008/08/02 04:46:06 felipe Exp $ */ +/* $Id: php_pcre.c,v 1.168.2.9.2.21.2.20 2008/08/14 13:12:42 nlopess Exp $ */ #include php.h #include php_ini.h @@ -1743,13 +1743,30 @@ /* Go through the input array */ zend_hash_internal_pointer_reset(Z_ARRVAL_P(input)); - while(zend_hash_get_current_data(Z_ARRVAL_P(input), (void **)entry) == SUCCESS) { + while (zend_hash_get_current_data(Z_ARRVAL_P(input), (void **)entry) == SUCCESS) { + zend_bool is_copy; + zval *str; + + switch (Z_TYPE_PP(entry)) { + case IS_STRING: + is_copy = 0; + str = *entry; + break; + + default: + is_copy = 1; - convert_to_string_ex(entry); + ALLOC_ZVAL(str); + Z_ADDREF_PP(entry); /* the function below decreases the ref counting */ + COPY_PZVAL_TO_ZVAL(*str, *entry); + + convert_to_string(str); + break; + } /* Perform the match */ - count = pcre_exec(pce-re, extra, Z_STRVAL_PP(entry), - Z_STRLEN_PP(entry), 0, + count = pcre_exec(pce-re, extra, Z_STRVAL_P(str), + Z_STRLEN_P(str), 0, 0, offsets, size_offsets); /* Check for too many substrings condition. */ @@ -1762,25 +1779,30 @@ } /* If the entry fits our requirements */ - if ((count 0 !invert) || - (count == PCRE_ERROR_NOMATCH invert)) { - Z_ADDREF_PP(entry); + if ((count 0 !invert) || (count == PCRE_ERROR_NOMATCH invert)) { + + if (!is_copy) { + SEPARATE_ARG_IF_REF(str); + } /* Add to return array */ switch (zend_hash_get_current_key(Z_ARRVAL_P(input), string_key, num_key, 0)) { case HASH_KEY_IS_STRING: zend_hash_update(Z_ARRVAL_P(return_value), string_key, - strlen(string_key)+1, entry, sizeof(zval *), NULL); + strlen(string_key)+1, str, sizeof(zval *), NULL); break; case HASH_KEY_IS_LONG: - zend_hash_index_update(Z_ARRVAL_P(return_value), num_key, entry, + zend_hash_index_update(Z_ARRVAL_P(return_value), num_key, str, sizeof(zval *), NULL); break; } + } else if (is_copy) { + zval_dtor(str); + FREE_ZVAL(str); } - + zend_hash_move_forward(Z_ARRVAL_P(input)); } zend_hash_internal_pointer_reset(Z_ARRVAL_P(input)); http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/tests/bug44925.phpt?view=markuprev=1.1 Index: php-src/ext/pcre/tests/bug44925.phpt +++ php-src/ext/pcre/tests/bug44925.phpt -- 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/curl/tests .cvsignore
nlopess Mon Aug 11 15:18:47 2008 UTC Added files: /php-src/ext/curl/tests .cvsignore Log: add http://cvs.php.net/viewvc.cgi/php-src/ext/curl/tests/.cvsignore?view=markuprev=1.1 Index: php-src/ext/curl/tests/.cvsignore +++ php-src/ext/curl/tests/.cvsignore *.mem *.diff *.log *.exp *.out *.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_3) /ext/curl/tests .cvsignore
nlopess Mon Aug 11 15:20:57 2008 UTC Added files: (Branch: PHP_5_3) /php-src/ext/curl/tests .cvsignore Log: add http://cvs.php.net/viewvc.cgi/php-src/ext/curl/tests/.cvsignore?view=markuprev=1.1 Index: php-src/ext/curl/tests/.cvsignore +++ php-src/ext/curl/tests/.cvsignore *.mem *.diff *.log *.exp *.out *.php -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/mbstring mbstring.c
nlopess Mon Aug 11 15:40:41 2008 UTC Modified files: /php-src/ext/mbstring mbstring.c Log: fix build when host machine doest has pcre installed http://cvs.php.net/viewvc.cgi/php-src/ext/mbstring/mbstring.c?r1=1.295r2=1.296diff_format=u Index: php-src/ext/mbstring/mbstring.c diff -u php-src/ext/mbstring/mbstring.c:1.295 php-src/ext/mbstring/mbstring.c:1.296 --- php-src/ext/mbstring/mbstring.c:1.295 Mon Aug 4 21:10:17 2008 +++ php-src/ext/mbstring/mbstring.c Mon Aug 11 15:40:41 2008 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: mbstring.c,v 1.295 2008/08/04 21:10:17 moriyoshi Exp $ */ +/* $Id: mbstring.c,v 1.296 2008/08/11 15:40:41 nlopess Exp $ */ /* * PHP 4 Multibyte String module mbstring @@ -86,7 +86,7 @@ #include oniguruma.h #undef UChar #elif HAVE_PCRE || HAVE_BUNDLED_PCRE -#include pcre.h +#include ext/pcre/php_pcre.h #endif /* }}} */ -- 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/mbstring mbstring.c
nlopess Mon Aug 11 15:42:35 2008 UTC Modified files: (Branch: PHP_5_3) /php-src/ext/mbstring mbstring.c Log: MFH: fix build when pcre is not present http://cvs.php.net/viewvc.cgi/php-src/ext/mbstring/mbstring.c?r1=1.224.2.22.2.25.2.29r2=1.224.2.22.2.25.2.30diff_format=u Index: php-src/ext/mbstring/mbstring.c diff -u php-src/ext/mbstring/mbstring.c:1.224.2.22.2.25.2.29 php-src/ext/mbstring/mbstring.c:1.224.2.22.2.25.2.30 --- php-src/ext/mbstring/mbstring.c:1.224.2.22.2.25.2.29Mon Aug 4 21:06:13 2008 +++ php-src/ext/mbstring/mbstring.c Mon Aug 11 15:42:35 2008 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: mbstring.c,v 1.224.2.22.2.25.2.29 2008/08/04 21:06:13 moriyoshi Exp $ */ +/* $Id: mbstring.c,v 1.224.2.22.2.25.2.30 2008/08/11 15:42:35 nlopess Exp $ */ /* * PHP 4 Multibyte String module mbstring @@ -86,7 +86,7 @@ #include oniguruma.h #undef UChar #elif HAVE_PCRE || HAVE_BUNDLED_PCRE -#include pcre.h +#include ext/pcre/php_pcre.h #endif /* }}} */ -- 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 browscap.c
nlopess Thu Aug 7 12:50:17 2008 UTC Modified files: (Branch: PHP_5_3) /php-src/ext/standard browscap.c Log: upgrade to PCRE (i.e. get ride of ereg usage) http://cvs.php.net/viewvc.cgi/php-src/ext/standard/browscap.c?r1=1.85.2.2.2.3.2.6r2=1.85.2.2.2.3.2.7diff_format=u Index: php-src/ext/standard/browscap.c diff -u php-src/ext/standard/browscap.c:1.85.2.2.2.3.2.6 php-src/ext/standard/browscap.c:1.85.2.2.2.3.2.7 --- php-src/ext/standard/browscap.c:1.85.2.2.2.3.2.6Thu Jul 24 19:52:24 2008 +++ php-src/ext/standard/browscap.c Thu Aug 7 12:50:17 2008 @@ -16,13 +16,13 @@ +--+ */ -/* $Id: browscap.c,v 1.85.2.2.2.3.2.6 2008/07/24 19:52:24 felipe Exp $ */ +/* $Id: browscap.c,v 1.85.2.2.2.3.2.7 2008/08/07 12:50:17 nlopess Exp $ */ #include php.h #include php_browscap.h #include php_ini.h #include php_string.h -#include ext/ereg/php_regex.h +#include ext/pcre/php_pcre.h #include zend_ini_scanner.h #include zend_globals.h @@ -51,16 +51,17 @@ static void convert_browscap_pattern(zval *pattern) /* {{{ */ { - register int i, j; + int i, j=0; char *t; php_strtolower(Z_STRVAL_P(pattern), Z_STRLEN_P(pattern)); - t = (char *) safe_pemalloc(Z_STRLEN_P(pattern), 2, 3, 1); + t = (char *) safe_pemalloc(Z_STRLEN_P(pattern), 2, 5, 1); - t[0] = '^'; + t[j++] = '§'; + t[j++] = '^'; - for (i=0, j=1; iZ_STRLEN_P(pattern); i++, j++) { + for (i=0; iZ_STRLEN_P(pattern); i++, j++) { switch (Z_STRVAL_P(pattern)[i]) { case '?': t[j] = '.'; @@ -73,6 +74,22 @@ t[j++] = '\\'; t[j] = '.'; break; + case '\\': + t[j++] = '\\'; + t[j] = '\\'; + break; + case '(': + t[j++] = '\\'; + t[j] = '('; + break; + case ')': + t[j++] = '\\'; + t[j] = ')'; + break; + case '§': + t[j++] = '\\'; + t[j] = '§'; + break; default: t[j] = Z_STRVAL_P(pattern)[i]; break; @@ -80,6 +97,7 @@ } t[j++] = '$'; + t[j++] = '§'; t[j]=0; Z_STRVAL_P(pattern) = t; @@ -215,8 +233,11 @@ static int browser_reg_compare(zval **browser TSRMLS_DC, int num_args, va_list args, zend_hash_key *key) /* {{{ */ { zval **browser_regex, **previous_match; - regex_t r; + pcre *re; + int re_options; + pcre_extra *re_extra; char *lookup_browser_name = va_arg(args, char *); + int lookup_browser_length = va_arg(args, int); zval **found_browser_entry = va_arg(args, zval **); /* See if we have an exact match, if so, we're done... */ @@ -233,10 +254,12 @@ return 0; } - if (regcomp(r, Z_STRVAL_PP(browser_regex), REG_NOSUB) != 0) { + re = pcre_get_compiled_regex(Z_STRVAL_PP(browser_regex), re_extra, re_options TSRMLS_CC); + if (re == NULL) { return 0; } - if (regexec(r, lookup_browser_name, 0, NULL, 0) == 0) { + + if (pcre_exec(re, re_extra, lookup_browser_name, lookup_browser_length, 0, re_options, NULL, 0) == 0) { /* If we've found a possible browser, we need to do a comparison of the number of characters changed in the user agent being checked versus the previous match found and the current match. */ @@ -245,11 +268,10 @@ zval **current_match; if (zend_hash_find(Z_ARRVAL_PP(browser), browser_name_pattern, sizeof(browser_name_pattern), (void**) current_match) == FAILURE) { - regfree(r); return 0; } - ua_len = strlen(lookup_browser_name); + ua_len = lookup_browser_length; for (i = 0; i Z_STRLEN_PP(previous_match); i++) { switch (Z_STRVAL_PP(previous_match)[i]) { @@ -286,10 +308,6 @@ } } - if (r) { - regfree(r); - } - return 0; } /* }}} */ @@ -329,7 +347,7 @@ if (zend_hash_find(browser_hash, lookup_browser_name, agent_name_len + 1, (void **) agent) == FAILURE) { found_browser_entry = NULL; -
[PHP-CVS] cvs: php-src /ext/standard browscap.c
nlopess Thu Aug 7 12:51:05 2008 UTC Modified files: /php-src/ext/standard browscap.c Log: MFB: upgrade to PCRE http://cvs.php.net/viewvc.cgi/php-src/ext/standard/browscap.c?r1=1.99r2=1.100diff_format=u Index: php-src/ext/standard/browscap.c diff -u php-src/ext/standard/browscap.c:1.99 php-src/ext/standard/browscap.c:1.100 --- php-src/ext/standard/browscap.c:1.99Thu Jul 24 19:50:23 2008 +++ php-src/ext/standard/browscap.c Thu Aug 7 12:51:05 2008 @@ -16,13 +16,13 @@ +--+ */ -/* $Id: browscap.c,v 1.99 2008/07/24 19:50:23 felipe Exp $ */ +/* $Id: browscap.c,v 1.100 2008/08/07 12:51:05 nlopess Exp $ */ #include php.h #include php_browscap.h #include php_ini.h #include php_string.h -#include ext/ereg/php_regex.h +#include ext/pcre/php_pcre.h #include zend_ini_scanner.h #include zend_globals.h @@ -51,16 +51,17 @@ static void convert_browscap_pattern(zval *pattern) /* {{{ */ { - register int i, j; + int i, j=0; char *t; php_strtolower(Z_STRVAL_P(pattern), Z_STRLEN_P(pattern)); - t = (char *) safe_pemalloc(Z_STRLEN_P(pattern), 2, 3, 1); + t = (char *) safe_pemalloc(Z_STRLEN_P(pattern), 2, 5, 1); - t[0] = '^'; + t[j++] = '§'; + t[j++] = '^'; - for (i=0, j=1; iZ_STRLEN_P(pattern); i++, j++) { + for (i=0; iZ_STRLEN_P(pattern); i++, j++) { switch (Z_STRVAL_P(pattern)[i]) { case '?': t[j] = '.'; @@ -73,6 +74,22 @@ t[j++] = '\\'; t[j] = '.'; break; + case '\\': + t[j++] = '\\'; + t[j] = '\\'; + break; + case '(': + t[j++] = '\\'; + t[j] = '('; + break; + case ')': + t[j++] = '\\'; + t[j] = ')'; + break; + case '§': + t[j++] = '\\'; + t[j] = '§'; + break; default: t[j] = Z_STRVAL_P(pattern)[i]; break; @@ -80,6 +97,7 @@ } t[j++] = '$'; + t[j++] = '§'; t[j]=0; Z_STRVAL_P(pattern) = t; @@ -215,8 +233,11 @@ static int browser_reg_compare(zval **browser TSRMLS_DC, int num_args, va_list args, zend_hash_key *key) /* {{{ */ { zval **browser_regex, **previous_match; - regex_t r; + pcre *re; + int re_options; + pcre_extra *re_extra; char *lookup_browser_name = va_arg(args, char *); + int lookup_browser_length = va_arg(args, int); zval **found_browser_entry = va_arg(args, zval **); /* See if we have an exact match, if so, we're done... */ @@ -233,10 +254,12 @@ return 0; } - if (regcomp(r, Z_STRVAL_PP(browser_regex), REG_NOSUB) != 0) { + re = pcre_get_compiled_regex(Z_STRVAL_PP(browser_regex), re_extra, re_options TSRMLS_CC); + if (re == NULL) { return 0; } - if (regexec(r, lookup_browser_name, 0, NULL, 0) == 0) { + + if (pcre_exec(re, re_extra, lookup_browser_name, lookup_browser_length, 0, re_options, NULL, 0) == 0) { /* If we've found a possible browser, we need to do a comparison of the number of characters changed in the user agent being checked versus the previous match found and the current match. */ @@ -245,11 +268,10 @@ zval **current_match; if (zend_hash_find(Z_ARRVAL_PP(browser), browser_name_pattern, sizeof(browser_name_pattern), (void**) current_match) == FAILURE) { - regfree(r); return 0; } - ua_len = strlen(lookup_browser_name); + ua_len = lookup_browser_length; for (i = 0; i Z_STRLEN_PP(previous_match); i++) { switch (Z_STRVAL_PP(previous_match)[i]) { @@ -286,10 +308,6 @@ } } - if (r) { - regfree(r); - } - return 0; } /* }}} */ @@ -329,7 +347,7 @@ if (zend_hash_find(browser_hash, lookup_browser_name, agent_name_len + 1, (void **) agent) == FAILURE) { found_browser_entry = NULL; - zend_hash_apply_with_arguments(browser_hash TSRMLS_CC, (apply_func_args_t) browser_reg_compare, 2, lookup_browser_name, found_browser_entry); +
[PHP-CVS] cvs: php-src(PHP_5_3) /sapi/litespeed config.m4
nlopess Thu Aug 7 19:32:15 2008 UTC Modified files: (Branch: PHP_5_3) /php-src/sapi/litespeed config.m4 Log: fix this, so that I can build php without litespeed.. http://cvs.php.net/viewvc.cgi/php-src/sapi/litespeed/config.m4?r1=1.2.2.3r2=1.2.2.4diff_format=u Index: php-src/sapi/litespeed/config.m4 diff -u php-src/sapi/litespeed/config.m4:1.2.2.3 php-src/sapi/litespeed/config.m4:1.2.2.4 --- php-src/sapi/litespeed/config.m4:1.2.2.3Thu Aug 7 16:41:30 2008 +++ php-src/sapi/litespeed/config.m4Thu Aug 7 19:32:15 2008 @@ -1,18 +1,13 @@ dnl -dnl $Id: config.m4,v 1.2.2.3 2008/08/07 16:41:30 gwang Exp $ +dnl $Id: config.m4,v 1.2.2.4 2008/08/07 19:32:15 nlopess Exp $ dnl AC_MSG_CHECKING(for LiteSpeed support) -PHP_ARG_WITH(litespeed, -[ --with-litespeedBuild PHP as litespeed module], -[ - PHP_SAPI_LITESPEED=$withval -],[ - PHP_SAPI_LITESPEED=no -]) +PHP_ARG_WITH(litespeed,, +[ --with-litespeedBuild PHP as litespeed module], no) -if test $PHP_SAPI_LITESPEED != no; then +if test $PHP_LITESPEED != no; then PHP_ADD_MAKEFILE_FRAGMENT($abs_srcdir/sapi/litespeed/Makefile.frag,$abs_srcdir/sapi/litespeed,sapi/litespeed) SAPI_LITESPEED_PATH=sapi/litespeed/php PHP_SUBST(SAPI_LITESPEED_PATH) @@ -33,4 +28,4 @@ PHP_SUBST(BUILD_LITESPEED) fi -AC_MSG_RESULT($PHP_SAPI_LITESPEED) +AC_MSG_RESULT($PHP_LITESPEED) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /sapi/litespeed config.m4
nlopess Thu Aug 7 19:32:48 2008 UTC Modified files: /php-src/sapi/litespeed config.m4 Log: MFB: fix build http://cvs.php.net/viewvc.cgi/php-src/sapi/litespeed/config.m4?r1=1.3r2=1.4diff_format=u Index: php-src/sapi/litespeed/config.m4 diff -u php-src/sapi/litespeed/config.m4:1.3 php-src/sapi/litespeed/config.m4:1.4 --- php-src/sapi/litespeed/config.m4:1.3Thu Aug 7 16:41:30 2008 +++ php-src/sapi/litespeed/config.m4Thu Aug 7 19:32:48 2008 @@ -1,18 +1,13 @@ dnl -dnl $Id: config.m4,v 1.3 2008/08/07 16:41:30 gwang Exp $ +dnl $Id: config.m4,v 1.4 2008/08/07 19:32:48 nlopess Exp $ dnl AC_MSG_CHECKING(for LiteSpeed support) -PHP_ARG_WITH(litespeed, -[ --with-litespeedBuild PHP as litespeed module], -[ - PHP_SAPI_LITESPEED=$withval -],[ - PHP_SAPI_LITESPEED=no -]) +PHP_ARG_WITH(litespeed,, +[ --with-litespeedBuild PHP as litespeed module], no) -if test $PHP_SAPI_LITESPEED != no; then +if test $PHP_LITESPEED != no; then PHP_ADD_MAKEFILE_FRAGMENT($abs_srcdir/sapi/litespeed/Makefile.frag,$abs_srcdir/sapi/litespeed,sapi/litespeed) SAPI_LITESPEED_PATH=sapi/litespeed/php PHP_SUBST(SAPI_LITESPEED_PATH) @@ -33,4 +28,4 @@ PHP_SUBST(BUILD_LITESPEED) fi -AC_MSG_RESULT($PHP_SAPI_LITESPEED) +AC_MSG_RESULT($PHP_LITESPEED) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_4_4) /main php_compat.h
nlopess Thu Jul 17 14:33:36 2008 UTC Modified files: (Branch: PHP_4_4) /php-src/main php_compat.h Log: update PCRE symbols http://cvs.php.net/viewvc.cgi/php-src/main/php_compat.h?r1=1.11.4.6.2.4r2=1.11.4.6.2.5diff_format=u Index: php-src/main/php_compat.h diff -u php-src/main/php_compat.h:1.11.4.6.2.4 php-src/main/php_compat.h:1.11.4.6.2.5 --- php-src/main/php_compat.h:1.11.4.6.2.4 Sun Feb 25 18:50:16 2007 +++ php-src/main/php_compat.h Thu Jul 17 14:33:36 2008 @@ -36,8 +36,8 @@ #define _pcre_xclass php__pcre_xclass #define pcre_callout php_pcre_callout #define _pcre_OP_lengths php__pcre_OP_lengths -/* this one doesn't work because pcre.h isn't included from the pcre_chartables.c file -#define _pcre_default_tables php__pcre_default_tables */ +#define _pcre_utt_namesphp__pcre_utt_names +#define _pcre_default_tables php__pcre_default_tables #define pcre_get_stringtable_entries php_pcre_get_stringtable_entries #define _pcre_is_newline php__pcre_is_newline #define pcre_stack_freephp_pcre_stack_free -- 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) /main php_compat.h
nlopess Thu Jul 17 14:34:51 2008 UTC Modified files: (Branch: PHP_5_3) /php-src/main php_compat.h Log: update PCRE symbols http://cvs.php.net/viewvc.cgi/php-src/main/php_compat.h?r1=1.25.2.3.2.4.2.1r2=1.25.2.3.2.4.2.2diff_format=u Index: php-src/main/php_compat.h diff -u php-src/main/php_compat.h:1.25.2.3.2.4.2.1 php-src/main/php_compat.h:1.25.2.3.2.4.2.2 --- php-src/main/php_compat.h:1.25.2.3.2.4.2.1 Mon Dec 31 07:17:17 2007 +++ php-src/main/php_compat.h Thu Jul 17 14:34:51 2008 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: php_compat.h,v 1.25.2.3.2.4.2.1 2007/12/31 07:17:17 sebastian Exp $ */ +/* $Id: php_compat.h,v 1.25.2.3.2.4.2.2 2008/07/17 14:34:51 nlopess Exp $ */ #ifndef PHP_COMPAT_H #define PHP_COMPAT_H @@ -56,8 +56,8 @@ #define _pcre_xclass php__pcre_xclass #define pcre_callout php_pcre_callout #define _pcre_OP_lengths php__pcre_OP_lengths -/* this one doesn't work because pcre.h isn't included from the pcre_chartables.c file -#define _pcre_default_tables php__pcre_default_tables */ +#define _pcre_utt_namesphp__pcre_utt_names +#define _pcre_default_tables php__pcre_default_tables #define pcre_get_stringtable_entries php_pcre_get_stringtable_entries #define _pcre_is_newline php__pcre_is_newline #define pcre_stack_freephp_pcre_stack_free -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /main php_compat.h
nlopess Thu Jul 17 14:35:33 2008 UTC Modified files: /php-src/main php_compat.h Log: update PCRE symbols http://cvs.php.net/viewvc.cgi/php-src/main/php_compat.h?r1=1.34r2=1.35diff_format=u Index: php-src/main/php_compat.h diff -u php-src/main/php_compat.h:1.34 php-src/main/php_compat.h:1.35 --- php-src/main/php_compat.h:1.34 Mon Dec 31 07:12:18 2007 +++ php-src/main/php_compat.h Thu Jul 17 14:35:33 2008 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: php_compat.h,v 1.34 2007/12/31 07:12:18 sebastian Exp $ */ +/* $Id: php_compat.h,v 1.35 2008/07/17 14:35:33 nlopess Exp $ */ #ifndef PHP_COMPAT_H #define PHP_COMPAT_H @@ -56,6 +56,7 @@ #define _pcre_xclass php__pcre_xclass #define pcre_callout php_pcre_callout #define _pcre_OP_lengths php__pcre_OP_lengths +#define _pcre_utt_namesphp__pcre_utt_names #define _pcre_default_tables php__pcre_default_tables #define pcre_get_stringtable_entries php_pcre_get_stringtable_entries #define _pcre_is_newline php__pcre_is_newline -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_4_4) /win32 php4dllts.dsp
nlopess Thu Jul 17 14:42:15 2008 UTC Modified files: (Branch: PHP_4_4) /php-src/win32 php4dllts.dsp Log: update for PCRE upgrade http://cvs.php.net/viewvc.cgi/php-src/win32/php4dllts.dsp?r1=1.87.2.9.2.5r2=1.87.2.9.2.6diff_format=u Index: php-src/win32/php4dllts.dsp diff -u php-src/win32/php4dllts.dsp:1.87.2.9.2.5 php-src/win32/php4dllts.dsp:1.87.2.9.2.6 --- php-src/win32/php4dllts.dsp:1.87.2.9.2.5Tue Feb 13 20:23:28 2007 +++ php-src/win32/php4dllts.dsp Thu Jul 17 14:42:15 2008 @@ -407,400 +407,96 @@ SOURCE=..\ext\pcre\pcrelib\pcre_chartables.c -!IF $(CFG) == php4dllts - Win32 Debug_TS - -# ADD CPP /D EXPORT= /D NEWLINE=10 /D SUPPORT_UTF8 /D SUPPORT_UCP /D LINK_SIZE=2 /D POSIX_MALLOC_THRESHOLD=10 /D MATCH_LIMIT=1000 /D MATCH_LIMIT_RECURSION=1000 /D MAX_NAME_SIZE=32 /D MAX_NAME_COUNT=1 /D MAX_DUPLENGTH=3 - -!ELSEIF $(CFG) == php4dllts - Win32 Release_TS - -# ADD CPP /D EXPORT= /D NEWLINE=10 /D SUPPORT_UTF8 /D SUPPORT_UCP /D LINK_SIZE=2 /D POSIX_MALLOC_THRESHOLD=10 /D MATCH_LIMIT=1000 /D MATCH_LIMIT_RECURSION=1000 /D MAX_NAME_SIZE=32 /D MAX_NAME_COUNT=1 /D MAX_DUPLENGTH=3 - -!ELSEIF $(CFG) == php4dllts - Win32 Release_TS_inline - -# ADD CPP /D EXPORT= /D NEWLINE=10 /D SUPPORT_UTF8 /D SUPPORT_UCP /D LINK_SIZE=2 /D POSIX_MALLOC_THRESHOLD=10 /D MATCH_LIMIT=1000 /D MATCH_LIMIT_RECURSION=1000 /D MAX_NAME_SIZE=32 /D MAX_NAME_COUNT=1 /D MAX_DUPLENGTH=3 - -!ELSEIF $(CFG) == php4dllts - Win32 Release_TSDbg - -!ENDIF - # End Source File # Begin Source File SOURCE=..\ext\pcre\pcrelib\pcre_compile.c -!IF $(CFG) == php4dllts - Win32 Debug_TS - -# ADD CPP /D EXPORT= /D NEWLINE=10 /D SUPPORT_UTF8 /D SUPPORT_UCP /D LINK_SIZE=2 /D POSIX_MALLOC_THRESHOLD=10 /D MATCH_LIMIT=1000 /D MATCH_LIMIT_RECURSION=1000 /D MAX_NAME_SIZE=32 /D MAX_NAME_COUNT=1 /D MAX_DUPLENGTH=3 - -!ELSEIF $(CFG) == php4dllts - Win32 Release_TS - -# ADD CPP /D EXPORT= /D NEWLINE=10 /D SUPPORT_UTF8 /D SUPPORT_UCP /D LINK_SIZE=2 /D POSIX_MALLOC_THRESHOLD=10 /D MATCH_LIMIT=1000 /D MATCH_LIMIT_RECURSION=1000 /D MAX_NAME_SIZE=32 /D MAX_NAME_COUNT=1 /D MAX_DUPLENGTH=3 - -!ELSEIF $(CFG) == php4dllts - Win32 Release_TS_inline - -# ADD CPP /D EXPORT= /D NEWLINE=10 /D SUPPORT_UTF8 /D SUPPORT_UCP /D LINK_SIZE=2 /D POSIX_MALLOC_THRESHOLD=10 /D MATCH_LIMIT=1000 /D MATCH_LIMIT_RECURSION=1000 /D MAX_NAME_SIZE=32 /D MAX_NAME_COUNT=1 /D MAX_DUPLENGTH=3 - -!ELSEIF $(CFG) == php4dllts - Win32 Release_TSDbg - -!ENDIF - # End Source File # Begin Source File SOURCE=..\ext\pcre\pcrelib\pcre_config.c -!IF $(CFG) == php4dllts - Win32 Debug_TS - -# ADD CPP /D EXPORT= /D NEWLINE=10 /D SUPPORT_UTF8 /D SUPPORT_UCP /D LINK_SIZE=2 /D POSIX_MALLOC_THRESHOLD=10 /D MATCH_LIMIT=1000 /D MATCH_LIMIT_RECURSION=1000 /D MAX_NAME_SIZE=32 /D MAX_NAME_COUNT=1 /D MAX_DUPLENGTH=3 - -!ELSEIF $(CFG) == php4dllts - Win32 Release_TS - -# ADD CPP /D EXPORT= /D NEWLINE=10 /D SUPPORT_UTF8 /D SUPPORT_UCP /D LINK_SIZE=2 /D POSIX_MALLOC_THRESHOLD=10 /D MATCH_LIMIT=1000 /D MATCH_LIMIT_RECURSION=1000 /D MAX_NAME_SIZE=32 /D MAX_NAME_COUNT=1 /D MAX_DUPLENGTH=3 - -!ELSEIF $(CFG) == php4dllts - Win32 Release_TS_inline - -# ADD CPP /D EXPORT= /D NEWLINE=10 /D SUPPORT_UTF8 /D SUPPORT_UCP /D LINK_SIZE=2 /D POSIX_MALLOC_THRESHOLD=10 /D MATCH_LIMIT=1000 /D MATCH_LIMIT_RECURSION=1000 /D MAX_NAME_SIZE=32 /D MAX_NAME_COUNT=1 /D MAX_DUPLENGTH=3 - -!ELSEIF $(CFG) == php4dllts - Win32 Release_TSDbg - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\ext\pcre\pcrelib\pcre_newline.c - -!IF $(CFG) == php4dllts - Win32 Debug_TS - -# ADD CPP /D EXPORT= /D NEWLINE=10 /D SUPPORT_UTF8 /D SUPPORT_UCP /D LINK_SIZE=2 /D POSIX_MALLOC_THRESHOLD=10 /D MATCH_LIMIT=1000 /D MATCH_LIMIT_RECURSION=1000 /D MAX_NAME_SIZE=32 /D MAX_NAME_COUNT=1 /D MAX_DUPLENGTH=3 - -!ELSEIF $(CFG) == php4dllts - Win32 Release_TS - -# ADD CPP /D EXPORT= /D NEWLINE=10 /D SUPPORT_UTF8 /D SUPPORT_UCP /D LINK_SIZE=2 /D POSIX_MALLOC_THRESHOLD=10 /D MATCH_LIMIT=1000 /D MATCH_LIMIT_RECURSION=1000 /D MAX_NAME_SIZE=32 /D MAX_NAME_COUNT=1 /D MAX_DUPLENGTH=3 - -!ELSEIF $(CFG) == php4dllts - Win32 Release_TS_inline - -# ADD CPP /D EXPORT= /D NEWLINE=10 /D SUPPORT_UTF8 /D SUPPORT_UCP /D LINK_SIZE=2 /D POSIX_MALLOC_THRESHOLD=10 /D MATCH_LIMIT=1000 /D MATCH_LIMIT_RECURSION=1000 /D MAX_NAME_SIZE=32 /D MAX_NAME_COUNT=1 /D MAX_DUPLENGTH=3 - -!ELSEIF $(CFG) == php4dllts - Win32 Release_TSDbg - -!ENDIF - # End Source File # Begin Source File SOURCE=..\ext\pcre\pcrelib\pcre_exec.c -!IF $(CFG) == php4dllts - Win32 Debug_TS - -# ADD CPP /D EXPORT= /D NEWLINE=10 /D SUPPORT_UTF8 /D SUPPORT_UCP /D LINK_SIZE=2 /D POSIX_MALLOC_THRESHOLD=10 /D MATCH_LIMIT=1000 /D MATCH_LIMIT_RECURSION=1000 /D MAX_NAME_SIZE=32 /D MAX_NAME_COUNT=1 /D MAX_DUPLENGTH=3 -
[PHP-CVS] cvs: php-src(PHP_5_3) /tests/lang comments.phpt comments2.phpt script_tag.phpt
nlopess Tue Jul 8 14:38:31 2008 UTC Added files: (Branch: PHP_5_3) /php-src/tests/lang comments2.phpt script_tag.phpt Modified files: /php-src/tests/lang comments.phpt Log: add more tests for the parser. currently both fail http://cvs.php.net/viewvc.cgi/php-src/tests/lang/comments.phpt?r1=1.1.2.1r2=1.1.2.2diff_format=u Index: php-src/tests/lang/comments.phpt diff -u php-src/tests/lang/comments.phpt:1.1.2.1 php-src/tests/lang/comments.phpt:1.1.2.2 --- php-src/tests/lang/comments.phpt:1.1.2.1Sun Jul 6 15:40:11 2008 +++ php-src/tests/lang/comments.phptTue Jul 8 14:38:31 2008 @@ -16,7 +16,7 @@ echo \n; ? ---EXPECTF-- +--EXPECT-- #teste2 #ola uhm # ah http://cvs.php.net/viewvc.cgi/php-src/tests/lang/comments2.phpt?view=markuprev=1.1 Index: php-src/tests/lang/comments2.phpt +++ php-src/tests/lang/comments2.phpt http://cvs.php.net/viewvc.cgi/php-src/tests/lang/script_tag.phpt?view=markuprev=1.1 Index: php-src/tests/lang/script_tag.phpt +++ php-src/tests/lang/script_tag.phpt -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /tests/lang comments.phpt comments2.phpt script_tag.phpt
nlopess Tue Jul 8 14:39:14 2008 UTC Modified files: /php-src/tests/lang comments2.phpt script_tag.phpt comments.phpt Log: add new tests http://cvs.php.net/viewvc.cgi/php-src/tests/lang/comments2.phpt?r1=1.1r2=1.2diff_format=u Index: php-src/tests/lang/comments2.phpt diff -u /dev/null php-src/tests/lang/comments2.phpt:1.2 --- /dev/null Tue Jul 8 14:39:14 2008 +++ php-src/tests/lang/comments2.phpt Tue Jul 8 14:39:13 2008 @@ -0,0 +1,9 @@ +--TEST-- +#-style comments (part 2) +--FILEEOF-- +?php +if (1) { +? +#?php } +--EXPECT-- +# http://cvs.php.net/viewvc.cgi/php-src/tests/lang/script_tag.phpt?r1=1.1r2=1.2diff_format=u Index: php-src/tests/lang/script_tag.phpt diff -u /dev/null php-src/tests/lang/script_tag.phpt:1.2 --- /dev/null Tue Jul 8 14:39:14 2008 +++ php-src/tests/lang/script_tag.phpt Tue Jul 8 14:39:13 2008 @@ -0,0 +1,17 @@ +--TEST-- +script tag +--FILE-- +script language=php echo ola\n;/script +script language=php echo ola2\n;/script +script language='php' echo ola3\n;/script +texto sc s script script language script language= +script language=php +#comment +echo oi\n; //ignore here +# 2nd comment +--EXPECT-- +ola +ola2 +ola3 +texto sc s script script language script language= +oi http://cvs.php.net/viewvc.cgi/php-src/tests/lang/comments.phpt?r1=1.2r2=1.3diff_format=u Index: php-src/tests/lang/comments.phpt diff -u php-src/tests/lang/comments.phpt:1.2 php-src/tests/lang/comments.phpt:1.3 --- php-src/tests/lang/comments.phpt:1.2Sun Jul 6 15:40:39 2008 +++ php-src/tests/lang/comments.phptTue Jul 8 14:39:13 2008 @@ -16,7 +16,7 @@ echo \n; ? ---EXPECTF-- +--EXPECT-- #teste2 #ola uhm # ah -- 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) /tests/lang comments.phpt
nlopess Sun Jul 6 15:40:11 2008 UTC Added files: (Branch: PHP_5_3) /php-src/tests/lang comments.phpt Log: add test for #-style comments. passes fine on both 5.2 and 5.3 http://cvs.php.net/viewvc.cgi/php-src/tests/lang/comments.phpt?view=markuprev=1.1 Index: php-src/tests/lang/comments.phpt +++ php-src/tests/lang/comments.phpt -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /tests/lang comments.phpt
nlopess Sun Jul 6 15:40:39 2008 UTC Modified files: /php-src/tests/lang comments.phpt Log: add http://cvs.php.net/viewvc.cgi/php-src/tests/lang/comments.phpt?r1=1.1r2=1.2diff_format=u Index: php-src/tests/lang/comments.phpt diff -u /dev/null php-src/tests/lang/comments.phpt:1.2 --- /dev/null Sun Jul 6 15:40:39 2008 +++ php-src/tests/lang/comments.phptSun Jul 6 15:40:39 2008 @@ -0,0 +1,23 @@ +--TEST-- +#-style comments +--FILE-- +#teste +#teste2 +?php + +#ahahah +#ahhfhf + +echo '#ola'; //? +echo \n; +echo 'uhm # ah'; #ah? +echo \n; +echo e este, # hein?; +echo \n; + +? +--EXPECTF-- +#teste2 +#ola +uhm # ah +e este, # hein? -- 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/pcre/pcrelib pcre_compile.c
nlopess Sun Jul 6 15:23:31 2008 UTC Modified files: (Branch: PHP_5_3) /php-src/ext/pcre/pcrelib pcre_compile.c Log: fix CVE-2008-2371. patch by Tavis Ormandy # currently there's no release of PCRE with this fix. PCRE's author recommended applying this patch in the meantime http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/pcrelib/pcre_compile.c?r1=1.1.2.1.2.6.2.4r2=1.1.2.1.2.6.2.5diff_format=u Index: php-src/ext/pcre/pcrelib/pcre_compile.c diff -u php-src/ext/pcre/pcrelib/pcre_compile.c:1.1.2.1.2.6.2.4 php-src/ext/pcre/pcrelib/pcre_compile.c:1.1.2.1.2.6.2.5 --- php-src/ext/pcre/pcrelib/pcre_compile.c:1.1.2.1.2.6.2.4 Sun Jul 6 15:17:24 2008 +++ php-src/ext/pcre/pcrelib/pcre_compile.c Sun Jul 6 15:23:31 2008 @@ -4929,7 +4929,7 @@ (lengthptr == NULL || *lengthptr == 2 + 2*LINK_SIZE)) { cd-external_options = newoptions; -options = newoptions; +options = *optionsptr = newoptions; } else { -- 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) /sapi/cli/tests 016.phpt
nlopess Sun Jul 6 16:38:18 2008 UTC Modified files: (Branch: PHP_5_3) /php-src/sapi/cli/tests 016.phpt Log: fix test for good consoles (tm) http://cvs.php.net/viewvc.cgi/php-src/sapi/cli/tests/016.phpt?r1=1.1.2.4r2=1.1.2.5diff_format=u Index: php-src/sapi/cli/tests/016.phpt diff -u php-src/sapi/cli/tests/016.phpt:1.1.2.4 php-src/sapi/cli/tests/016.phpt:1.1.2.5 --- php-src/sapi/cli/tests/016.phpt:1.1.2.4 Mon Mar 17 16:32:15 2008 +++ php-src/sapi/cli/tests/016.phpt Sun Jul 6 16:38:18 2008 @@ -11,6 +11,9 @@ ?php $php = getenv('TEST_PHP_EXECUTABLE'); +// disallow console escape sequences that may break the output +putenv('TERM=VT100'); + $codes = array(); $codes[1] = EOT -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /sapi/cli/tests 016.phpt
nlopess Sun Jul 6 16:42:10 2008 UTC Modified files: /php-src/sapi/cli/tests 016.phpt Log: MFB http://cvs.php.net/viewvc.cgi/php-src/sapi/cli/tests/016.phpt?r1=1.1r2=1.2diff_format=u Index: php-src/sapi/cli/tests/016.phpt diff -u php-src/sapi/cli/tests/016.phpt:1.1 php-src/sapi/cli/tests/016.phpt:1.2 --- php-src/sapi/cli/tests/016.phpt:1.1 Sat Mar 1 21:55:20 2008 +++ php-src/sapi/cli/tests/016.phpt Sun Jul 6 16:42:10 2008 @@ -11,6 +11,9 @@ ?php $php = getenv('TEST_PHP_EXECUTABLE'); +// disallow console escape sequences that may break the output +putenv('TERM=VT100'); + $codes = array(); $codes[1] = EOT -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /tests/lang bug44654.phpt
nlopess Sun Jul 6 16:43:36 2008 UTC Modified files: /php-src/tests/lang bug44654.phpt Log: uhm, forgot to commit this one http://cvs.php.net/viewvc.cgi/php-src/tests/lang/bug44654.phpt?r1=1.1r2=1.2diff_format=u Index: php-src/tests/lang/bug44654.phpt diff -u /dev/null php-src/tests/lang/bug44654.phpt:1.2 --- /dev/null Sun Jul 6 16:43:36 2008 +++ php-src/tests/lang/bug44654.phptSun Jul 6 16:43:36 2008 @@ -0,0 +1,8 @@ +--TEST-- +Bug #44654 (syntax error for #) +--FILE-- +#?php echo 1; ? +?php if (1) { ?#?php } ? +#?php echo 1; ? +--EXPECT-- +##1 -- 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) /sapi/cli/tests 021.phpt
nlopess Sun Jul 6 16:59:39 2008 UTC Added files: (Branch: PHP_5_3) /php-src/sapi/cli/tests 021.phpt Log: add test for the shebang thing http://cvs.php.net/viewvc.cgi/php-src/sapi/cli/tests/021.phpt?view=markuprev=1.1 Index: php-src/sapi/cli/tests/021.phpt +++ php-src/sapi/cli/tests/021.phpt -- 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_3) / run-tests.php
+ + $timeout = $leak_check ? 300 : (isset($env['TEST_TIMEOUT']) ? $env['TEST_TIMEOUT'] : 60); I don't particularly like this semantic, as that way I can't set the timeout when using valgrind. A better way would be (IMHO): $timeout = isset($env['TEST_TIMEOUT']) ? $env['TEST_TIMEOUT'] : ($leak_check ? 300 : 60); Also, maybe it's time to put the timeout value computation outside of the function, otherwise that's two ifs for each test execution + skipif execution. Anyway this seems a great addition, as now I can fine tune the timeout without editing the script by hand. Nuno -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] cvs: php-src /ext/hash/tests hash_copy_001.phpt
tony2001 Wed Jun 4 09:10:35 2008 UTC Modified files: /php-src/ext/hash/tests hash_copy_001.phpt Log: fix test (the test still fails because of broken preg_match()) What's broken in preg_match()? I'd be happy to fix it :) Nuno -- 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 basic_functions.c math.c php_math.h /ext/standard/tests/math acosh_basic.phpt acosh_error.phpt acosh_variation.phpt asinh_basic.phpt asinh_error.phpt asinh_va
Please add the 'static' qualifier to your new php_* functions. Thanks, Nuno - Original Message - From: Kalle Sommer Nielsen [EMAIL PROTECTED] To: php-cvs@lists.php.net; [EMAIL PROTECTED] Sent: Monday, May 05, 2008 7:28 AM Subject: [PHP-CVS] cvs: php-src /ext/standard basic_functions.c math.c php_math.h /ext/standard/tests/math acosh_basic.phpt acosh_error.phpt acosh_variation.phpt asinh_basic.phpt asinh_error.phpt asinh_variation.phpt atanh_basic.phpt atanh_error.phpt atanh_variation.phpt kalle Mon May 5 06:28:03 2008 UTC Modified files: /php-src/ext/standard basic_functions.c math.c php_math.h /php-src/ext/standard/tests/math acosh_basic.phpt acosh_error.phpt acosh_variation.phpt asinh_basic.phpt asinh_error.phpt asinh_variation.phpt atanh_basic.phpt atanh_error.phpt atanh_variation.phpt Log: Implemented Windows support for asinh(), acosh(), atanh(), log1p() and expm1() + removed Windows check on tests [DOC] Windows support for asinh(), acosh(), atanh(), log1p() and expm1() -- 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/pdo/tests bug_43663.phpt bug_44159.phpt
nlopess Thu Apr 10 18:50:42 2008 UTC Modified files: (Branch: PHP_5_3) /php-src/ext/pdo/tests bug_43663.phpt bug_44159.phpt Log: fix SKIPIFs # Patch by Christian Hoffmann http://cvs.php.net/viewvc.cgi/php-src/ext/pdo/tests/bug_43663.phpt?r1=1.1.2.3r2=1.1.2.4diff_format=u Index: php-src/ext/pdo/tests/bug_43663.phpt diff -u php-src/ext/pdo/tests/bug_43663.phpt:1.1.2.3 php-src/ext/pdo/tests/bug_43663.phpt:1.1.2.4 --- php-src/ext/pdo/tests/bug_43663.phpt:1.1.2.3Mon Mar 17 17:19:48 2008 +++ php-src/ext/pdo/tests/bug_43663.phptThu Apr 10 18:50:41 2008 @@ -2,7 +2,7 @@ PDO Common: Bug #43663 (__call on classes derived from PDO) --SKIPIF-- ?php # vim:ft=php -if (!extension_loaded('pdo')) die('skip'); +if (!extension_loaded('pdo_sqlite')) die('skip no pdo_sqlite'); ? --FILE-- ?php http://cvs.php.net/viewvc.cgi/php-src/ext/pdo/tests/bug_44159.phpt?r1=1.1.2.2r2=1.1.2.3diff_format=u Index: php-src/ext/pdo/tests/bug_44159.phpt diff -u php-src/ext/pdo/tests/bug_44159.phpt:1.1.2.2 php-src/ext/pdo/tests/bug_44159.phpt:1.1.2.3 --- php-src/ext/pdo/tests/bug_44159.phpt:1.1.2.2Fri Feb 22 02:15:42 2008 +++ php-src/ext/pdo/tests/bug_44159.phptThu Apr 10 18:50:42 2008 @@ -1,5 +1,9 @@ --TEST-- Bug #44159 (Crash: $pdo-setAttribute(PDO::STATEMENT_ATTR_CLASS, NULL)) +--SKIPIF-- +?php +if (!extension_loaded('pdo_sqlite')) die('skip no pdo_sqlite'); +? --FILE-- ?php -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/pdo/tests bug_43663.phpt
nlopess Thu Apr 10 18:51:54 2008 UTC Modified files: /php-src/ext/pdo/tests bug_43663.phpt Log: MFB http://cvs.php.net/viewvc.cgi/php-src/ext/pdo/tests/bug_43663.phpt?r1=1.2r2=1.3diff_format=u Index: php-src/ext/pdo/tests/bug_43663.phpt diff -u php-src/ext/pdo/tests/bug_43663.phpt:1.2 php-src/ext/pdo/tests/bug_43663.phpt:1.3 --- php-src/ext/pdo/tests/bug_43663.phpt:1.2Tue Mar 18 06:39:06 2008 +++ php-src/ext/pdo/tests/bug_43663.phptThu Apr 10 18:51:54 2008 @@ -2,7 +2,7 @@ PDO Common: Bug #43663 (__call on classes derived from PDO) --SKIPIF-- ?php # vim:ft=php -if (!extension_loaded('pdo')) die('skip'); +if (!extension_loaded('pdo_sqlite')) die('skip no pdo_sqlite'); ? --FILE-- ?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) /ext/pdo/tests bug_43663.phpt bug_44159.phpt
nlopess Thu Apr 10 19:09:49 2008 UTC Modified files: (Branch: PHP_5_2) /php-src/ext/pdo/tests bug_43663.phpt bug_44159.phpt Log: MFB5.3: fix SKIPIF http://cvs.php.net/viewvc.cgi/php-src/ext/pdo/tests/bug_43663.phpt?r1=1.1.4.2r2=1.1.4.3diff_format=u Index: php-src/ext/pdo/tests/bug_43663.phpt diff -u php-src/ext/pdo/tests/bug_43663.phpt:1.1.4.2 php-src/ext/pdo/tests/bug_43663.phpt:1.1.4.3 --- php-src/ext/pdo/tests/bug_43663.phpt:1.1.4.2Sun Dec 30 17:59:31 2007 +++ php-src/ext/pdo/tests/bug_43663.phptThu Apr 10 19:09:49 2008 @@ -1,9 +1,8 @@ --TEST-- PDO Common: Bug #43663 (__call on classes derived from PDO) ---FILE-- --SKIPIF-- ?php # vim:ft=php -if (!extension_loaded('pdo')) die('skip'); +if (!extension_loaded('pdo_sqlite')) die('skip no pdo_sqlite'); ? --FILE-- ?php http://cvs.php.net/viewvc.cgi/php-src/ext/pdo/tests/bug_44159.phpt?r1=1.1.4.3r2=1.1.4.4diff_format=u Index: php-src/ext/pdo/tests/bug_44159.phpt diff -u php-src/ext/pdo/tests/bug_44159.phpt:1.1.4.3 php-src/ext/pdo/tests/bug_44159.phpt:1.1.4.4 --- php-src/ext/pdo/tests/bug_44159.phpt:1.1.4.3Fri Feb 22 02:45:37 2008 +++ php-src/ext/pdo/tests/bug_44159.phptThu Apr 10 19:09:49 2008 @@ -1,5 +1,9 @@ --TEST-- Bug #44159 (Crash: $pdo-setAttribute(PDO::STATEMENT_ATTR_CLASS, NULL)) +--SKIPIF-- +?php +if (!extension_loaded('pdo_sqlite')) die('skip no pdo_sqlite'); +? --FILE-- ?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_3) /ext/standard/tests/general_functions bug44394_2.phpt
nlopess Thu Apr 10 19:13:59 2008 UTC Modified files: (Branch: PHP_5_3) /php-src/ext/standard/tests/general_functions bug44394_2.phpt Log: add SKIPIF # Patch by Christian Hoffmann http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/general_functions/bug44394_2.phpt?r1=1.1.2.1r2=1.1.2.2diff_format=u Index: php-src/ext/standard/tests/general_functions/bug44394_2.phpt diff -u php-src/ext/standard/tests/general_functions/bug44394_2.phpt:1.1.2.1 php-src/ext/standard/tests/general_functions/bug44394_2.phpt:1.1.2.2 --- php-src/ext/standard/tests/general_functions/bug44394_2.phpt:1.1.2.1 Wed Mar 12 02:40:57 2008 +++ php-src/ext/standard/tests/general_functions/bug44394_2.phptThu Apr 10 19:13:59 2008 @@ -1,5 +1,7 @@ --TEST-- Bug #44394 (Last two bytes missing from output) with session.use_trans_id +--SKIPIF-- +?php if (!extension_loaded(session)) print skip; ? --FILE-- ?php -- 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 bug44394_2.phpt
nlopess Thu Apr 10 19:14:23 2008 UTC Modified files: /php-src/ext/standard/tests/general_functions bug44394_2.phpt Log: MFB http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/general_functions/bug44394_2.phpt?r1=1.2r2=1.3diff_format=u Index: php-src/ext/standard/tests/general_functions/bug44394_2.phpt diff -u php-src/ext/standard/tests/general_functions/bug44394_2.phpt:1.2 php-src/ext/standard/tests/general_functions/bug44394_2.phpt:1.3 --- php-src/ext/standard/tests/general_functions/bug44394_2.phpt:1.2Wed Mar 12 02:45:15 2008 +++ php-src/ext/standard/tests/general_functions/bug44394_2.phptThu Apr 10 19:14:23 2008 @@ -1,5 +1,7 @@ --TEST-- Bug #44394 (Last two bytes missing from output) with session.use_trans_id +--SKIPIF-- +?php if (!extension_loaded(session)) print skip; ? --FILE-- ?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) /ext/standard/tests/general_functions bug44394_2.phpt
nlopess Thu Apr 10 19:16:00 2008 UTC Modified files: (Branch: PHP_5_2) /php-src/ext/standard/tests/general_functions bug44394_2.phpt Log: MFB53 http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/general_functions/bug44394_2.phpt?r1=1.2.2.2r2=1.2.2.3diff_format=u Index: php-src/ext/standard/tests/general_functions/bug44394_2.phpt diff -u php-src/ext/standard/tests/general_functions/bug44394_2.phpt:1.2.2.2 php-src/ext/standard/tests/general_functions/bug44394_2.phpt:1.2.2.3 --- php-src/ext/standard/tests/general_functions/bug44394_2.phpt:1.2.2.2 Wed Mar 12 11:27:42 2008 +++ php-src/ext/standard/tests/general_functions/bug44394_2.phptThu Apr 10 19:16:00 2008 @@ -1,5 +1,7 @@ --TEST-- Bug #44394 (Last two bytes missing from output) with session.use_trans_id +--SKIPIF-- +?php if (!extension_loaded(session)) print skip; ? --FILE-- ?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_3) /ext/standard/tests/class_object .cvsignore
nlopess Fri Mar 28 17:46:57 2008 UTC Added files: (Branch: PHP_5_3) /php-src/ext/standard/tests/class_object.cvsignore Log: ignore generated files http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/class_object/.cvsignore?view=markuprev=1.1 Index: php-src/ext/standard/tests/class_object/.cvsignore +++ php-src/ext/standard/tests/class_object/.cvsignore -- 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/class_object .cvsignore
nlopess Fri Mar 28 17:47:51 2008 UTC Modified files: /php-src/ext/standard/tests/class_object.cvsignore Log: ignore generated files http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/class_object/.cvsignore?r1=1.1r2=1.2diff_format=u Index: php-src/ext/standard/tests/class_object/.cvsignore diff -u /dev/null php-src/ext/standard/tests/class_object/.cvsignore:1.2 --- /dev/null Fri Mar 28 17:47:51 2008 +++ php-src/ext/standard/tests/class_object/.cvsignore Fri Mar 28 17:47:51 2008 @@ -0,0 +1,9 @@ +phpt.* +*.mem +*.diff +*.log +*.exp +*.out +*.php +*.gcda +*.gcno -- 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/ldap/tests .cvsignore
nlopess Fri Mar 28 17:48:30 2008 UTC Added files: (Branch: PHP_5_3) /php-src/ext/ldap/tests .cvsignore Log: ignore generated files http://cvs.php.net/viewvc.cgi/php-src/ext/ldap/tests/.cvsignore?view=markuprev=1.1 Index: php-src/ext/ldap/tests/.cvsignore +++ php-src/ext/ldap/tests/.cvsignore -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/ldap/tests .cvsignore
nlopess Fri Mar 28 17:48:59 2008 UTC Modified files: /php-src/ext/ldap/tests .cvsignore Log: ignore generated files http://cvs.php.net/viewvc.cgi/php-src/ext/ldap/tests/.cvsignore?r1=1.1r2=1.2diff_format=u Index: php-src/ext/ldap/tests/.cvsignore diff -u /dev/null php-src/ext/ldap/tests/.cvsignore:1.2 --- /dev/null Fri Mar 28 17:48:59 2008 +++ php-src/ext/ldap/tests/.cvsignore Fri Mar 28 17:48:59 2008 @@ -0,0 +1,9 @@ +phpt.* +*.mem +*.diff +*.log +*.exp +*.out +*.php +*.gcda +*.gcno -- 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/tests/streams .cvsignore
nlopess Wed Mar 19 23:25:53 2008 UTC Added files: (Branch: PHP_5_3) /php-src/ext/standard/tests/streams .cvsignore Log: ignore generated files http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/streams/.cvsignore?view=markuprev=1.1 Index: php-src/ext/standard/tests/streams/.cvsignore +++ php-src/ext/standard/tests/streams/.cvsignore -- 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/streams .cvsignore
nlopess Wed Mar 19 23:26:58 2008 UTC Modified files: /php-src/ext/standard/tests/streams .cvsignore Log: add http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/streams/.cvsignore?r1=1.1r2=1.2diff_format=u Index: php-src/ext/standard/tests/streams/.cvsignore diff -u /dev/null php-src/ext/standard/tests/streams/.cvsignore:1.2 --- /dev/null Wed Mar 19 23:26:58 2008 +++ php-src/ext/standard/tests/streams/.cvsignore Wed Mar 19 23:26:58 2008 @@ -0,0 +1,9 @@ +phpt.* +*.mem +*.diff +*.log +*.exp +*.out +*.php +*.gcda +*.gcno -- 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) /sapi/cli/tests 016.phpt 017.phpt
nlopess Mon Mar 17 16:32:15 2008 UTC Modified files: (Branch: PHP_5_3) /php-src/sapi/cli/tests 016.phpt 017.phpt Log: fix tests (removed duplicated stuff) http://cvs.php.net/viewvc.cgi/php-src/sapi/cli/tests/016.phpt?r1=1.1.2.3r2=1.1.2.4diff_format=u Index: php-src/sapi/cli/tests/016.phpt diff -u php-src/sapi/cli/tests/016.phpt:1.1.2.3 php-src/sapi/cli/tests/016.phpt:1.1.2.4 --- php-src/sapi/cli/tests/016.phpt:1.1.2.3 Sun Mar 16 21:06:54 2008 +++ php-src/sapi/cli/tests/016.phpt Mon Mar 17 16:32:15 2008 @@ -103,108 +103,3 @@ php Done ---TEST-- -CLI -a and readline ---SKIPIF-- -?php -include skipif.inc; -if (!extension_loaded('readline') || readline_info('done') === NULL) { - die (skip need readline support); -} -? ---FILE-- -?php -$php = getenv('TEST_PHP_EXECUTABLE'); - -$codes = array(); - -$codes[1] = EOT -echo 'Hello world'; -exit -EOT; - -$codes[] = EOT -echo 'multine -single -quote'; -exit -EOT; - -$codes[] = EOT -echo HEREDOC -Here -comes -the -doc -HEREDOC; -EOT; - -$codes[] = EOT -if (0) { -echo I'm not there; -} -echo Done; -EOT; - -$codes[] = EOT -function a_function_with_some_name() { -echo I was called!; -} -a_function_w ); -EOT; - -foreach ($codes as $key = $code) { - echo \n--\nSnippet no. $key:\n--\n; - $code = escapeshellarg($code); - echo `echo $code | $php -a`, \n; -} - -echo \nDone\n; -? ---EXPECTF-- --- -Snippet no. 1: --- -Interactive shell - -php Hello world -php - --- -Snippet no. 2: --- -Interactive shell - -php php ' php ' multine -single -quote -php - --- -Snippet no. 3: --- -Interactive shell - -phpHere -comes -the -doc -php - --- -Snippet no. 4: --- -Interactive shell - -php php { php { php Done -php - --- -Snippet no. 5: --- -Interactive shell - -php php { php { php I was called! -php - -Done http://cvs.php.net/viewvc.cgi/php-src/sapi/cli/tests/017.phpt?r1=1.1.2.3r2=1.1.2.4diff_format=u Index: php-src/sapi/cli/tests/017.phpt diff -u php-src/sapi/cli/tests/017.phpt:1.1.2.3 php-src/sapi/cli/tests/017.phpt:1.1.2.4 --- php-src/sapi/cli/tests/017.phpt:1.1.2.3 Sun Mar 16 21:06:54 2008 +++ php-src/sapi/cli/tests/017.phpt Mon Mar 17 16:32:15 2008 @@ -104,109 +104,3 @@ Done ---TEST-- -CLI -a and libedit ---SKIPIF-- -?php -include skipif.inc; -if (!extension_loaded('readline') || readline_info('done') !== NULL) { - die (skip need readline support using libedit); -} -? ---FILE-- -?php -$php = getenv('TEST_PHP_EXECUTABLE'); - -$codes = array(); - -$codes[1] = EOT -echo 'Hello world'; -exit -EOT; - -$codes[] = EOT -echo 'multine -single -quote'; -exit -EOT; - -$codes[] = EOT -echo HEREDOC -Here -comes -the -doc -HEREDOC; -EOT; - -$codes[] = EOT -if (0) { -echo I'm not there; -} -echo Done; -EOT; - -$codes[] = EOT -function a_function_with_some_name() { -echo I was called!; -} -a_function_w ); -EOT; - -foreach ($codes as $key = $code) { - echo \n--\nSnippet no. $key:\n--\n; - $code = escapeshellarg($code); - echo `echo $code | $php -a`, \n; -} - -echo \nDone\n; -? ---EXPECTF-- --- -Snippet no. 1: --- -Interactive shell - -Hello world - - --- -Snippet no. 2: --- -Interactive shell - -multine -single -quote - - --- -Snippet no. 3: --- -Interactive shell - -Here -comes -the -doc - - --- -Snippet no. 4: --- -Interactive shell - -Done - - --- -Snippet no. 5: --- -Interactive shell - - -Parse error: syntax error, unexpected ')' in php shell code on line 1 - - -Done -- 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) / run-tests.php
nlopess Mon Mar 17 17:18:19 2008 UTC Modified files: (Branch: PHP_5_3) /php-srcrun-tests.php Log: detect test cases with duplicated sections http://cvs.php.net/viewvc.cgi/php-src/run-tests.php?r1=1.226.2.37.2.35.2.18r2=1.226.2.37.2.35.2.19diff_format=u Index: php-src/run-tests.php diff -u php-src/run-tests.php:1.226.2.37.2.35.2.18 php-src/run-tests.php:1.226.2.37.2.35.2.19 --- php-src/run-tests.php:1.226.2.37.2.35.2.18 Wed Mar 5 20:10:12 2008 +++ php-src/run-tests.php Mon Mar 17 17:18:19 2008 @@ -24,7 +24,7 @@ +--+ */ -/* $Id: run-tests.php,v 1.226.2.37.2.35.2.18 2008/03/05 20:10:12 lstrojny Exp $ */ +/* $Id: run-tests.php,v 1.226.2.37.2.35.2.19 2008/03/17 17:18:19 nlopess Exp $ */ /* Sanity check to ensure that pcre extension needed by this script is available. * In the event it is not, print a nice error message indicating that this script will @@ -441,7 +441,7 @@ $html_output = is_resource($html_file); break; case '--version': - echo '$Revision: 1.226.2.37.2.35.2.18 $'.\n; + echo '$Revision: 1.226.2.37.2.35.2.19 $'.\n; exit(1); case 'u': @@ -1032,16 +1032,7 @@ ; // Load the sections of the test file. - $section_text = array( - 'TEST' = '', - 'SKIPIF' = '', - 'GET'= '', - 'COOKIE' = '', - 'POST_RAW' = '', - 'POST' = '', - 'UPLOAD' = '', - 'ARGS' = '', - ); + $section_text = array('TEST' = ''); $fp = fopen($file, rt) or error(Cannot open test file: $file); @@ -1066,6 +1057,12 @@ // Match the beginning of a section. if (preg_match('/^--([_A-Z]+)--/', $line, $r)) { $section = $r[1]; + + if (isset($section_text[$section])) { + $bork_info = duplicated $section section; + $borked= true; + } + $section_text[$section] = ''; $secfile = $section == 'FILE' || $section == 'FILEEOF' || $section == 'FILE_EXTERNAL'; $secdone = false; @@ -1392,7 +1389,7 @@ $env['HTTP_COOKIE'] = ''; } - $args = $section_text['ARGS'] ? ' -- '.$section_text['ARGS'] : ''; + $args = isset($section_text['ARGS']) ? ' -- '.$section_text['ARGS'] : ''; if (array_key_exists('POST_RAW', $section_text) !empty($section_text['POST_RAW'])) { $post = trim($section_text['POST_RAW']); -- 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/mysql/tests mysql_fetch_row.phpt /ext/pdo/tests bug_43663.phpt /ext/standard/tests/file unlink_error-win32.phpt
nlopess Mon Mar 17 17:19:48 2008 UTC Modified files: (Branch: PHP_5_3) /php-src/ext/standard/tests/fileunlink_error-win32.phpt /php-src/ext/mysql/testsmysql_fetch_row.phpt /php-src/ext/pdo/tests bug_43663.phpt Log: remove duplicated sections http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/file/unlink_error-win32.phpt?r1=1.1.2.2.2.1r2=1.1.2.2.2.2diff_format=u Index: php-src/ext/standard/tests/file/unlink_error-win32.phpt diff -u php-src/ext/standard/tests/file/unlink_error-win32.phpt:1.1.2.2.2.1 php-src/ext/standard/tests/file/unlink_error-win32.phpt:1.1.2.2.2.2 --- php-src/ext/standard/tests/file/unlink_error-win32.phpt:1.1.2.2.2.1 Mon Nov 5 17:43:21 2007 +++ php-src/ext/standard/tests/file/unlink_error-win32.phpt Mon Mar 17 17:19:48 2008 @@ -8,12 +8,6 @@ ? --FILE-- ?php -if (substr(PHP_OS, 0, 3) != 'WIN') { -die('skip.. only on Windows'); -} -? ---FILE-- -?php /* Prototype : bool unlink ( string $filename [, resource $context] ); Description : Deletes filename */ http://cvs.php.net/viewvc.cgi/php-src/ext/mysql/tests/mysql_fetch_row.phpt?r1=1.3.2.2r2=1.3.2.3diff_format=u Index: php-src/ext/mysql/tests/mysql_fetch_row.phpt diff -u php-src/ext/mysql/tests/mysql_fetch_row.phpt:1.3.2.2 php-src/ext/mysql/tests/mysql_fetch_row.phpt:1.3.2.3 --- php-src/ext/mysql/tests/mysql_fetch_row.phpt:1.3.2.2Wed Oct 10 09:51:45 2007 +++ php-src/ext/mysql/tests/mysql_fetch_row.phptMon Mar 17 17:19:48 2008 @@ -50,20 +50,6 @@ Warning: mysql_fetch_row(): %d is not a valid MySQL result resource in %s on line %d bool(false) done! ---EXPECTF-- -[004] -array(2) { - [0]= - string(1) 1 - [1]= - string(1) a -} -[005] -bool(false) - -Warning: mysql_fetch_row(): %d is not a valid MySQL result resource in %s on line %d -bool(false) -done! --UEXPECTF-- [004] array(2) { @@ -77,4 +63,4 @@ Warning: mysql_fetch_row(): %d is not a valid MySQL result resource in %s on line %d bool(false) -done! \ No newline at end of file +done! http://cvs.php.net/viewvc.cgi/php-src/ext/pdo/tests/bug_43663.phpt?r1=1.1.2.2r2=1.1.2.3diff_format=u Index: php-src/ext/pdo/tests/bug_43663.phpt diff -u php-src/ext/pdo/tests/bug_43663.phpt:1.1.2.2 php-src/ext/pdo/tests/bug_43663.phpt:1.1.2.3 --- php-src/ext/pdo/tests/bug_43663.phpt:1.1.2.2Sun Dec 30 17:51:35 2007 +++ php-src/ext/pdo/tests/bug_43663.phptMon Mar 17 17:19:48 2008 @@ -1,6 +1,5 @@ --TEST-- PDO Common: Bug #43663 (__call on classes derived from PDO) ---FILE-- --SKIPIF-- ?php # vim:ft=php if (!extension_loaded('pdo')) die('skip'); -- 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/pcre/tests 007.phpt invalid_utf8_offset.phpt
nlopess Sat Mar 8 11:50:20 2008 UTC Added files: (Branch: PHP_5_3) /php-src/ext/pcre/tests 007.phpt invalid_utf8_offset.phpt Log: add new tests http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/tests/007.phpt?view=markuprev=1.1 Index: php-src/ext/pcre/tests/007.phpt +++ php-src/ext/pcre/tests/007.phpt http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/tests/invalid_utf8_offset.phpt?view=markuprev=1.1 Index: php-src/ext/pcre/tests/invalid_utf8_offset.phpt +++ php-src/ext/pcre/tests/invalid_utf8_offset.phpt -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/pcre/tests 007.phpt invalid_utf8_offset.phpt
nlopess Sat Mar 8 11:51:03 2008 UTC Modified files: /php-src/ext/pcre/tests 007.phpt invalid_utf8_offset.phpt Log: add new tests http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/tests/007.phpt?r1=1.1r2=1.2diff_format=u Index: php-src/ext/pcre/tests/007.phpt diff -u /dev/null php-src/ext/pcre/tests/007.phpt:1.2 --- /dev/null Sat Mar 8 11:51:03 2008 +++ php-src/ext/pcre/tests/007.phpt Sat Mar 8 11:51:03 2008 @@ -0,0 +1,59 @@ +--TEST-- +preg_replace_callback() with callback that modifies subject string +--SKIPIF-- +?php +if (@preg_match('/./u', '') === false) { + die('skip no utf8 support in PCRE library'); +} +? +--FILE-- +?php + +function evil($x) { + global $txt; + $txt[3] = \xFF; + var_dump($x); + return $x[0]; +} + +$txt = ola123; +var_dump(preg_replace_callback('#.#u', 'evil', $txt)); +var_dump($txt); +var_dump(preg_last_error() == PREG_NO_ERROR); + +var_dump(preg_replace_callback('#.#u', 'evil', $txt)); +var_dump(preg_last_error() == PREG_BAD_UTF8_ERROR); + +echo Done!\n; +? +--EXPECT-- +array(1) { + [0]= + string(1) o +} +array(1) { + [0]= + string(1) l +} +array(1) { + [0]= + string(1) a +} +array(1) { + [0]= + string(1) 1 +} +array(1) { + [0]= + string(1) 2 +} +array(1) { + [0]= + string(1) 3 +} +string(6) ola123 +string(6) olaÿ23 +bool(true) +NULL +bool(true) +Done! http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/tests/invalid_utf8_offset.phpt?r1=1.1r2=1.2diff_format=u Index: php-src/ext/pcre/tests/invalid_utf8_offset.phpt diff -u /dev/null php-src/ext/pcre/tests/invalid_utf8_offset.phpt:1.2 --- /dev/null Sat Mar 8 11:51:03 2008 +++ php-src/ext/pcre/tests/invalid_utf8_offset.phpt Sat Mar 8 11:51:03 2008 @@ -0,0 +1,35 @@ +--TEST-- +preg_replace() and invalid UTF8 offset +--SKIPIF-- +?php +if (@preg_match('/./u', '') === false) { + die('skip no utf8 support in PCRE library'); +} +? +--FILE-- +?php + +$string = \xc3\xa9 uma string utf8 bem formada; + +var_dump(preg_match('~.*~u', $string, $m, 0, 1)); +var_dump($m); +var_dump(preg_last_error() == PREG_BAD_UTF8_OFFSET_ERROR); + +var_dump(preg_match('~.*~u', $string, $m, 0, 2)); +var_dump($m); +var_dump(preg_last_error() == PREG_NO_ERROR); + +echo Done\n; +? +--EXPECT-- +int(0) +array(0) { +} +bool(true) +int(1) +array(1) { + [0]= + string(28) uma string utf8 bem formada +} +bool(true) +Done -- 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/pcre php_pcre.c
nlopess Sat Mar 8 11:58:12 2008 UTC Modified files: (Branch: PHP_5_3) /php-src/ext/pcre php_pcre.c Log: implement #44336: optimize utf8 string matching add PREG_BAD_UTF8_OFFSET_ERROR constant http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/php_pcre.c?r1=1.168.2.9.2.21.2.12r2=1.168.2.9.2.21.2.13diff_format=u Index: php-src/ext/pcre/php_pcre.c diff -u php-src/ext/pcre/php_pcre.c:1.168.2.9.2.21.2.12 php-src/ext/pcre/php_pcre.c:1.168.2.9.2.21.2.13 --- php-src/ext/pcre/php_pcre.c:1.168.2.9.2.21.2.12 Mon Mar 3 11:11:43 2008 +++ php-src/ext/pcre/php_pcre.c Sat Mar 8 11:58:12 2008 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: php_pcre.c,v 1.168.2.9.2.21.2.12 2008/03/03 11:11:43 dmitry Exp $ */ +/* $Id: php_pcre.c,v 1.168.2.9.2.21.2.13 2008/03/08 11:58:12 nlopess Exp $ */ #include php.h #include php_ini.h @@ -48,7 +48,8 @@ PHP_PCRE_INTERNAL_ERROR, PHP_PCRE_BACKTRACK_LIMIT_ERROR, PHP_PCRE_RECURSION_LIMIT_ERROR, - PHP_PCRE_BAD_UTF8_ERROR + PHP_PCRE_BAD_UTF8_ERROR, + PHP_PCRE_BAD_UTF8_OFFSET_ERROR }; @@ -72,6 +73,10 @@ preg_code = PHP_PCRE_BAD_UTF8_ERROR; break; + case PCRE_ERROR_BADUTF8_OFFSET: + preg_code = PHP_PCRE_BAD_UTF8_OFFSET_ERROR; + break; + default: preg_code = PHP_PCRE_INTERNAL_ERROR; break; @@ -145,6 +150,7 @@ REGISTER_LONG_CONSTANT(PREG_BACKTRACK_LIMIT_ERROR, PHP_PCRE_BACKTRACK_LIMIT_ERROR, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT(PREG_RECURSION_LIMIT_ERROR, PHP_PCRE_RECURSION_LIMIT_ERROR, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT(PREG_BAD_UTF8_ERROR, PHP_PCRE_BAD_UTF8_ERROR, CONST_CS | CONST_PERSISTENT); + REGISTER_LONG_CONSTANT(PREG_BAD_UTF8_OFFSET_ERROR, PHP_PCRE_BAD_UTF8_OFFSET_ERROR, CONST_CS | CONST_PERSISTENT); REGISTER_STRING_CONSTANT(PCRE_VERSION, (char *)pcre_version(), CONST_CS | CONST_PERSISTENT); return SUCCESS; @@ -614,7 +620,10 @@ count = pcre_exec(pce-re, extra, subject, subject_len, start_offset, exoptions|g_notempty, offsets, size_offsets); - /* Check for too many substrings condition. */ + /* the string was already proved to be valid UTF-8 */ + exoptions |= PCRE_NO_UTF8_CHECK; + + /* Check for too many substrings condition. */ if (count == 0) { php_error_docref(NULL TSRMLS_CC, E_NOTICE, Matched, but too many substrings); count = size_offsets/3; @@ -1034,7 +1043,10 @@ /* Execute the regular expression. */ count = pcre_exec(pce-re, extra, subject, subject_len, start_offset, exoptions|g_notempty, offsets, size_offsets); - + + /* the string was already proved to be valid UTF-8 */ + exoptions |= PCRE_NO_UTF8_CHECK; + /* Check for too many substrings condition. */ if (count == 0) { php_error_docref(NULL TSRMLS_CC,E_NOTICE, Matched, but too many substrings); @@ -1472,6 +1484,9 @@ subject_len, start_offset, exoptions|g_notempty, offsets, size_offsets); + /* the string was already proved to be valid UTF-8 */ + exoptions |= PCRE_NO_UTF8_CHECK; + /* Check for too many substrings condition. */ if (count == 0) { php_error_docref(NULL TSRMLS_CC,E_NOTICE, Matched, but too many substrings); @@ -1535,9 +1550,8 @@ subject_len, start_offset, exoptions, offsets, size_offsets); if (count 1) { - php_error_docref(NULL TSRMLS_CC,E_NOTICE, Unknown error); - offsets[0] = start_offset; - offsets[1] = start_offset + 1; + php_error_docref(NULL TSRMLS_CC, E_WARNING, Unknown error); + RETURN_FALSE; } } else { offsets[0] = start_offset; -- 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
nlopess Sat Mar 8 12:05:19 2008 UTC Modified files: (Branch: PHP_5_3) /php-srcNEWS Log: BFN: #44336 http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.965.2.128r2=1.2027.2.547.2.965.2.129diff_format=u Index: php-src/NEWS diff -u php-src/NEWS:1.2027.2.547.2.965.2.128 php-src/NEWS:1.2027.2.547.2.965.2.129 --- php-src/NEWS:1.2027.2.547.2.965.2.128 Sat Mar 8 10:36:15 2008 +++ php-src/NEWSSat Mar 8 12:05:19 2008 @@ -74,6 +74,7 @@ Application Notification (FAN) support (Oracle Corp.) - Added OCI8 SQLT_AFC (aka CHAR datatype) support to oci_bind_by_name (Chris Jones) +- Added PREG_BAD_UTF8_OFFSET_ERROR constant. (Nuno) - Improved PHP runtime speed and memory usage: . Added garbage collector. (David Wang, Dmitry). @@ -125,6 +126,8 @@ - Fixed possible crash in ext/soap because of uninitialized value. (Zdash Urf) - Fixed PECL bug #12431 (OCI8 ping functionality is broken). (Oracle Corp.) +- Fixed bug #44336 (Improve pcre UTF-8 string matching performance). + (frode at coretrek dot com, Nuno) - Fixed bug #43960 (strtotime() returns timestamp in the future when given a bogus string). - Fixed bug #43808 (date_create never fails (even when it should)). (Derick) -- 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/strings setlocale_variation4.phpt setlocale_variation5.phpt
nlopess Sat Mar 8 12:12:22 2008 UTC Modified files: (Branch: PHP_5_2) /php-src/ext/standard/tests/strings setlocale_variation4.phpt setlocale_variation5.phpt Log: MFB53 skipif patch as asked by gentoo guys http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/setlocale_variation4.phpt?r1=1.1.2.1r2=1.1.2.2diff_format=u Index: php-src/ext/standard/tests/strings/setlocale_variation4.phpt diff -u php-src/ext/standard/tests/strings/setlocale_variation4.phpt:1.1.2.1 php-src/ext/standard/tests/strings/setlocale_variation4.phpt:1.1.2.2 --- php-src/ext/standard/tests/strings/setlocale_variation4.phpt:1.1.2.1 Fri Oct 5 19:30:50 2007 +++ php-src/ext/standard/tests/strings/setlocale_variation4.phptSat Mar 8 12:12:22 2008 @@ -5,6 +5,9 @@ if (substr(PHP_OS, 0, 3) == 'WIN') { die('skip Not valid for windows'); } +if (setlocale(LC_ALL,'en_US.utf8') === false || setlocale(LC_ALL,'en_AU.utf8') === false) { +die('skip en_US.utf8/en_AU.utf8 locales not available'); +} ? --ENV-- LC_ALL=en_US.utf8; http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/setlocale_variation5.phpt?r1=1.1.2.1r2=1.1.2.2diff_format=u Index: php-src/ext/standard/tests/strings/setlocale_variation5.phpt diff -u php-src/ext/standard/tests/strings/setlocale_variation5.phpt:1.1.2.1 php-src/ext/standard/tests/strings/setlocale_variation5.phpt:1.1.2.2 --- php-src/ext/standard/tests/strings/setlocale_variation5.phpt:1.1.2.1 Fri Oct 5 19:30:50 2007 +++ php-src/ext/standard/tests/strings/setlocale_variation5.phptSat Mar 8 12:12:22 2008 @@ -5,6 +5,9 @@ if (substr(PHP_OS, 0, 3) == 'WIN') { die('skip Not valid for windows'); } +if (setlocale(LC_ALL,'en_AU.utf8') === false || setlocale(LC_ALL,'en_US.utf8') === false) { +die('skip en_AU.utf8/en_US.utf8 locales not available'); +} ? --ENV-- LC_ALL=en_US.utf8; -- 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/pcre php_pcre.c /ext/pcre/tests bug44214.phpt bug44214_2.phpt
nlopess Sat Mar 8 13:01:59 2008 UTC Added files: (Branch: PHP_5_3) /php-src/ext/pcre/tests bug44214.phpt bug44214_2.phpt Modified files: /php-src/ext/pcre php_pcre.c Log: fix bug #44214: crash with preg_replace_callback and global variables http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/php_pcre.c?r1=1.168.2.9.2.21.2.13r2=1.168.2.9.2.21.2.14diff_format=u Index: php-src/ext/pcre/php_pcre.c diff -u php-src/ext/pcre/php_pcre.c:1.168.2.9.2.21.2.13 php-src/ext/pcre/php_pcre.c:1.168.2.9.2.21.2.14 --- php-src/ext/pcre/php_pcre.c:1.168.2.9.2.21.2.13 Sat Mar 8 11:58:12 2008 +++ php-src/ext/pcre/php_pcre.c Sat Mar 8 13:01:58 2008 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: php_pcre.c,v 1.168.2.9.2.21.2.13 2008/03/08 11:58:12 nlopess Exp $ */ +/* $Id: php_pcre.c,v 1.168.2.9.2.21.2.14 2008/03/08 13:01:58 nlopess Exp $ */ #include php.h #include php_ini.h @@ -841,8 +841,8 @@ result_len = offsets[1] - offsets[0]; *result = estrndup(subject[offsets[0]], result_len); } - zval_dtor(subpats); - FREE_ZVAL(subpats); + + zval_ptr_dtor(subpats); return result_len; } http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/tests/bug44214.phpt?view=markuprev=1.1 Index: php-src/ext/pcre/tests/bug44214.phpt +++ php-src/ext/pcre/tests/bug44214.phpt http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/tests/bug44214_2.phpt?view=markuprev=1.1 Index: php-src/ext/pcre/tests/bug44214_2.phpt +++ php-src/ext/pcre/tests/bug44214_2.phpt -- 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
nlopess Sat Mar 8 13:04:00 2008 UTC Modified files: (Branch: PHP_5_3) /php-srcNEWS Log: BFN #44214 http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.965.2.130r2=1.2027.2.547.2.965.2.131diff_format=u Index: php-src/NEWS diff -u php-src/NEWS:1.2027.2.547.2.965.2.130 php-src/NEWS:1.2027.2.547.2.965.2.131 --- php-src/NEWS:1.2027.2.547.2.965.2.130 Sat Mar 8 12:17:54 2008 +++ php-src/NEWSSat Mar 8 13:03:59 2008 @@ -128,6 +128,8 @@ - Fixed bug #44336 (Improve pcre UTF-8 string matching performance). (frode at coretrek dot com, Nuno) +- Fixed bug #44214 (Crash using preg_replace_callback() and global variable). + (Nuno, Scott) - Fixed bug #43960 (strtotime() returns timestamp in the future when given a bogus string). - Fixed bug #43808 (date_create never fails (even when it should)). (Derick) -- 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 bug44214.phpt bug44214_2.phpt
nlopess Sat Mar 8 13:14:02 2008 UTC Modified files: /php-src/ext/pcre php_pcre.c /php-src/ext/pcre/tests bug44214.phpt bug44214_2.phpt Log: MFB: fix #44214 http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/php_pcre.c?r1=1.232r2=1.233diff_format=u Index: php-src/ext/pcre/php_pcre.c diff -u php-src/ext/pcre/php_pcre.c:1.232 php-src/ext/pcre/php_pcre.c:1.233 --- php-src/ext/pcre/php_pcre.c:1.232 Sat Mar 8 11:59:44 2008 +++ php-src/ext/pcre/php_pcre.c Sat Mar 8 13:14:02 2008 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: php_pcre.c,v 1.232 2008/03/08 11:59:44 nlopess Exp $ */ +/* $Id: php_pcre.c,v 1.233 2008/03/08 13:14:02 nlopess Exp $ */ /* TODO * php_pcre_replace_impl(): @@ -969,8 +969,8 @@ result_len = offsets[1] - offsets[0]; *result = estrndup(subject[offsets[0]], result_len); } - zval_dtor(subpats); - FREE_ZVAL(subpats); + + zval_ptr_dtor(subpats); return result_len; } http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/tests/bug44214.phpt?r1=1.1r2=1.2diff_format=u Index: php-src/ext/pcre/tests/bug44214.phpt diff -u /dev/null php-src/ext/pcre/tests/bug44214.phpt:1.2 --- /dev/null Sat Mar 8 13:14:02 2008 +++ php-src/ext/pcre/tests/bug44214.phptSat Mar 8 13:14:02 2008 @@ -0,0 +1,31 @@ +--TEST-- +Bug #44214 (crash with preg_replace_callback() and global variable) +--FILE-- +?php +$string = 'aaa bbb ccc ddd eee ccc aaa bbb'; + +$array = array(); + +function myCallBack( $match ) { +global $array; +$array[] = $match; +return 'xxx'; +} + +var_dump(preg_replace_callback( '`a+`', 'myCallBack', $string)); +var_dump($array); +? +--EXPECT-- +string(31) xxx bbb ccc ddd eee ccc xxx bbb +array(2) { + [0]= + array(1) { +[0]= +string(3) aaa + } + [1]= + array(1) { +[0]= +string(3) aaa + } +} http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/tests/bug44214_2.phpt?r1=1.1r2=1.2diff_format=u Index: php-src/ext/pcre/tests/bug44214_2.phpt diff -u /dev/null php-src/ext/pcre/tests/bug44214_2.phpt:1.2 --- /dev/null Sat Mar 8 13:14:02 2008 +++ php-src/ext/pcre/tests/bug44214_2.phpt Sat Mar 8 13:14:02 2008 @@ -0,0 +1,25 @@ +--TEST-- +Bug #44214-2 (crash with preg_replace_callback() and global variable) +--FILE-- +?php +$string = 'aaa bbb ccc ddd eee ccc aaa bbb'; + +$array = array(); + +function myCallBack( $match ) { +global $array; +$array[] = $match[0]; +return 'xxx'; +} + +var_dump(preg_replace_callback( '`a+`', 'myCallBack', $string)); +var_dump($array); +? +--EXPECT-- +string(31) xxx bbb ccc ddd eee ccc xxx bbb +array(2) { + [0]= + string(3) aaa + [1]= + string(3) aaa +} -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] cvs: php-src /ext/gd gd.c
felipe Thu Feb 28 17:43:32 2008 UTC Modified files: /php-src/ext/gd gd.c Log: Fixed return value changed previously http://cvs.php.net/viewvc.cgi/php-src/ext/gd/gd.c?r1=1.384r2=1.385diff_format=u Index: php-src/ext/gd/gd.c diff -u php-src/ext/gd/gd.c:1.384 php-src/ext/gd/gd.c:1.385 --- php-src/ext/gd/gd.c:1.384 Thu Feb 28 14:16:12 2008 +++ php-src/ext/gd/gd.c Thu Feb 28 17:43:32 2008 @@ -1351,7 +1351,7 @@ PHP_FUNCTION(gd_info) { if (zend_parse_parameters_none() == FAILURE) { - return; + RETURN_FALSE; } You can leave the 'return;' there, as it's current practice to return NULL when it fails the parameter validation. You may have to tune some tests, though. Nuno -- 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) / NEWS /ext/standard metaphone.c /ext/standard/tests/strings bug44242.phpt
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/metaphone.c?r1=1.28.2.1.2.5r2=1.28.2.1.2.6diff_format=u Index: php-src/ext/standard/metaphone.c diff -u php-src/ext/standard/metaphone.c:1.28.2.1.2.5 php-src/ext/standard/metaphone.c:1.28.2.1.2.6 --- php-src/ext/standard/metaphone.c:1.28.2.1.2.5 Mon Dec 31 07:20:13 2007 +++ php-src/ext/standard/metaphone.c Mon Feb 25 22:40:45 2008 @@ -150,7 +150,12 @@ (*phoned_word)[p_idx++] = c; \ } /* Slap a null character on the end of the phoned word */ -#define End_Phoned_Word {(*phoned_word)[p_idx] = '\0';} +#define End_Phoned_Word { \ + if (p_idx == max_buffer_len) { \ + *phoned_word = erealloc(*phoned_word, max_buffer_len + 1); \ + } \ + (*phoned_word)[p_idx] = '\0'; \ + } /* How long is the phoned word? */ #define Phone_Len (p_idx) uhm, this fix is a bit weird, as *phoned_word == safe_emalloc(sizeof(char), max_buffer_len, 1);. This means that the realloc seems to be a noop (at first sight, at least). Also, you should use safe_erealloc() there instead (if you persist on this fix). Nuno -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/pdo/tests bug_38253.phpt
nlopess Tue Feb 19 14:46:42 2008 UTC Modified files: /php-src/ext/pdo/tests bug_38253.phpt Log: MFB http://cvs.php.net/viewvc.cgi/php-src/ext/pdo/tests/bug_38253.phpt?r1=1.4r2=1.5diff_format=u Index: php-src/ext/pdo/tests/bug_38253.phpt diff -u php-src/ext/pdo/tests/bug_38253.phpt:1.4 php-src/ext/pdo/tests/bug_38253.phpt:1.5 --- php-src/ext/pdo/tests/bug_38253.phpt:1.4Mon May 7 17:23:02 2007 +++ php-src/ext/pdo/tests/bug_38253.phptTue Feb 19 14:46:41 2008 @@ -14,7 +14,7 @@ require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc'; $pdo = PDOTest::factory(); -$pdo-exec (create table test (id integer primary key, n text)); +$pdo-exec (create table test (id integer primary key, n varchar(255))); $pdo-exec (INSERT INTO test (id, n) VALUES (1, 'hi')); $pdo-setAttribute (PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_CLASS); -- 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/pdo/tests bug_38253.phpt
nlopess Tue Feb 19 14:46:20 2008 UTC Modified files: (Branch: PHP_5_3) /php-src/ext/pdo/tests bug_38253.phpt Log: some BDs (e.g. firebird) dont support text, so replace it with varchar(255). http://cvs.php.net/viewvc.cgi/php-src/ext/pdo/tests/bug_38253.phpt?r1=1.1.2.3r2=1.1.2.3.2.1diff_format=u Index: php-src/ext/pdo/tests/bug_38253.phpt diff -u php-src/ext/pdo/tests/bug_38253.phpt:1.1.2.3 php-src/ext/pdo/tests/bug_38253.phpt:1.1.2.3.2.1 --- php-src/ext/pdo/tests/bug_38253.phpt:1.1.2.3Mon May 7 18:03:01 2007 +++ php-src/ext/pdo/tests/bug_38253.phptTue Feb 19 14:46:20 2008 @@ -14,7 +14,7 @@ require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc'; $pdo = PDOTest::factory(); -$pdo-exec (create table test (id integer primary key, n text)); +$pdo-exec (create table test (id integer primary key, n varchar(255))); $pdo-exec (INSERT INTO test (id, n) VALUES (1, 'hi')); $pdo-setAttribute (PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_CLASS); -- 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_3) /ext/standard math.c /ext/standard/tests/math exp_error.phpt
@@ -471,14 +471,14 @@ Returns e raised to the power of the number */ PHP_FUNCTION(exp) { - zval **num; +double num; + +if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, d, num) == FAILURE) { +return; +} + +RETURN_DOUBLE(exp(num)); you have spaces there instead of tabs. Nuno -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src / run-tests.php
nlopess Fri Feb 8 16:47:20 2008 UTC Modified files: /php-srcrun-tests.php Log: fix ===DONE=== with windows EOLs http://cvs.php.net/viewvc.cgi/php-src/run-tests.php?r1=1.341r2=1.342diff_format=u Index: php-src/run-tests.php diff -u php-src/run-tests.php:1.341 php-src/run-tests.php:1.342 --- php-src/run-tests.php:1.341 Tue Jan 15 13:03:22 2008 +++ php-src/run-tests.php Fri Feb 8 16:47:20 2008 @@ -24,7 +24,7 @@ +--+ */ -/* $Id: run-tests.php,v 1.341 2008/01/15 13:03:22 helly Exp $ */ +/* $Id: run-tests.php,v 1.342 2008/02/08 16:47:20 nlopess Exp $ */ /* Sanity check to ensure that pcre extension needed by this script is available. * In the event it is not, print a nice error message indicating that this script will @@ -447,7 +447,7 @@ $html_output = is_resource($html_file); break; case '--version': - echo '$Revision: 1.341 $'.\n; + echo '$Revision: 1.342 $'.\n; exit(1); default: echo Illegal switch specified!\n; @@ -1099,7 +1099,7 @@ } // End of actual test? - if ($secfile preg_match('/^===DONE===$/', $line)) { + if ($secfile preg_match('/^===DONE===\s*$/', $line)) { $secdone = true; } } -- 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) / run-tests.php
nlopess Fri Feb 8 16:46:23 2008 UTC Modified files: (Branch: PHP_5_3) /php-srcrun-tests.php Log: fix ===DONE=== with windows EOLs http://cvs.php.net/viewvc.cgi/php-src/run-tests.php?r1=1.226.2.37.2.35.2.14r2=1.226.2.37.2.35.2.15diff_format=u Index: php-src/run-tests.php diff -u php-src/run-tests.php:1.226.2.37.2.35.2.14 php-src/run-tests.php:1.226.2.37.2.35.2.15 --- php-src/run-tests.php:1.226.2.37.2.35.2.14 Tue Jan 15 13:03:54 2008 +++ php-src/run-tests.php Fri Feb 8 16:46:23 2008 @@ -24,7 +24,7 @@ +--+ */ -/* $Id: run-tests.php,v 1.226.2.37.2.35.2.14 2008/01/15 13:03:54 helly Exp $ */ +/* $Id: run-tests.php,v 1.226.2.37.2.35.2.15 2008/02/08 16:46:23 nlopess Exp $ */ /* Sanity check to ensure that pcre extension needed by this script is available. * In the event it is not, print a nice error message indicating that this script will @@ -440,7 +440,7 @@ $html_output = is_resource($html_file); break; case '--version': - echo '$Revision: 1.226.2.37.2.35.2.14 $'.\n; + echo '$Revision: 1.226.2.37.2.35.2.15 $'.\n; exit(1); case 'u': @@ -1077,7 +1077,7 @@ } // End of actual test? - if ($secfile preg_match('/^===DONE===$/', $line)) { + if ($secfile preg_match('/^===DONE===\s*$/', $line)) { $secdone = true; } } -- 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_3) / run-tests.php
nlopess Fri Feb 8 16:46:23 2008 UTC Modified files: (Branch: PHP_5_3) /php-srcrun-tests.php Log: fix ===DONE=== with windows EOLs http://cvs.php.net/viewvc.cgi/php-src/run-tests.php?r1=1.226.2.37.2.35.2.14r2=1.226.2.37.2.35.2.15diff_format=u Index: php-src/run-tests.php diff -u php-src/run-tests.php:1.226.2.37.2.35.2.14 php-src/run-tests.php:1.226.2.37.2.35.2.15 --- php-src/run-tests.php:1.226.2.37.2.35.2.14 Tue Jan 15 13:03:54 2008 +++ php-src/run-tests.php Fri Feb 8 16:46:23 2008 @@ -1077,7 +1077,7 @@ } // End of actual test? - if ($secfile preg_match('/^===DONE===$/', $line)) { + if ($secfile preg_match('/^===DONE===\s*$/', $line)) { $secdone = true; } } should that not read /^===DONE===\r?$/ ? to be strict, yes, but I don't think we need to be soo strict. Imagine you left a tab after ===DONE===, I think we can allow that as well. Nuno -- 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) /tests/func 010.phpt
nlopess Fri Feb 8 13:49:27 2008 UTC Added files: (Branch: PHP_5_3) /php-src/tests/func 010.phpt Log: add new test to test function with many arguments (i.e. test the new stack implementation) this increases the converage of zend_execute.h by 18% http://cvs.php.net/viewvc.cgi/php-src/tests/func/010.phpt?view=markuprev=1.1 Index: php-src/tests/func/010.phpt +++ php-src/tests/func/010.phpt -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /tests/func 010.phpt
nlopess Fri Feb 8 13:49:53 2008 UTC Modified files: /php-src/tests/func 010.phpt Log: MFB: add new test http://cvs.php.net/viewvc.cgi/php-src/tests/func/010.phpt?r1=1.1r2=1.2diff_format=u Index: php-src/tests/func/010.phpt diff -u /dev/null php-src/tests/func/010.phpt:1.2 --- /dev/null Fri Feb 8 13:49:53 2008 +++ php-src/tests/func/010.phpt Fri Feb 8 13:49:53 2008 @@ -0,0 +1,73 @@ +--TEST-- +function with many parameters +--FILE-- +?php + +// the stack size + some random constant +$boundary = 64*1024; +$limit= $boundary+42; + + +function test($a,$b) +{ + var_dump($a === $b); + test2($a,$b); +} + +function test2($a, $b) +{ + if ($a !== $b) { + var_dump(something went wrong: $a !== $b); + } +} + + +// generate the function +$str = ?php\nfunction x(; + +for($i=0; $i $limit; ++$i) { + $str .= '$v'.dechex($i).($i===($limit-1) ? '' : ','); +} + +$str .= ') { + test($v42, \'42\'); + test(\'4000\', $v4000); + test2($v300, \'300\'); + test($v0, \'0\'); // first + test($v'.dechex($limit-1)., '.dechex($limit-1).'\'); // last + test($v'.dechex($boundary)., '.dechex($boundary).'\'); //boundary + test($v'.dechex($boundary+1)., '.dechex($boundary+1).'\'); //boundary+1 + test($v'.dechex($boundary-1)., '.dechex($boundary-1).'\'); //boundary-1 +}'; + +// generate the function call +$str .= \n\nx(; + +for($i=0; $i $limit; ++$i) { + $str .= '.dechex($i).'.($i===($limit-1) ? '' : ','); +} + +$str .= );\n; + +$filename = dirname(__FILE__).'/010-file.php'; +file_put_contents(dirname(__FILE__).'/010-file.php', $str); +unset($str); + +include($filename); + +echo Done\n; + +? +--CLEAN-- +?php [EMAIL PROTECTED](dirname(__FILE__).'/010-file.php'); +? +--EXPECT-- +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +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_3) /ext/mysql/testsmysql_connect.phpt
The same for the gcov machine: http://gcov.php.net/viewer.php?version=PHP_5_3func=tests Nuno - Original Message - A lot of tests fail for me too, using libmysql. Pretty much same reason as Antony has. On Thu, 2008-02-07 at 15:41 +0200, Andrey Hristov wrote: Antony Dovgal wrote: While you're on it, maybe you'd like to take a look at this test either: # cat 5_3.zts/ext/mysql/tests/mysql_trace_mode.diff 002+ [001] [1044] Access denied for user 'test'@'localhost' to database 'phptest' 004+ Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /local/qa/5_3.zts/ext/mysql/tests/mysql_trace_mode.php on line 9 005+ Which mysql version? libmysql or mysqlnd? 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/imap config.m4
nlopess Thu Jan 31 18:30:42 2008 UTC Modified files: (Branch: PHP_5_3) /php-src/ext/imap config.m4 Log: try to fix build with gcc 4: take #1 http://cvs.php.net/viewvc.cgi/php-src/ext/imap/config.m4?r1=1.69.4.7r2=1.69.4.7.2.1diff_format=u Index: php-src/ext/imap/config.m4 diff -u php-src/ext/imap/config.m4:1.69.4.7 php-src/ext/imap/config.m4:1.69.4.7.2.1 --- php-src/ext/imap/config.m4:1.69.4.7 Sun Feb 11 09:25:32 2007 +++ php-src/ext/imap/config.m4 Thu Jan 31 18:30:42 2008 @@ -1,5 +1,5 @@ dnl -dnl $Id: config.m4,v 1.69.4.7 2007/02/11 09:25:32 tony2001 Exp $ +dnl $Id: config.m4,v 1.69.4.7.2.1 2008/01/31 18:30:42 nlopess Exp $ dnl AC_DEFUN([IMAP_INC_CHK],[if test -r $i$1/c-client.h; then @@ -24,21 +24,27 @@ AC_DEFUN([PHP_IMAP_TEST_BUILD], [ PHP_TEST_BUILD([$1], [$2], [$3], [$4], [ -void mm_log(void){} -void mm_dlog(void){} -void mm_flags(void){} -void mm_fatal(void){} -void mm_critical(void){} -void mm_nocritical(void){} -void mm_notify(void){} -void mm_login(void){} -void mm_diskerror(void){} -void mm_status(void){} -void mm_lsub(void){} -void mm_list(void){} -void mm_exists(void){} -void mm_searched(void){} -void mm_expunged(void){} +#if defined(__GNUC__) __GNUC__ = 4 +# define PHP_IMAP_EXPORT __attribute__ ((visibility(default))) +#else +# define PHP_IMAP_EXPORT +#endif + +PHP_IMAP_EXPORT void mm_log(void){} +PHP_IMAP_EXPORT void mm_dlog(void){} +PHP_IMAP_EXPORT void mm_flags(void){} +PHP_IMAP_EXPORT void mm_fatal(void){} +PHP_IMAP_EXPORT void mm_critical(void){} +PHP_IMAP_EXPORT void mm_nocritical(void){} +PHP_IMAP_EXPORT void mm_notify(void){} +PHP_IMAP_EXPORT void mm_login(void){} +PHP_IMAP_EXPORT void mm_diskerror(void){} +PHP_IMAP_EXPORT void mm_status(void){} +PHP_IMAP_EXPORT void mm_lsub(void){} +PHP_IMAP_EXPORT void mm_list(void){} +PHP_IMAP_EXPORT void mm_exists(void){} +PHP_IMAP_EXPORT void mm_searched(void){} +PHP_IMAP_EXPORT void mm_expunged(void){} ]) ]) -- 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/imap php_imap.c
nlopess Thu Jan 31 18:46:03 2008 UTC Modified files: (Branch: PHP_5_3) /php-src/ext/imap php_imap.c Log: try to fix build with gcc 4: take #2 http://cvs.php.net/viewvc.cgi/php-src/ext/imap/php_imap.c?r1=1.208.2.7.2.26.2.2r2=1.208.2.7.2.26.2.3diff_format=u Index: php-src/ext/imap/php_imap.c diff -u php-src/ext/imap/php_imap.c:1.208.2.7.2.26.2.2 php-src/ext/imap/php_imap.c:1.208.2.7.2.26.2.3 --- php-src/ext/imap/php_imap.c:1.208.2.7.2.26.2.2 Mon Dec 31 07:17:09 2007 +++ php-src/ext/imap/php_imap.c Thu Jan 31 18:46:03 2008 @@ -26,7 +26,7 @@ | PHP 4.0 updates: Zeev Suraski [EMAIL PROTECTED] | +--+ */ -/* $Id: php_imap.c,v 1.208.2.7.2.26.2.2 2007/12/31 07:17:09 sebastian Exp $ */ +/* $Id: php_imap.c,v 1.208.2.7.2.26.2.3 2008/01/31 18:46:03 nlopess Exp $ */ #define IMAP41 @@ -66,6 +66,12 @@ #define SENDBUFLEN 16385 #endif +#if defined(__GNUC__) __GNUC__ = 4 +# define PHP_IMAP_EXPORT __attribute__ ((visibility(default))) +#else +# define PHP_IMAP_EXPORT +#endif + static void _php_make_header_object(zval *myzvalue, ENVELOPE *en TSRMLS_DC); static void _php_imap_add_body(zval *arg, BODY *body TSRMLS_DC); static void _php_imap_parse_address(ADDRESS *addresslist, char **fulladdress, zval *paddress TSRMLS_DC); @@ -4332,7 +4338,7 @@ /* {{{ Interfaces to C-client */ -void mm_searched(MAILSTREAM *stream, unsigned long number) +PHP_IMAP_EXPORT void mm_searched(MAILSTREAM *stream, unsigned long number) { MESSAGELIST *cur = NIL; TSRMLS_FETCH(); @@ -4352,20 +4358,20 @@ } } -void mm_exists(MAILSTREAM *stream, unsigned long number) +PHP_IMAP_EXPORT void mm_exists(MAILSTREAM *stream, unsigned long number) { } -void mm_expunged(MAILSTREAM *stream, unsigned long number) +PHP_IMAP_EXPORT void mm_expunged(MAILSTREAM *stream, unsigned long number) { } -void mm_flags(MAILSTREAM *stream, unsigned long number) +PHP_IMAP_EXPORT void mm_flags(MAILSTREAM *stream, unsigned long number) { } /* Author: CJH */ -void mm_notify(MAILSTREAM *stream, char *str, long errflg) +PHP_IMAP_EXPORT void mm_notify(MAILSTREAM *stream, char *str, long errflg) { STRINGLIST *cur = NIL; TSRMLS_FETCH(); @@ -4388,7 +4394,7 @@ } } -void mm_list(MAILSTREAM *stream, DTYPE delimiter, char *mailbox, long attributes) +PHP_IMAP_EXPORT void mm_list(MAILSTREAM *stream, DTYPE delimiter, char *mailbox, long attributes) { STRINGLIST *cur=NIL; FOBJECTLIST *ocur=NIL; @@ -4435,7 +4441,7 @@ } } -void mm_lsub(MAILSTREAM *stream, DTYPE delimiter, char *mailbox, long attributes) +PHP_IMAP_EXPORT void mm_lsub(MAILSTREAM *stream, DTYPE delimiter, char *mailbox, long attributes) { STRINGLIST *cur=NIL; FOBJECTLIST *ocur=NIL; @@ -4479,7 +4485,7 @@ } } -void mm_status(MAILSTREAM *stream, char *mailbox, MAILSTATUS *status) +PHP_IMAP_EXPORT void mm_status(MAILSTREAM *stream, char *mailbox, MAILSTATUS *status) { TSRMLS_FETCH(); @@ -4501,7 +4507,7 @@ } } -void mm_log(char *str, long errflg) +PHP_IMAP_EXPORT void mm_log(char *str, long errflg) { ERRORLIST *cur = NIL; TSRMLS_FETCH(); @@ -4527,14 +4533,14 @@ } } -void mm_dlog(char *str) +PHP_IMAP_EXPORT void mm_dlog(char *str) { /* CJH: this is for debugging; it might be useful to allow setting the stream to debug mode and capturing this somewhere - syslog? php debugger? */ } -void mm_login(NETMBX *mb, char *user, char *pwd, long trial) +PHP_IMAP_EXPORT void mm_login(NETMBX *mb, char *user, char *pwd, long trial) { TSRMLS_FETCH(); @@ -4546,20 +4552,20 @@ strlcpy (pwd, IMAPG(imap_password), MAILTMPLEN); } -void mm_critical(MAILSTREAM *stream) +PHP_IMAP_EXPORT void mm_critical(MAILSTREAM *stream) { } -void mm_nocritical(MAILSTREAM *stream) +PHP_IMAP_EXPORT void mm_nocritical(MAILSTREAM *stream) { } -long mm_diskerror(MAILSTREAM *stream, long errcode, long serious) +PHP_IMAP_EXPORT long mm_diskerror(MAILSTREAM *stream, long errcode, long serious) { return 1; } -void mm_fatal(char *str) +PHP_IMAP_EXPORT void mm_fatal(char *str) { } /* }}} */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/imap config.m4 php_imap.c
nlopess Thu Jan 31 18:48:01 2008 UTC Modified files: /php-src/ext/imap config.m4 php_imap.c Log: fix gcc 4 build http://cvs.php.net/viewvc.cgi/php-src/ext/imap/config.m4?r1=1.76r2=1.77diff_format=u Index: php-src/ext/imap/config.m4 diff -u php-src/ext/imap/config.m4:1.76 php-src/ext/imap/config.m4:1.77 --- php-src/ext/imap/config.m4:1.76 Sun Feb 11 09:25:25 2007 +++ php-src/ext/imap/config.m4 Thu Jan 31 18:48:00 2008 @@ -1,5 +1,5 @@ dnl -dnl $Id: config.m4,v 1.76 2007/02/11 09:25:25 tony2001 Exp $ +dnl $Id: config.m4,v 1.77 2008/01/31 18:48:00 nlopess Exp $ dnl AC_DEFUN([IMAP_INC_CHK],[if test -r $i$1/c-client.h; then @@ -24,21 +24,27 @@ AC_DEFUN([PHP_IMAP_TEST_BUILD], [ PHP_TEST_BUILD([$1], [$2], [$3], [$4], [ -void mm_log(void){} -void mm_dlog(void){} -void mm_flags(void){} -void mm_fatal(void){} -void mm_critical(void){} -void mm_nocritical(void){} -void mm_notify(void){} -void mm_login(void){} -void mm_diskerror(void){} -void mm_status(void){} -void mm_lsub(void){} -void mm_list(void){} -void mm_exists(void){} -void mm_searched(void){} -void mm_expunged(void){} +#if defined(__GNUC__) __GNUC__ = 4 +# define PHP_IMAP_EXPORT __attribute__ ((visibility(default))) +#else +# define PHP_IMAP_EXPORT +#endif + +PHP_IMAP_EXPORT void mm_log(void){} +PHP_IMAP_EXPORT void mm_dlog(void){} +PHP_IMAP_EXPORT void mm_flags(void){} +PHP_IMAP_EXPORT void mm_fatal(void){} +PHP_IMAP_EXPORT void mm_critical(void){} +PHP_IMAP_EXPORT void mm_nocritical(void){} +PHP_IMAP_EXPORT void mm_notify(void){} +PHP_IMAP_EXPORT void mm_login(void){} +PHP_IMAP_EXPORT void mm_diskerror(void){} +PHP_IMAP_EXPORT void mm_status(void){} +PHP_IMAP_EXPORT void mm_lsub(void){} +PHP_IMAP_EXPORT void mm_list(void){} +PHP_IMAP_EXPORT void mm_exists(void){} +PHP_IMAP_EXPORT void mm_searched(void){} +PHP_IMAP_EXPORT void mm_expunged(void){} ]) ]) http://cvs.php.net/viewvc.cgi/php-src/ext/imap/php_imap.c?r1=1.242r2=1.243diff_format=u Index: php-src/ext/imap/php_imap.c diff -u php-src/ext/imap/php_imap.c:1.242 php-src/ext/imap/php_imap.c:1.243 --- php-src/ext/imap/php_imap.c:1.242 Mon Dec 31 07:12:10 2007 +++ php-src/ext/imap/php_imap.c Thu Jan 31 18:48:00 2008 @@ -26,7 +26,7 @@ | PHP 4.0 updates: Zeev Suraski [EMAIL PROTECTED] | +--+ */ -/* $Id: php_imap.c,v 1.242 2007/12/31 07:12:10 sebastian Exp $ */ +/* $Id: php_imap.c,v 1.243 2008/01/31 18:48:00 nlopess Exp $ */ #define IMAP41 @@ -66,6 +66,12 @@ #define SENDBUFLEN 16385 #endif +#if defined(__GNUC__) __GNUC__ = 4 +# define PHP_IMAP_EXPORT __attribute__ ((visibility(default))) +#else +# define PHP_IMAP_EXPORT +#endif + static void _php_make_header_object(zval *myzvalue, ENVELOPE *en TSRMLS_DC); static void _php_imap_add_body(zval *arg, BODY *body TSRMLS_DC); static void _php_imap_parse_address(ADDRESS *addresslist, char **fulladdress, zval *paddress TSRMLS_DC); @@ -4331,7 +4337,7 @@ /* {{{ Interfaces to C-client */ -void mm_searched(MAILSTREAM *stream, unsigned long number) +PHP_IMAP_EXPORT void mm_searched(MAILSTREAM *stream, unsigned long number) { MESSAGELIST *cur = NIL; TSRMLS_FETCH(); @@ -4351,20 +4357,20 @@ } } -void mm_exists(MAILSTREAM *stream, unsigned long number) +PHP_IMAP_EXPORT void mm_exists(MAILSTREAM *stream, unsigned long number) { } -void mm_expunged(MAILSTREAM *stream, unsigned long number) +PHP_IMAP_EXPORT void mm_expunged(MAILSTREAM *stream, unsigned long number) { } -void mm_flags(MAILSTREAM *stream, unsigned long number) +PHP_IMAP_EXPORT void mm_flags(MAILSTREAM *stream, unsigned long number) { } /* Author: CJH */ -void mm_notify(MAILSTREAM *stream, char *str, long errflg) +PHP_IMAP_EXPORT void mm_notify(MAILSTREAM *stream, char *str, long errflg) { STRINGLIST *cur = NIL; TSRMLS_FETCH(); @@ -4387,7 +4393,7 @@ } } -void mm_list(MAILSTREAM *stream, DTYPE delimiter, char *mailbox, long attributes) +PHP_IMAP_EXPORT void mm_list(MAILSTREAM *stream, DTYPE delimiter, char *mailbox, long attributes) { STRINGLIST *cur=NIL; FOBJECTLIST *ocur=NIL; @@ -4434,7 +4440,7 @@ } } -void mm_lsub(MAILSTREAM *stream, DTYPE delimiter, char *mailbox, long attributes) +PHP_IMAP_EXPORT void mm_lsub(MAILSTREAM *stream, DTYPE delimiter, char *mailbox, long attributes) { STRINGLIST *cur=NIL; FOBJECTLIST *ocur=NIL; @@ -4478,7 +4484,7 @@ } } -void mm_status(MAILSTREAM *stream, char *mailbox, MAILSTATUS *status) +PHP_IMAP_EXPORT void mm_status(MAILSTREAM *stream, char *mailbox, MAILSTATUS *status) { TSRMLS_FETCH(); @@ -4500,7 +4506,7 @@ } } -void mm_log(char *str, long errflg) +PHP_IMAP_EXPORT void mm_log(char *str, long errflg) { ERRORLIST *cur =
[PHP-CVS] cvs: php-src(PHP_5_2) / NEWS /ext/pcre/pcrelib AUTHORS ChangeLog LICENCE NEWS NON-UNIX-USE README config.h dftables.c pcre.h pcre_compile.c pcre_config.c pcre_exec.c pcre_fullinfo.c pcre_ge
nlopess Tue Jan 29 20:25:48 2008 UTC Modified files: (Branch: PHP_5_2) /php-srcNEWS /php-src/ext/pcre/pcrelib AUTHORS ChangeLog LICENCE NEWS NON-UNIX-USE README config.h dftables.c pcre.h pcre_compile.c pcre_config.c pcre_exec.c pcre_fullinfo.c pcre_get.c pcre_globals.c pcre_info.c pcre_internal.h pcre_maketables.c pcre_newline.c pcre_ord2utf8.c pcre_printint.src pcre_refcount.c pcre_study.c pcre_tables.c pcre_try_flipped.c pcre_ucp_searchfuncs.c pcre_valid_utf8.c pcre_version.c pcre_xclass.c pcredemo.c pcregrep.c pcreposix.c pcreposix.h /php-src/ext/pcre/pcrelib/doc pcre.txt /php-src/ext/pcre/pcrelib/testdata testinput4 testoutput4 Log: upgrade to pcre 7.6 http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.1065r2=1.2027.2.547.2.1066diff_format=u Index: php-src/NEWS diff -u php-src/NEWS:1.2027.2.547.2.1065 php-src/NEWS:1.2027.2.547.2.1066 --- php-src/NEWS:1.2027.2.547.2.1065Tue Jan 29 14:23:18 2008 +++ php-src/NEWSTue Jan 29 20:25:47 2008 @@ -6,7 +6,7 @@ (Ilia) - Fixed a bug with PDO::FETCH_COLUMN|PDO::FETCH_GROUP mode when a column # by which to group by data is specified. (Ilia) -- Upgraded PCRE to version 7.5 (Nuno) +- Upgraded PCRE to version 7.6 (Nuno) - Fixed bug #43954 (Memory leak when sending the same HTTP status code multiple times). (Scott) http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/pcrelib/AUTHORS?r1=1.5.4.2r2=1.5.4.3diff_format=u Index: php-src/ext/pcre/pcrelib/AUTHORS diff -u php-src/ext/pcre/pcrelib/AUTHORS:1.5.4.2 php-src/ext/pcre/pcrelib/AUTHORS:1.5.4.3 --- php-src/ext/pcre/pcrelib/AUTHORS:1.5.4.2Fri Jun 15 19:09:24 2007 +++ php-src/ext/pcre/pcrelib/AUTHORSTue Jan 29 20:25:47 2008 @@ -8,7 +8,7 @@ University of Cambridge Computing Service, Cambridge, England. -Copyright (c) 1997-2007 University of Cambridge +Copyright (c) 1997-2008 University of Cambridge All rights reserved @@ -17,7 +17,7 @@ Written by: Google Inc. -Copyright (c) 2007 Google Inc +Copyright (c) 2007-2008 Google Inc All rights reserved http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/pcrelib/ChangeLog?r1=1.12.2.1.2.6r2=1.12.2.1.2.7diff_format=u Index: php-src/ext/pcre/pcrelib/ChangeLog diff -u php-src/ext/pcre/pcrelib/ChangeLog:1.12.2.1.2.6 php-src/ext/pcre/pcrelib/ChangeLog:1.12.2.1.2.7 --- php-src/ext/pcre/pcrelib/ChangeLog:1.12.2.1.2.6 Mon Jan 14 09:39:40 2008 +++ php-src/ext/pcre/pcrelib/ChangeLog Tue Jan 29 20:25:47 2008 @@ -1,6 +1,54 @@ ChangeLog for PCRE -- +Version 7.6 28-Jan-08 +- + +1. A character class containing a very large number of characters with +codepoints greater than 255 (in UTF-8 mode, of course) caused a buffer +overflow. + +2. Patch to cut out the long long test in pcrecpp_unittest when +HAVE_LONG_LONG is not defined. + +3. Applied Christian Ehrlicher's patch to update the CMake build files to +bring them up to date and include new features. This patch includes: + +- Fixed PH's badly added libz and libbz2 support. +- Fixed a problem with static linking. +- Added pcredemo. [But later removed - see 7 below.] +- Fixed dftables problem and added an option. +- Added a number of HAVE_XXX tests, including HAVE_WINDOWS_H and +HAVE_LONG_LONG. +- Added readline support for pcretest. +- Added an listing of the option settings after cmake has run. + +4. A user submitted a patch to Makefile that makes it easy to create +pcre.dll under mingw when using Configure/Make. I added stuff to +Makefile.am that cause it to include this special target, without +affecting anything else. Note that the same mingw target plus all +the other distribution libraries and programs are now supported +when configuring with CMake (see 6 below) instead of with +Configure/Make. + +5. Applied Craig's patch that moves no_arg into the RE class in the C++ code. +This is an attempt to solve the reported problem pcrecpp::no_arg is not +exported in the Windows port. It has not yet been confirmed that the patch +solves the problem, but it does no harm. + +6. Applied Sheri's patch to CMakeLists.txt to add NON_STANDARD_LIB_PREFIX and +NON_STANDARD_LIB_SUFFIX for dll names built with mingw when configured +with CMake, and also correct the comment about stack recursion. + +7. Remove the automatic building of pcredemo from the ./configure system and +from CMakeLists.txt. The whole idea of pcredemo.c is that it is an example +of a program that users should build themselves
[PHP-CVS] cvs: php-src(PHP_5_3) /ext/mysql php_mysql_structs.h
nlopess Mon Jan 28 11:16:00 2008 UTC Modified files: (Branch: PHP_5_3) /php-src/ext/mysql php_mysql_structs.h Log: remove unused PHP_MYSQL_API macro http://cvs.php.net/viewvc.cgi/php-src/ext/mysql/php_mysql_structs.h?r1=1.1.2.2r2=1.1.2.3diff_format=u Index: php-src/ext/mysql/php_mysql_structs.h diff -u php-src/ext/mysql/php_mysql_structs.h:1.1.2.2 php-src/ext/mysql/php_mysql_structs.h:1.1.2.3 --- php-src/ext/mysql/php_mysql_structs.h:1.1.2.2 Mon Dec 31 07:17:10 2007 +++ php-src/ext/mysql/php_mysql_structs.h Mon Jan 28 11:16:00 2008 @@ -18,17 +18,11 @@ */ -/* $Id: php_mysql_structs.h,v 1.1.2.2 2007/12/31 07:17:10 sebastian Exp $ */ +/* $Id: php_mysql_structs.h,v 1.1.2.3 2008/01/28 11:16:00 nlopess Exp $ */ #ifndef PHP_MYSQL_STRUCTS_H #define PHP_MYSQL_STRUCTS_H -#ifdef PHP_WIN32 -#define PHP_MYSQL_API __declspec(dllexport) -#else -#define PHP_MYSQL_API -#endif - #ifdef ZTS #include TSRM.h #endif -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/mysql php_mysql_structs.h
nlopess Mon Jan 28 11:16:37 2008 UTC Modified files: /php-src/ext/mysql php_mysql_structs.h Log: remove unused PHP_MYSQL_API macro http://cvs.php.net/viewvc.cgi/php-src/ext/mysql/php_mysql_structs.h?r1=1.3r2=1.4diff_format=u Index: php-src/ext/mysql/php_mysql_structs.h diff -u php-src/ext/mysql/php_mysql_structs.h:1.3 php-src/ext/mysql/php_mysql_structs.h:1.4 --- php-src/ext/mysql/php_mysql_structs.h:1.3 Mon Dec 31 07:12:11 2007 +++ php-src/ext/mysql/php_mysql_structs.h Mon Jan 28 11:16:37 2008 @@ -17,17 +17,11 @@ +--+ */ -/* $Id: php_mysql_structs.h,v 1.3 2007/12/31 07:12:11 sebastian Exp $ */ +/* $Id: php_mysql_structs.h,v 1.4 2008/01/28 11:16:37 nlopess Exp $ */ #ifndef PHP_MYSQL_STRUCTS_H #define PHP_MYSQL_STRUCTS_H -#ifdef PHP_WIN32 -#define PHP_MYSQL_API __declspec(dllexport) -#else -#define PHP_MYSQL_API -#endif - #if HAVE_MYSQL #ifdef ZTS -- 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/tests/strings moneyformat.phpt setlocale_basic1.phpt setlocale_basic2.phpt setlocale_basic3.phpt setlocale_variation1.phpt setlocale_variation3.phpt setlo
nlopess Sun Jan 27 16:45:43 2008 UTC Modified files: (Branch: PHP_5_3) /php-src/ext/standard/tests/strings moneyformat.phpt setlocale_basic1.phpt setlocale_basic2.phpt setlocale_basic3.phpt setlocale_variation1.phpt setlocale_variation3.phpt setlocale_variation4.phpt setlocale_variation5.phpt Log: fix a bunch of SKIPIF (check for non available locales) http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/moneyformat.phpt?r1=1.1.2.2r2=1.1.2.2.2.1diff_format=u Index: php-src/ext/standard/tests/strings/moneyformat.phpt diff -u php-src/ext/standard/tests/strings/moneyformat.phpt:1.1.2.2 php-src/ext/standard/tests/strings/moneyformat.phpt:1.1.2.2.2.1 --- php-src/ext/standard/tests/strings/moneyformat.phpt:1.1.2.2 Wed Jun 6 17:46:17 2007 +++ php-src/ext/standard/tests/strings/moneyformat.phpt Sun Jan 27 16:45:43 2008 @@ -5,6 +5,10 @@ if (!function_exists('money_format') || !function_exists('setlocale')) { die(SKIP money_format - not supported\n); } + +if (setlocale(LC_MONETARY, 'en_US') == false) { + die('skip en_US locale not available'); +} ? --FILE-- ?php http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/setlocale_basic1.phpt?r1=1.1.4.3r2=1.1.4.4diff_format=u Index: php-src/ext/standard/tests/strings/setlocale_basic1.phpt diff -u php-src/ext/standard/tests/strings/setlocale_basic1.phpt:1.1.4.3 php-src/ext/standard/tests/strings/setlocale_basic1.phpt:1.1.4.4 --- php-src/ext/standard/tests/strings/setlocale_basic1.phpt:1.1.4.3Wed Dec 19 10:39:10 2007 +++ php-src/ext/standard/tests/strings/setlocale_basic1.phptSun Jan 27 16:45:43 2008 @@ -5,6 +5,9 @@ if (substr(PHP_OS, 0, 3) == 'WIN') { die('skip Not valid for windows'); } +if (setlocale(LC_ALL, en_US.utf8, en_AU.utf8, ko_KR.utf8, zh_CN.utf8, de_DE.utf8, es_EC.utf8, fr_FR.utf8, ja_JP.utf8, el_GR.utf8, nl_NL.utf8) === false) { +die('skip available locales not usable'); +} ? --FILE-- ?php http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/setlocale_basic2.phpt?r1=1.1.4.2r2=1.1.4.3diff_format=u Index: php-src/ext/standard/tests/strings/setlocale_basic2.phpt diff -u php-src/ext/standard/tests/strings/setlocale_basic2.phpt:1.1.4.2 php-src/ext/standard/tests/strings/setlocale_basic2.phpt:1.1.4.3 --- php-src/ext/standard/tests/strings/setlocale_basic2.phpt:1.1.4.2Fri Oct 5 19:32:28 2007 +++ php-src/ext/standard/tests/strings/setlocale_basic2.phptSun Jan 27 16:45:43 2008 @@ -5,6 +5,9 @@ if (substr(PHP_OS, 0, 3) == 'WIN') { die('skip Not valid for windows'); } +if (setlocale(LC_ALL, en_US.utf8, en_AU.utf8, ko_KR.utf8, zh_CN.utf8, de_DE.utf8, es_EC.utf8, fr_FR.utf8, ja_JP.utf8, el_GR.utf8, nl_NL.utf8) === false) { +die('skip available locales not usable'); +} ? --FILE-- ?php http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/setlocale_basic3.phpt?r1=1.1.4.2r2=1.1.4.3diff_format=u Index: php-src/ext/standard/tests/strings/setlocale_basic3.phpt diff -u php-src/ext/standard/tests/strings/setlocale_basic3.phpt:1.1.4.2 php-src/ext/standard/tests/strings/setlocale_basic3.phpt:1.1.4.3 --- php-src/ext/standard/tests/strings/setlocale_basic3.phpt:1.1.4.2Fri Oct 5 19:32:28 2007 +++ php-src/ext/standard/tests/strings/setlocale_basic3.phptSun Jan 27 16:45:43 2008 @@ -5,6 +5,9 @@ if (substr(PHP_OS, 0, 3) == 'WIN') { die('skip Not valid for windows'); } +if (setlocale(LC_ALL, en_US.utf8, Ko_KR.utf8, zh_CN.utf8) === false) { +die('skip en_US.utf8/Ko_KR.utf8/zh_CN.utf8 locales not available'); +} ? --FILE-- ?php http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/setlocale_variation1.phpt?r1=1.1.4.2r2=1.1.4.3diff_format=u Index: php-src/ext/standard/tests/strings/setlocale_variation1.phpt diff -u php-src/ext/standard/tests/strings/setlocale_variation1.phpt:1.1.4.2 php-src/ext/standard/tests/strings/setlocale_variation1.phpt:1.1.4.3 --- php-src/ext/standard/tests/strings/setlocale_variation1.phpt:1.1.4.2 Fri Oct 5 19:32:28 2007 +++ php-src/ext/standard/tests/strings/setlocale_variation1.phptSun Jan 27 16:45:43 2008 @@ -5,6 +5,9 @@ if (substr(PHP_OS, 0, 3) == 'WIN') { die('skip Not valid for windows'); } +if (setlocale(LC_ALL, en_US.utf8, Ko_KR.utf8, zh_CN.utf8) === false) { +die('skip en_US.utf8/Ko_KR.utf8/zh_CN.utf8 locales not available'); +} ? --FILE-- ?php http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/setlocale_variation3.phpt?r1=1.1.4.2r2=1.1.4.3diff_format=u Index: php-src/ext/standard/tests/strings/setlocale_variation3.phpt diff -u php-src/ext/standard/tests/strings/setlocale_variation3.phpt:1.1.4.2
[PHP-CVS] cvs: php-src /ext/standard/tests/strings moneyformat.phpt
nlopess Sun Jan 27 16:54:02 2008 UTC Modified files: /php-src/ext/standard/tests/strings moneyformat.phpt Log: be more strict in the skipif http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/moneyformat.phpt?r1=1.5r2=1.6diff_format=u Index: php-src/ext/standard/tests/strings/moneyformat.phpt diff -u php-src/ext/standard/tests/strings/moneyformat.phpt:1.5 php-src/ext/standard/tests/strings/moneyformat.phpt:1.6 --- php-src/ext/standard/tests/strings/moneyformat.phpt:1.5 Sun Jan 27 16:52:34 2008 +++ php-src/ext/standard/tests/strings/moneyformat.phpt Sun Jan 27 16:54:02 2008 @@ -6,7 +6,7 @@ die(SKIP money_format - not supported\n); } -if (setlocale(LC_MONETARY, 'en_US') == false) { +if (setlocale(LC_MONETARY, 'en_US') === false) { die('skip en_US locale not available'); } ? -- 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/tests/strings moneyformat.phpt
nlopess Sun Jan 27 16:54:22 2008 UTC Modified files: (Branch: PHP_5_3) /php-src/ext/standard/tests/strings moneyformat.phpt Log: be more strict in the skipif http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/moneyformat.phpt?r1=1.1.2.2.2.1r2=1.1.2.2.2.2diff_format=u Index: php-src/ext/standard/tests/strings/moneyformat.phpt diff -u php-src/ext/standard/tests/strings/moneyformat.phpt:1.1.2.2.2.1 php-src/ext/standard/tests/strings/moneyformat.phpt:1.1.2.2.2.2 --- php-src/ext/standard/tests/strings/moneyformat.phpt:1.1.2.2.2.1 Sun Jan 27 16:45:43 2008 +++ php-src/ext/standard/tests/strings/moneyformat.phpt Sun Jan 27 16:54:22 2008 @@ -6,7 +6,7 @@ die(SKIP money_format - not supported\n); } -if (setlocale(LC_MONETARY, 'en_US') == false) { +if (setlocale(LC_MONETARY, 'en_US') === false) { die('skip en_US locale not available'); } ? -- 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/date/tests bug43003.phpt
nlopess Sun Jan 27 17:01:11 2008 UTC Modified files: (Branch: PHP_5_3) /php-src/ext/date/tests bug43003.phpt Log: fix test http://cvs.php.net/viewvc.cgi/php-src/ext/date/tests/bug43003.phpt?r1=1.1.2.2r2=1.1.2.3diff_format=u Index: php-src/ext/date/tests/bug43003.phpt diff -u php-src/ext/date/tests/bug43003.phpt:1.1.2.2 php-src/ext/date/tests/bug43003.phpt:1.1.2.3 --- php-src/ext/date/tests/bug43003.phpt:1.1.2.2Thu Jan 17 19:59:00 2008 +++ php-src/ext/date/tests/bug43003.phptSun Jan 27 17:01:11 2008 @@ -2,6 +2,8 @@ Bug #43003 (Invalid timezone reported for DateTime objects constructed using a timestamp) --FILE-- ?php +date_default_timezone_set('Europe/Oslo'); + $oDateTest = new DateTime(@0, new DateTimeZone(date_default_timezone_get())); echo $oDateTest-getTimezone()-getName().: . $oDateTest-format(Y-m-d H:i:s).\n; -- 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 bug43003.phpt
nlopess Sun Jan 27 17:02:01 2008 UTC Modified files: /php-src/ext/date/tests bug43003.phpt Log: fix test http://cvs.php.net/viewvc.cgi/php-src/ext/date/tests/bug43003.phpt?r1=1.1r2=1.2diff_format=u Index: php-src/ext/date/tests/bug43003.phpt diff -u php-src/ext/date/tests/bug43003.phpt:1.1 php-src/ext/date/tests/bug43003.phpt:1.2 --- php-src/ext/date/tests/bug43003.phpt:1.1Thu Jan 17 19:58:24 2008 +++ php-src/ext/date/tests/bug43003.phptSun Jan 27 17:02:01 2008 @@ -2,6 +2,8 @@ Bug #43003 (Invalid timezone reported for DateTime objects constructed using a timestamp) --FILE-- ?php +date_default_timezone_set('Europe/Oslo'); + $oDateTest = new DateTime(@0, new DateTimeZone(date_default_timezone_get())); echo $oDateTest-getTimezone()-getName().: . $oDateTest-format(Y-m-d H:i:s).\n; -- 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/strings moneyformat.phpt setlocale_basic1.phpt setlocale_basic2.phpt setlocale_basic3.phpt setlocale_variation1.phpt setlocale_variation3.phpt setlocale_vari
nlopess Sun Jan 27 16:52:34 2008 UTC Modified files: /php-src/ext/standard/tests/strings moneyformat.phpt setlocale_basic1.phpt setlocale_basic2.phpt setlocale_basic3.phpt setlocale_variation1.phpt setlocale_variation3.phpt setlocale_variation4.phpt setlocale_variation5.phpt Log: MFB: fix skipifs http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/moneyformat.phpt?r1=1.4r2=1.5diff_format=u Index: php-src/ext/standard/tests/strings/moneyformat.phpt diff -u php-src/ext/standard/tests/strings/moneyformat.phpt:1.4 php-src/ext/standard/tests/strings/moneyformat.phpt:1.5 --- php-src/ext/standard/tests/strings/moneyformat.phpt:1.4 Mon Oct 1 12:01:28 2007 +++ php-src/ext/standard/tests/strings/moneyformat.phpt Sun Jan 27 16:52:34 2008 @@ -5,6 +5,10 @@ if (!function_exists('money_format') || !function_exists('setlocale')) { die(SKIP money_format - not supported\n); } + +if (setlocale(LC_MONETARY, 'en_US') == false) { + die('skip en_US locale not available'); +} ? --FILE-- ?php http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/setlocale_basic1.phpt?r1=1.3r2=1.4diff_format=u Index: php-src/ext/standard/tests/strings/setlocale_basic1.phpt diff -u php-src/ext/standard/tests/strings/setlocale_basic1.phpt:1.3 php-src/ext/standard/tests/strings/setlocale_basic1.phpt:1.4 --- php-src/ext/standard/tests/strings/setlocale_basic1.phpt:1.3Wed Dec 19 10:37:42 2007 +++ php-src/ext/standard/tests/strings/setlocale_basic1.phptSun Jan 27 16:52:34 2008 @@ -7,6 +7,9 @@ if( ini_get(unicode.semantics) == 1) die('skip do not run when unicode on'); + +if (setlocale(LC_ALL, en_US.utf8, en_AU.utf8, ko_KR.utf8, zh_CN.utf8, de_DE.utf8, es_EC.utf8, fr_FR.utf8, ja_JP.utf8, el_GR.utf8, nl_NL.utf8) === false) + die('skip available locales not usable'); ? --FILE-- ?php http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/setlocale_basic2.phpt?r1=1.2r2=1.3diff_format=u Index: php-src/ext/standard/tests/strings/setlocale_basic2.phpt diff -u php-src/ext/standard/tests/strings/setlocale_basic2.phpt:1.2 php-src/ext/standard/tests/strings/setlocale_basic2.phpt:1.3 --- php-src/ext/standard/tests/strings/setlocale_basic2.phpt:1.2Fri Oct 5 19:35:45 2007 +++ php-src/ext/standard/tests/strings/setlocale_basic2.phptSun Jan 27 16:52:34 2008 @@ -6,6 +6,8 @@ die('skip Not valid for windows'); if(ini_get(unicode.semantics) == 1) die('skip do not run when unicode on'); +if (setlocale(LC_ALL, en_US.utf8, en_AU.utf8, ko_KR.utf8, zh_CN.utf8, de_DE.utf8, es_EC.utf8, fr_FR.utf8, ja_JP.utf8, el_GR.utf8, nl_NL.utf8) === false) + die('skip available locales not usable'); ? --FILE-- ?php http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/setlocale_basic3.phpt?r1=1.2r2=1.3diff_format=u Index: php-src/ext/standard/tests/strings/setlocale_basic3.phpt diff -u php-src/ext/standard/tests/strings/setlocale_basic3.phpt:1.2 php-src/ext/standard/tests/strings/setlocale_basic3.phpt:1.3 --- php-src/ext/standard/tests/strings/setlocale_basic3.phpt:1.2Fri Oct 5 19:35:45 2007 +++ php-src/ext/standard/tests/strings/setlocale_basic3.phptSun Jan 27 16:52:34 2008 @@ -6,6 +6,8 @@ die('skip Not valid for windows'); if(ini_get(unicode.semantics) == 1) die('skip do not run when unicode on'); +if (setlocale(LC_ALL, en_US.utf8, Ko_KR.utf8, zh_CN.utf8) === false) + die('skip en_US.utf8/Ko_KR.utf8/zh_CN.utf8 locales not available'); ? --FILE-- ?php http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/setlocale_variation1.phpt?r1=1.2r2=1.3diff_format=u Index: php-src/ext/standard/tests/strings/setlocale_variation1.phpt diff -u php-src/ext/standard/tests/strings/setlocale_variation1.phpt:1.2 php-src/ext/standard/tests/strings/setlocale_variation1.phpt:1.3 --- php-src/ext/standard/tests/strings/setlocale_variation1.phpt:1.2Fri Oct 5 19:35:45 2007 +++ php-src/ext/standard/tests/strings/setlocale_variation1.phptSun Jan 27 16:52:34 2008 @@ -6,6 +6,8 @@ die('skip Not valid for windows'); if(ini_get(unicode.semantics) == 1) die('skip do not run when unicode on'); +if (setlocale(LC_ALL, en_US.utf8, Ko_KR.utf8, zh_CN.utf8) === false) + die('skip en_US.utf8/Ko_KR.utf8/zh_CN.utf8 locales not available'); ? --FILE-- ?php http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/setlocale_variation3.phpt?r1=1.2r2=1.3diff_format=u Index: php-src/ext/standard/tests/strings/setlocale_variation3.phpt diff -u php-src/ext/standard/tests/strings/setlocale_variation3.phpt:1.2 php-src/ext/standard/tests/strings/setlocale_variation3.phpt:1.3 ---
Re: [PHP-CVS] cvs: php-src /ext/spl php_spl.c php_spl.h /ext/tidy php_tidy.h tidy.c
Thank you for reverting this. It seems that the Zend engine really requires right access to these structures. The engine needs fixing first. Thanks, Nuno - Original Message - From: Marcus Boerger [EMAIL PROTECTED] To: php-cvs@lists.php.net Sent: Sunday, January 27, 2008 3:03 PM Subject: [PHP-CVS] cvs: php-src /ext/spl php_spl.c php_spl.h /ext/tidy php_tidy.h tidy.c helly Sun Jan 27 15:03:55 2008 UTC Modified files: /php-src/ext/spl php_spl.c php_spl.h /php-src/ext/tidy php_tidy.h tidy.c Log: - revert over constfying http://cvs.php.net/viewvc.cgi/php-src/ext/spl/php_spl.c?r1=1.121r2=1.122diff_format=u Index: php-src/ext/spl/php_spl.c diff -u php-src/ext/spl/php_spl.c:1.121 php-src/ext/spl/php_spl.c:1.122 --- php-src/ext/spl/php_spl.c:1.121 Fri Jan 25 20:30:36 2008 +++ php-src/ext/spl/php_spl.c Sun Jan 27 15:03:55 2008 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: php_spl.c,v 1.121 2008/01/25 20:30:36 nlopess Exp $ */ +/* $Id: php_spl.c,v 1.122 2008/01/27 15:03:55 helly Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -781,7 +781,7 @@ /* {{{ spl_module_entry */ -const zend_module_entry spl_module_entry = { +zend_module_entry spl_module_entry = { #ifdef HAVE_SIMPLEXML STANDARD_MODULE_HEADER_EX, NULL, spl_deps, http://cvs.php.net/viewvc.cgi/php-src/ext/spl/php_spl.h?r1=1.25r2=1.26diff_format=u Index: php-src/ext/spl/php_spl.h diff -u php-src/ext/spl/php_spl.h:1.25 php-src/ext/spl/php_spl.h:1.26 --- php-src/ext/spl/php_spl.h:1.25 Fri Jan 25 20:30:36 2008 +++ php-src/ext/spl/php_spl.h Sun Jan 27 15:03:55 2008 @@ -28,7 +28,7 @@ #define SPL_DEBUG(x) #endif -extern const zend_module_entry spl_module_entry; +extern zend_module_entry spl_module_entry; #define phpext_spl_ptr spl_module_entry #ifdef PHP_WIN32 http://cvs.php.net/viewvc.cgi/php-src/ext/tidy/php_tidy.h?r1=1.37r2=1.38diff_format=u Index: php-src/ext/tidy/php_tidy.h diff -u php-src/ext/tidy/php_tidy.h:1.37 php-src/ext/tidy/php_tidy.h:1.38 --- php-src/ext/tidy/php_tidy.h:1.37 Fri Jan 25 20:30:36 2008 +++ php-src/ext/tidy/php_tidy.h Sun Jan 27 15:03:55 2008 @@ -16,12 +16,12 @@ +--+ */ -/* $Id: php_tidy.h,v 1.37 2008/01/25 20:30:36 nlopess Exp $ */ +/* $Id: php_tidy.h,v 1.38 2008/01/27 15:03:55 helly Exp $ */ #ifndef PHP_TIDY_H #define PHP_TIDY_H -extern const zend_module_entry tidy_module_entry; +extern zend_module_entry tidy_module_entry; #define phpext_tidy_ptr tidy_module_entry #define TIDY_METHOD_MAP(name, func_name, arg_types) \ http://cvs.php.net/viewvc.cgi/php-src/ext/tidy/tidy.c?r1=1.119r2=1.120diff_format=u Index: php-src/ext/tidy/tidy.c diff -u php-src/ext/tidy/tidy.c:1.119 php-src/ext/tidy/tidy.c:1.120 --- php-src/ext/tidy/tidy.c:1.119 Fri Jan 25 20:30:36 2008 +++ php-src/ext/tidy/tidy.c Sun Jan 27 15:03:55 2008 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: tidy.c,v 1.119 2008/01/25 20:30:36 nlopess Exp $ */ +/* $Id: tidy.c,v 1.120 2008/01/27 15:03:55 helly Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -359,7 +359,7 @@ static zend_object_handlers tidy_object_handlers_doc; static zend_object_handlers tidy_object_handlers_node; -const zend_module_entry tidy_module_entry = { +zend_module_entry tidy_module_entry = { STANDARD_MODULE_HEADER, tidy, tidy_functions, @@ -1062,7 +1062,7 @@ php_info_print_table_start(); php_info_print_table_header(2, Tidy support, enabled); php_info_print_table_row(2, libTidy Release, (char *)tidyReleaseDate()); - php_info_print_table_row(2, Extension Version, PHP_TIDY_MODULE_VERSION ($Id: tidy.c,v 1.119 2008/01/25 20:30:36 nlopess Exp $)); + php_info_print_table_row(2, Extension Version, PHP_TIDY_MODULE_VERSION ($Id: tidy.c,v 1.120 2008/01/27 15:03:55 helly Exp $)); php_info_print_table_end(); DISPLAY_INI_ENTRIES(); -- 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
Re: [PHP-CVS] cvs: php-src /ext/spl php_spl.c php_spl.h /ext/tidy php_tidy.h tidy.c
I'll take a look into that to see how feasible it is and if it presents any useful gains. Thanks, Nuno - Original Message - Hello Nuno, it writes the module number in the structure. We could have the macros create a static non const int that receives the module number and reference that from the struct via a pointer, which would be compatible to the struct being static const then. marcus Sunday, January 27, 2008, 6:08:47 PM, you wrote: Thank you for reverting this. It seems that the Zend engine really requires right access to these structures. The engine needs fixing first. Thanks, Nuno - Original Message - From: Marcus Boerger [EMAIL PROTECTED] To: php-cvs@lists.php.net Sent: Sunday, January 27, 2008 3:03 PM Subject: [PHP-CVS] cvs: php-src /ext/spl php_spl.c php_spl.h /ext/tidy php_tidy.h tidy.c helly Sun Jan 27 15:03:55 2008 UTC Modified files: /php-src/ext/spl php_spl.c php_spl.h /php-src/ext/tidy php_tidy.h tidy.c Log: - revert over constfying http://cvs.php.net/viewvc.cgi/php-src/ext/spl/php_spl.c?r1=1.121r2=1.122diff_format=u Index: php-src/ext/spl/php_spl.c diff -u php-src/ext/spl/php_spl.c:1.121 php-src/ext/spl/php_spl.c:1.122 --- php-src/ext/spl/php_spl.c:1.121 Fri Jan 25 20:30:36 2008 +++ php-src/ext/spl/php_spl.c Sun Jan 27 15:03:55 2008 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: php_spl.c,v 1.121 2008/01/25 20:30:36 nlopess Exp $ */ +/* $Id: php_spl.c,v 1.122 2008/01/27 15:03:55 helly Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -781,7 +781,7 @@ /* {{{ spl_module_entry */ -const zend_module_entry spl_module_entry = { +zend_module_entry spl_module_entry = { #ifdef HAVE_SIMPLEXML STANDARD_MODULE_HEADER_EX, NULL, spl_deps, http://cvs.php.net/viewvc.cgi/php-src/ext/spl/php_spl.h?r1=1.25r2=1.26diff_format=u Index: php-src/ext/spl/php_spl.h diff -u php-src/ext/spl/php_spl.h:1.25 php-src/ext/spl/php_spl.h:1.26 --- php-src/ext/spl/php_spl.h:1.25 Fri Jan 25 20:30:36 2008 +++ php-src/ext/spl/php_spl.h Sun Jan 27 15:03:55 2008 @@ -28,7 +28,7 @@ #define SPL_DEBUG(x) #endif -extern const zend_module_entry spl_module_entry; +extern zend_module_entry spl_module_entry; #define phpext_spl_ptr spl_module_entry #ifdef PHP_WIN32 http://cvs.php.net/viewvc.cgi/php-src/ext/tidy/php_tidy.h?r1=1.37r2=1.38diff_format=u Index: php-src/ext/tidy/php_tidy.h diff -u php-src/ext/tidy/php_tidy.h:1.37 php-src/ext/tidy/php_tidy.h:1.38 --- php-src/ext/tidy/php_tidy.h:1.37 Fri Jan 25 20:30:36 2008 +++ php-src/ext/tidy/php_tidy.h Sun Jan 27 15:03:55 2008 @@ -16,12 +16,12 @@ +--+ */ -/* $Id: php_tidy.h,v 1.37 2008/01/25 20:30:36 nlopess Exp $ */ +/* $Id: php_tidy.h,v 1.38 2008/01/27 15:03:55 helly Exp $ */ #ifndef PHP_TIDY_H #define PHP_TIDY_H -extern const zend_module_entry tidy_module_entry; +extern zend_module_entry tidy_module_entry; #define phpext_tidy_ptr tidy_module_entry #define TIDY_METHOD_MAP(name, func_name, arg_types) \ http://cvs.php.net/viewvc.cgi/php-src/ext/tidy/tidy.c?r1=1.119r2=1.120diff_format=u Index: php-src/ext/tidy/tidy.c diff -u php-src/ext/tidy/tidy.c:1.119 php-src/ext/tidy/tidy.c:1.120 --- php-src/ext/tidy/tidy.c:1.119 Fri Jan 25 20:30:36 2008 +++ php-src/ext/tidy/tidy.c Sun Jan 27 15:03:55 2008 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: tidy.c,v 1.119 2008/01/25 20:30:36 nlopess Exp $ */ +/* $Id: tidy.c,v 1.120 2008/01/27 15:03:55 helly Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -359,7 +359,7 @@ static zend_object_handlers tidy_object_handlers_doc; static zend_object_handlers tidy_object_handlers_node; -const zend_module_entry tidy_module_entry = { +zend_module_entry tidy_module_entry = { STANDARD_MODULE_HEADER, tidy, tidy_functions, @@ -1062,7 +1062,7 @@ php_info_print_table_start(); php_info_print_table_header(2, Tidy support, enabled); php_info_print_table_row(2, libTidy Release, (char *)tidyReleaseDate()); - php_info_print_table_row(2, Extension Version, PHP_TIDY_MODULE_VERSION ($Id: tidy.c,v 1.119 2008/01/25 20:30:36 nlopess Exp $)); + php_info_print_table_row(2, Extension Version, PHP_TIDY_MODULE_VERSION ($Id: tidy.c,v 1.120 2008/01/27 15:03:55 helly Exp $)); php_info_print_table_end(); DISPLAY_INI_ENTRIES(); -- 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_3) /ext/spl php_spl.c php_spl.h /ext/tidy php_tidy.h tidy.c
On 25.01.2008 23:29, Nuno Lopes wrote: -zend_module_entry spl_module_entry = { +const zend_module_entry spl_module_entry = { -zend_module_entry tidy_module_entry = { +const zend_module_entry tidy_module_entry = { This makes PHP to crash right after the start. Please revert. Ah damn.. Sorry for the breakage and thanks for letting me know about this. (I though I had tested everything...) Tomorrow I'll fix it (today I'm just too tired). Thanks, Nuno -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/pdo pdo_sqlstate.c
nlopess Fri Jan 25 19:58:51 2008 UTC Modified files: /php-src/ext/pdopdo_sqlstate.c Log: MFB: move data to const segment http://cvs.php.net/viewvc.cgi/php-src/ext/pdo/pdo_sqlstate.c?r1=1.11r2=1.12diff_format=u Index: php-src/ext/pdo/pdo_sqlstate.c diff -u php-src/ext/pdo/pdo_sqlstate.c:1.11 php-src/ext/pdo/pdo_sqlstate.c:1.12 --- php-src/ext/pdo/pdo_sqlstate.c:1.11 Mon Dec 31 07:12:13 2007 +++ php-src/ext/pdo/pdo_sqlstate.c Fri Jan 25 19:58:51 2008 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: pdo_sqlstate.c,v 1.11 2007/12/31 07:12:13 sebastian Exp $ */ +/* $Id: pdo_sqlstate.c,v 1.12 2008/01/25 19:58:51 nlopess Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -29,13 +29,13 @@ #include php_pdo_driver.h struct pdo_sqlstate_info { - char state[6]; + const char state[5]; const char *desc; }; static HashTable err_hash; -static struct pdo_sqlstate_info err_initializer[] = { +static const struct pdo_sqlstate_info err_initializer[] = { { 0, No error }, { 01000, Warning }, { 01001, Cursor operation conflict }, @@ -312,7 +312,7 @@ int pdo_sqlstate_init_error_table(void) { int i; - struct pdo_sqlstate_info *info; + const struct pdo_sqlstate_info *info; if (FAILURE == zend_hash_init(err_hash, sizeof(err_initializer)/sizeof(err_initializer[0]), NULL, NULL, 1)) { @@ -330,7 +330,7 @@ const char *pdo_sqlstate_state_to_description(char *state) { - struct pdo_sqlstate_info **info; + const struct pdo_sqlstate_info **info; if (SUCCESS == zend_hash_find(err_hash, state, sizeof(err_initializer[0].state), (void**)info)) { return (*info)-desc; -- 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/ereg/regex cclass.h regerror.c
nlopess Fri Jan 25 20:11:53 2008 UTC Modified files: (Branch: PHP_5_3) /php-src/ext/ereg/regex cclass.h regerror.c Log: const'ify more 372 bytes http://cvs.php.net/viewvc.cgi/php-src/ext/ereg/regex/cclass.h?r1=1.4.8.2r2=1.4.8.3diff_format=u Index: php-src/ext/ereg/regex/cclass.h diff -u php-src/ext/ereg/regex/cclass.h:1.4.8.2 php-src/ext/ereg/regex/cclass.h:1.4.8.3 --- php-src/ext/ereg/regex/cclass.h:1.4.8.2 Fri Oct 5 15:00:06 2007 +++ php-src/ext/ereg/regex/cclass.h Fri Jan 25 20:11:53 2008 @@ -1,8 +1,8 @@ /* character-class table */ -static struct cclass { - unsigned char *name; - unsigned char *chars; - unsigned char *multis; +static const struct cclass { + const unsigned char *name; + const unsigned char *chars; + const unsigned char *multis; } cclasses[] = { {alnum, ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789, }, {alpha, ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz, http://cvs.php.net/viewvc.cgi/php-src/ext/ereg/regex/regerror.c?r1=1.6.6.3r2=1.6.6.4diff_format=u Index: php-src/ext/ereg/regex/regerror.c diff -u php-src/ext/ereg/regex/regerror.c:1.6.6.3 php-src/ext/ereg/regex/regerror.c:1.6.6.4 --- php-src/ext/ereg/regex/regerror.c:1.6.6.3 Thu Jan 24 23:02:07 2008 +++ php-src/ext/ereg/regex/regerror.c Fri Jan 25 20:11:53 2008 @@ -30,10 +30,10 @@ = #define REG_ATOI255 // convert name to number (!) = #define REG_ITOA0400// convert number to name (!) */ -static struct rerr { +static const struct rerr { int code; - char *name; - char *explain; + const char *name; + const char *explain; } rerrs[] = { {REG_OKAY, REG_OKAY, no errors detected}, {REG_NOMATCH, REG_NOMATCH, regexec() failed to match}, @@ -67,10 +67,10 @@ char *errbuf, size_t errbuf_size) { - register struct rerr *r; + register const struct rerr *r; register size_t len; register int target = errcode ~ REG_ITOA; - register char *s; + register const char *s; char convbuf[50]; if (errcode == REG_ATOI) @@ -113,7 +113,7 @@ const regex_t *preg; char *localbuf; { - register struct rerr *r; + register const struct rerr *r; for (r = rerrs; r-code = 0; r++) if (strcmp(r-name, preg-re_endp) == 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_3) /ext/spl php_spl.c php_spl.h /ext/tidy php_tidy.h tidy.c
nlopess Fri Jan 25 20:29:48 2008 UTC Modified files: (Branch: PHP_5_3) /php-src/ext/splphp_spl.c php_spl.h /php-src/ext/tidy php_tidy.h tidy.c Log: more const kewywording remove spl_functions_none var (wast used anywhere http://cvs.php.net/viewvc.cgi/php-src/ext/spl/php_spl.c?r1=1.52.2.28.2.17.2.7r2=1.52.2.28.2.17.2.8diff_format=u Index: php-src/ext/spl/php_spl.c diff -u php-src/ext/spl/php_spl.c:1.52.2.28.2.17.2.7 php-src/ext/spl/php_spl.c:1.52.2.28.2.17.2.8 --- php-src/ext/spl/php_spl.c:1.52.2.28.2.17.2.7Tue Jan 15 09:38:15 2008 +++ php-src/ext/spl/php_spl.c Fri Jan 25 20:29:48 2008 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: php_spl.c,v 1.52.2.28.2.17.2.7 2008/01/15 09:38:15 colder Exp $ */ +/* $Id: php_spl.c,v 1.52.2.28.2.17.2.8 2008/01/25 20:29:48 nlopess Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -48,13 +48,6 @@ #define SPL_DEFAULT_FILE_EXTENSIONS .inc,.php -/* {{{ spl_functions_none - */ -const zend_function_entry spl_functions_none[] = { - {NULL, NULL, NULL} -}; -/* }}} */ - /* {{{ PHP_GINIT_FUNCTION */ static PHP_GINIT_FUNCTION(spl) @@ -771,7 +764,7 @@ /* {{{ spl_module_entry */ -zend_module_entry spl_module_entry = { +const zend_module_entry spl_module_entry = { #ifdef HAVE_SIMPLEXML STANDARD_MODULE_HEADER_EX, NULL, spl_deps, http://cvs.php.net/viewvc.cgi/php-src/ext/spl/php_spl.h?r1=1.17.2.1.2.3.2.2r2=1.17.2.1.2.3.2.3diff_format=u Index: php-src/ext/spl/php_spl.h diff -u php-src/ext/spl/php_spl.h:1.17.2.1.2.3.2.2 php-src/ext/spl/php_spl.h:1.17.2.1.2.3.2.3 --- php-src/ext/spl/php_spl.h:1.17.2.1.2.3.2.2 Mon Dec 31 07:17:14 2007 +++ php-src/ext/spl/php_spl.h Fri Jan 25 20:29:48 2008 @@ -28,7 +28,7 @@ #define SPL_DEBUG(x) #endif -extern zend_module_entry spl_module_entry; +extern const zend_module_entry spl_module_entry; #define phpext_spl_ptr spl_module_entry #ifdef PHP_WIN32 http://cvs.php.net/viewvc.cgi/php-src/ext/tidy/php_tidy.h?r1=1.26.2.1.2.5.2.1r2=1.26.2.1.2.5.2.2diff_format=u Index: php-src/ext/tidy/php_tidy.h diff -u php-src/ext/tidy/php_tidy.h:1.26.2.1.2.5.2.1 php-src/ext/tidy/php_tidy.h:1.26.2.1.2.5.2.2 --- php-src/ext/tidy/php_tidy.h:1.26.2.1.2.5.2.1Mon Dec 31 07:17:16 2007 +++ php-src/ext/tidy/php_tidy.h Fri Jan 25 20:29:48 2008 @@ -16,12 +16,12 @@ +--+ */ -/* $Id: php_tidy.h,v 1.26.2.1.2.5.2.1 2007/12/31 07:17:16 sebastian Exp $ */ +/* $Id: php_tidy.h,v 1.26.2.1.2.5.2.2 2008/01/25 20:29:48 nlopess Exp $ */ #ifndef PHP_TIDY_H #define PHP_TIDY_H -extern zend_module_entry tidy_module_entry; +extern const zend_module_entry tidy_module_entry; #define phpext_tidy_ptr tidy_module_entry #define TIDY_METHOD_MAP(name, func_name, arg_types) \ http://cvs.php.net/viewvc.cgi/php-src/ext/tidy/tidy.c?r1=1.66.2.8.2.24.2.3r2=1.66.2.8.2.24.2.4diff_format=u Index: php-src/ext/tidy/tidy.c diff -u php-src/ext/tidy/tidy.c:1.66.2.8.2.24.2.3 php-src/ext/tidy/tidy.c:1.66.2.8.2.24.2.4 --- php-src/ext/tidy/tidy.c:1.66.2.8.2.24.2.3 Mon Dec 31 07:17:16 2007 +++ php-src/ext/tidy/tidy.c Fri Jan 25 20:29:48 2008 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: tidy.c,v 1.66.2.8.2.24.2.3 2007/12/31 07:17:16 sebastian Exp $ */ +/* $Id: tidy.c,v 1.66.2.8.2.24.2.4 2008/01/25 20:29:48 nlopess Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -351,7 +351,7 @@ static zend_object_handlers tidy_object_handlers_doc; static zend_object_handlers tidy_object_handlers_node; -zend_module_entry tidy_module_entry = { +const zend_module_entry tidy_module_entry = { STANDARD_MODULE_HEADER, tidy, tidy_functions, @@ -998,7 +998,7 @@ php_info_print_table_start(); php_info_print_table_header(2, Tidy support, enabled); php_info_print_table_row(2, libTidy Release, (char *)tidyReleaseDate()); - php_info_print_table_row(2, Extension Version, PHP_TIDY_MODULE_VERSION ($Id: tidy.c,v 1.66.2.8.2.24.2.3 2007/12/31 07:17:16 sebastian Exp $)); + php_info_print_table_row(2, Extension Version, PHP_TIDY_MODULE_VERSION ($Id: tidy.c,v 1.66.2.8.2.24.2.4 2008/01/25 20:29:48 nlopess Exp $)); php_info_print_table_end(); DISPLAY_INI_ENTRIES(); -- 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/pdo pdo_sqlstate.c
nlopess Fri Jan 25 19:57:58 2008 UTC Modified files: (Branch: PHP_5_3) /php-src/ext/pdopdo_sqlstate.c Log: move about 3K of data to the const area. also reduce memory usage (~ -266 bytes :P) http://cvs.php.net/viewvc.cgi/php-src/ext/pdo/pdo_sqlstate.c?r1=1.7.2.1.2.1.2.1r2=1.7.2.1.2.1.2.2diff_format=u Index: php-src/ext/pdo/pdo_sqlstate.c diff -u php-src/ext/pdo/pdo_sqlstate.c:1.7.2.1.2.1.2.1 php-src/ext/pdo/pdo_sqlstate.c:1.7.2.1.2.1.2.2 --- php-src/ext/pdo/pdo_sqlstate.c:1.7.2.1.2.1.2.1 Mon Dec 31 07:17:11 2007 +++ php-src/ext/pdo/pdo_sqlstate.c Fri Jan 25 19:57:57 2008 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: pdo_sqlstate.c,v 1.7.2.1.2.1.2.1 2007/12/31 07:17:11 sebastian Exp $ */ +/* $Id: pdo_sqlstate.c,v 1.7.2.1.2.1.2.2 2008/01/25 19:57:57 nlopess Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -29,13 +29,13 @@ #include php_pdo_driver.h struct pdo_sqlstate_info { - char state[6]; + const char state[5]; const char *desc; }; static HashTable err_hash; -static struct pdo_sqlstate_info err_initializer[] = { +static const struct pdo_sqlstate_info err_initializer[] = { { 0, No error }, { 01000, Warning }, { 01001, Cursor operation conflict }, @@ -312,7 +312,7 @@ int pdo_sqlstate_init_error_table(void) { int i; - struct pdo_sqlstate_info *info; + const struct pdo_sqlstate_info *info; if (FAILURE == zend_hash_init(err_hash, sizeof(err_initializer)/sizeof(err_initializer[0]), NULL, NULL, 1)) { @@ -330,7 +330,7 @@ const char *pdo_sqlstate_state_to_description(char *state) { - struct pdo_sqlstate_info **info; + const struct pdo_sqlstate_info **info; if (SUCCESS == zend_hash_find(err_hash, state, sizeof(err_initializer[0].state), (void**)info)) { return (*info)-desc; -- 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/ereg/regex cname.h
nlopess Fri Jan 25 20:04:10 2008 UTC Modified files: (Branch: PHP_5_3) /php-src/ext/ereg/regex cname.h Log: const'ify more 768 bytes http://cvs.php.net/viewvc.cgi/php-src/ext/ereg/regex/cname.h?r1=1.3.36.2r2=1.3.36.3diff_format=u Index: php-src/ext/ereg/regex/cname.h diff -u php-src/ext/ereg/regex/cname.h:1.3.36.2 php-src/ext/ereg/regex/cname.h:1.3.36.3 --- php-src/ext/ereg/regex/cname.h:1.3.36.2 Fri Oct 5 15:00:06 2007 +++ php-src/ext/ereg/regex/cname.h Fri Jan 25 20:04:10 2008 @@ -1,6 +1,6 @@ /* character-name table */ -static struct cname { - char *name; +static const struct cname { + const char *name; char code; } cnames[] = { {NUL, '\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_3) /ext/pcre php_pcre.c php_pcre.h
nlopess Fri Jan 25 19:38:26 2008 UTC Modified files: (Branch: PHP_5_3) /php-src/ext/pcre php_pcre.c php_pcre.h Log: spread some static keywords http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/php_pcre.c?r1=1.168.2.9.2.21.2.9r2=1.168.2.9.2.21.2.10diff_format=u Index: php-src/ext/pcre/php_pcre.c diff -u php-src/ext/pcre/php_pcre.c:1.168.2.9.2.21.2.9 php-src/ext/pcre/php_pcre.c:1.168.2.9.2.21.2.10 --- php-src/ext/pcre/php_pcre.c:1.168.2.9.2.21.2.9 Sun Jan 13 14:44:29 2008 +++ php-src/ext/pcre/php_pcre.c Fri Jan 25 19:38:26 2008 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: php_pcre.c,v 1.168.2.9.2.21.2.9 2008/01/13 14:44:29 nlopess Exp $ */ +/* $Id: php_pcre.c,v 1.168.2.9.2.21.2.10 2008/01/25 19:38:26 nlopess Exp $ */ #include php.h #include php_ini.h @@ -748,7 +748,7 @@ /* {{{ proto int preg_match(string pattern, string subject [, array subpatterns [, int flags [, int offset]]]) Perform a Perl-style regular expression match */ -PHP_FUNCTION(preg_match) +static PHP_FUNCTION(preg_match) { php_do_pcre_match(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); } @@ -756,7 +756,7 @@ /* {{{ proto int preg_match_all(string pattern, string subject, array subpatterns [, int flags [, int offset]]) Perform a Perl-style global regular expression match */ -PHP_FUNCTION(preg_match_all) +static PHP_FUNCTION(preg_match_all) { php_do_pcre_match(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1); } @@ -1369,7 +1369,7 @@ /* {{{ proto string preg_replace(mixed regex, mixed replace, mixed subject [, int limit [, count]]) Perform Perl-style regular expression replacement. */ -PHP_FUNCTION(preg_replace) +static PHP_FUNCTION(preg_replace) { preg_replace_impl(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); } @@ -1377,7 +1377,7 @@ /* {{{ proto string preg_replace_callback(mixed regex, mixed callback, mixed subject [, int limit [, count]]) Perform Perl-style regular expression replacement using replacement callback. */ -PHP_FUNCTION(preg_replace_callback) +static PHP_FUNCTION(preg_replace_callback) { preg_replace_impl(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1); } @@ -1385,7 +1385,7 @@ /* {{{ proto array preg_split(string pattern, string subject [, int limit [, int flags]]) Split string into an array using a perl-style regular expression as a delimiter */ -PHP_FUNCTION(preg_split) +static PHP_FUNCTION(preg_split) { char*regex; /* Regular expression */ char*subject; /* String to match against */ @@ -1583,7 +1583,7 @@ /* {{{ proto string preg_quote(string str [, string delim_char]) Quote regular expression characters plus an optional character */ -PHP_FUNCTION(preg_quote) +static PHP_FUNCTION(preg_quote) { int in_str_len; char*in_str;/* Input string argument */ @@ -1669,7 +1669,7 @@ /* {{{ proto array preg_grep(string regex, array input [, int flags]) Searches array and returns entries which match regex */ -PHP_FUNCTION(preg_grep) +static PHP_FUNCTION(preg_grep) { char*regex; /* Regular expression */ int regex_len; @@ -1779,7 +1779,7 @@ /* {{{ proto int preg_last_error() Returns the error code of the last regexp execution. */ -PHP_FUNCTION(preg_last_error) +static PHP_FUNCTION(preg_last_error) { if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, ) == FAILURE) { return; @@ -1791,7 +1791,7 @@ /* {{{ module definition structures */ -const zend_function_entry pcre_functions[] = { +static const zend_function_entry pcre_functions[] = { PHP_FE(preg_match, third_arg_force_ref) PHP_FE(preg_match_all, third_arg_force_ref) PHP_FE(preg_replace,fifth_arg_force_ref) http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/php_pcre.h?r1=1.41.2.1.2.5.2.1r2=1.41.2.1.2.5.2.2diff_format=u Index: php-src/ext/pcre/php_pcre.h diff -u php-src/ext/pcre/php_pcre.h:1.41.2.1.2.5.2.1 php-src/ext/pcre/php_pcre.h:1.41.2.1.2.5.2.2 --- php-src/ext/pcre/php_pcre.h:1.41.2.1.2.5.2.1Mon Dec 31 07:17:11 2007 +++ php-src/ext/pcre/php_pcre.h Fri Jan 25 19:38:26 2008 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: php_pcre.h,v 1.41.2.1.2.5.2.1 2007/12/31 07:17:11 sebastian Exp $ */ +/* $Id: php_pcre.h,v 1.41.2.1.2.5.2.2 2008/01/25 19:38:26 nlopess Exp $ */ #ifndef PHP_PCRE_H #define PHP_PCRE_H @@ -33,14 +33,6 @@ #include locale.h #endif -PHP_FUNCTION(preg_match); -PHP_FUNCTION(preg_match_all); -PHP_FUNCTION(preg_replace); -PHP_FUNCTION(preg_replace_callback); -PHP_FUNCTION(preg_split); -PHP_FUNCTION(preg_quote); -PHP_FUNCTION(preg_grep); - PHPAPI char