Re: [PHP4BETA] cvs: /php4/ext/imap php_imap.c

From: Date: Sun, 23 Apr 2000 23:23:40 +0000
Subject: Re: [PHP4BETA] cvs: /php4/ext/imap php_imap.c
References: 1  Groups: php.version4 
Request: Send a blank email to php-version4+get-13955@lists.php.net to get a copy of this message
I've talked to the author of the IMAP module, and he said there should generally be no functions that modify their arguments (at least not without restoring them), except for a few functions which we don't use. However, the rfc822_* functions aren't a part of what's considered to be the IMAP API (they're 'internal' functions), so they may actually modify their arguments. Zeev At 22:54 22/04/2000 , Charles Hagenbuch wrote:
chagenbu                Sat Apr 22 13:54:38 2000 EDT
Modified files:
    /php4/ext/imap      php_imap.c
Log: back off from high-performance api in imap_rfc822_parse_adrlist. if you called it twice on the same string, there were _strange_ side effects. This may be slower, but it works. Index: php4/ext/imap/php_imap.c diff -u php4/ext/imap/php_imap.c:1.17 php4/ext/imap/php_imap.c:1.18
--- php4/ext/imap/php_imap.c:1.17       Thu Apr 20 16:35:28 2000
+++ php4/ext/imap/php_imap.c    Sat Apr 22 13:54:07 2000
@@ -23,7 +23,7 @@
    | PHP 4.0 updates:  Zeev Suraski <zeev@zend.com>                       |
    +----------------------------------------------------------------------+
*/ -/* $Id: php_imap.c,v 1.17 2000/04/20 23:35:28 zeev Exp $ */ +/* $Id: php_imap.c,v 1.18 2000/04/22 20:54:07 chagenbu Exp $ */ #define IMAP41 @@ -2134,19 +2134,19 @@
    Parses an address string */
PHP_FUNCTION(imap_rfc822_parse_adrlist) {
-       zval **str, **defaulthost, *tovals;
+       zval *str, *defaulthost, *tovals;
        ADDRESS *addresstmp;
        ENVELOPE *env;
        int argc;
- +
        env=mail_newenvelope();
        argc=ZEND_NUM_ARGS();
-       if (argc != 2 || zend_get_parameters_ex(argc, &str, &defaulthost) == FAILURE) {
+       if (argc != 2 || zend_get_parameters(ht, argc, &str, &defaulthost) == FAILURE) {
                ZEND_WRONG_PARAM_COUNT();
        }
-       convert_to_string_ex(str);
-       convert_to_string_ex(defaulthost);
-       rfc822_parse_adrlist(&env->to, Z_STRVAL_PP(str), Z_STRVAL_PP(defaulthost));
+       convert_to_string(str);
+       convert_to_string(defaulthost);
+       rfc822_parse_adrlist(&env->to, str->value.str.val, defaulthost->value.str.val);
        if (array_init(return_value) == FAILURE) {
                RETURN_FALSE;
        }
-- PHP 4.0 Beta Mailing List <http://www.php.net/version4/> To unsubscribe, e-mail: php4beta-unsubscribe@lists.php.net For additional commands, e-mail: php4beta-help@lists.php.net To contact the list administrators, e-mail: php4beta-admin@lists.php.net
-- Zeev Suraski <zeev@zend.com> http://www.zend.com/

« previous php.version4 (#13955) next »