[PHP-CVS] cvs: php4(PHP_4_3) /sapi/apache2handler sapi_apache2.c

2003-03-27 Thread Jani Taskinen
sniper  Thu Mar 27 08:16:34 2003 EDT

  Modified files:  (Branch: PHP_4_3)
/php4/sapi/apache2handler   sapi_apache2.c 
  Log:
  MFH
  
Index: php4/sapi/apache2handler/sapi_apache2.c
diff -u php4/sapi/apache2handler/sapi_apache2.c:1.1.2.5 
php4/sapi/apache2handler/sapi_apache2.c:1.1.2.6
--- php4/sapi/apache2handler/sapi_apache2.c:1.1.2.5 Mon Mar 24 20:34:39 2003
+++ php4/sapi/apache2handler/sapi_apache2.c Thu Mar 27 08:16:34 2003
@@ -18,7 +18,7 @@
+--+
  */
 
-/* $Id: sapi_apache2.c,v 1.1.2.5 2003/03/25 01:34:39 iliaa Exp $ */
+/* $Id: sapi_apache2.c,v 1.1.2.6 2003/03/27 13:16:34 sniper Exp $ */
 
 #include fcntl.h
 
@@ -71,6 +71,7 @@
apr_bucket_brigade *brigade;
request_rec *r;
php_struct *ctx;
+   char *copy_str;
 
if (str_length == 0) {
return 0;
@@ -80,18 +81,11 @@
r = ctx-r;
brigade = ctx-brigade;

-   bucket = apr_bucket_transient_create(str, str_length,
-r-connection-bucket_alloc);
+   copy_str = apr_pmemdup( r-pool, str, str_length+1);
+   bucket = apr_bucket_pool_create(copy_str, str_length, r-pool, 
r-connection-bucket_alloc);
+
APR_BRIGADE_INSERT_TAIL(brigade, bucket);
 
-   /* Add a Flush bucket to the end of this brigade, so that
-* the transient buckets above are more likely to make it out
-* the end of the filter instead of having to be copied into
-* someone's setaside.
-*/
-   bucket = apr_bucket_flush_create(r-connection-bucket_alloc);
-   APR_BRIGADE_INSERT_TAIL(brigade, bucket);
-   
if (ap_pass_brigade(r-output_filters, brigade) != APR_SUCCESS) {
php_handle_aborted_connection();
}



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



[PHP-CVS] cvs: php4(PHP_4_3) /ext/mysql/libmysql config-win.h

2003-03-27 Thread Edin Kadribasic
edink   Thu Mar 27 08:29:59 2003 EDT

  Modified files:  (Branch: PHP_4_3)
/php4/ext/mysql/libmysqlconfig-win.h 
  Log:
  Fixed bug #22083.
  
  
Index: php4/ext/mysql/libmysql/config-win.h
diff -u php4/ext/mysql/libmysql/config-win.h:1.8 
php4/ext/mysql/libmysql/config-win.h:1.8.4.1
--- php4/ext/mysql/libmysql/config-win.h:1.8Mon Jun 10 11:53:26 2002
+++ php4/ext/mysql/libmysql/config-win.hThu Mar 27 08:29:59 2003
@@ -264,7 +264,7 @@
 #define PACKAGEmysql
 #define DEFAULT_BASEDIRC:\\
 #define SHAREDIR   share
-#define DEFAULT_CHARSET_HOME   C:/mysql/
+#define DEFAULT_CHARSET_HOME   C:/mysql
 #endif
 
 /* File name handling */



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



[PHP-CVS] cvs: php4 /ext/mysql/libmysql config-win.h

2003-03-27 Thread Edin Kadribasic
edink   Thu Mar 27 08:30:40 2003 EDT

  Modified files:  
/php4/ext/mysql/libmysqlconfig-win.h 
  Log:
  MFB
  
Index: php4/ext/mysql/libmysql/config-win.h
diff -u php4/ext/mysql/libmysql/config-win.h:1.8 
php4/ext/mysql/libmysql/config-win.h:1.9
--- php4/ext/mysql/libmysql/config-win.h:1.8Mon Jun 10 11:53:26 2002
+++ php4/ext/mysql/libmysql/config-win.hThu Mar 27 08:30:40 2003
@@ -264,7 +264,7 @@
 #define PACKAGEmysql
 #define DEFAULT_BASEDIRC:\\
 #define SHAREDIR   share
-#define DEFAULT_CHARSET_HOME   C:/mysql/
+#define DEFAULT_CHARSET_HOME   C:/mysql
 #endif
 
 /* File name handling */



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



[PHP-CVS] cvs: php4(PHP_4_3) / NEWS

2003-03-27 Thread Edin Kadribasic
edink   Thu Mar 27 08:32:45 2003 EDT

  Modified files:  (Branch: PHP_4_3)
/php4   NEWS 
  Log:
  BFN
  
Index: php4/NEWS
diff -u php4/NEWS:1.1247.2.153 php4/NEWS:1.1247.2.154
--- php4/NEWS:1.1247.2.153  Mon Mar 24 14:42:20 2003
+++ php4/NEWS   Thu Mar 27 08:32:45 2003
@@ -86,6 +86,7 @@
 - Fixed bug #22103 (Added gdImageEllipse and replaced old gdImageFilledEllipse
   with a better implementation). (Pierre)
 - Fixed bug #22088 (array_shift() left next index to be +1 too much). (Jani)
+- Fixed bug #22083 (MySQL charset directory problem on Windows). (Edin)
 - Fixed bug #22059 (ftp_chdir() causes segfault). (Sara)
 - Fixed bug #22048 (crash in imap_header() when the e-mail contains an 
   abnormally large number of special characters). (Ilia)



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



Re: [PHP-CVS] cvs: php4 /main fopen_wrappers.c

2003-03-27 Thread Sterling Hughes
On Thu, 2003-03-27 at 01:15, Andi Gutmans wrote:
 OK... :) I hope no one tries to efree() this though.
 

I hope so too.  I'm not sure, between this and return NULL, and then
having callers check for it.

-Sterling

 
 At 11:03 PM 3/26/2003 +, Sterling Hughes wrote:
 sterlingWed Mar 26 18:03:48 2003 EDT
 
Modified files:
  /php4/main  fopen_wrappers.c
Log:
really fix
 
 
 Index: php4/main/fopen_wrappers.c
 diff -u php4/main/fopen_wrappers.c:1.160 php4/main/fopen_wrappers.c:1.161
 --- php4/main/fopen_wrappers.c:1.160Wed Mar 26 18:01:39 2003
 +++ php4/main/fopen_wrappers.c  Wed Mar 26 18:03:48 2003
 @@ -17,7 +17,7 @@
  +--+
*/
 
 -/* $Id: fopen_wrappers.c,v 1.160 2003/03/26 23:01:39 sterling Exp $ */
 +/* $Id: fopen_wrappers.c,v 1.161 2003/03/26 23:03:48 sterling Exp $ */
 
   /* {{{ includes
*/
 @@ -493,7 +493,7 @@
  register char *p, *url_start;
 
  if (url == NULL) {
 -   return NULL;
 +   return ;
  }
 
  p = url;
 
 
 
 --
 PHP CVS Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
-- 
Reductionists like to take things apart.  The rest of us are 
 just trying to get it together. 
- Larry Wall, Programming Perl, 3rd Edition


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



Re: [PHP-CVS] cvs: php4 /main fopen_wrappers.c

2003-03-27 Thread Moriyoshi Koizumi
How about using empty_string? As it can't be freed by STR_FREE(), we can 
reduce certain risks.

Moriyoshit

Sterling Hughes [EMAIL PROTECTED] wrote:

 On Thu, 2003-03-27 at 01:15, Andi Gutmans wrote:
  OK... :) I hope no one tries to efree() this though.
  
 
 I hope so too.  I'm not sure, between this and return NULL, and then
 having callers check for it.
 
 -Sterling
 
  
  At 11:03 PM 3/26/2003 +, Sterling Hughes wrote:
  sterlingWed Mar 26 18:03:48 2003 EDT
  
 Modified files:
   /php4/main  fopen_wrappers.c
 Log:
 really fix
  
  
  Index: php4/main/fopen_wrappers.c
  diff -u php4/main/fopen_wrappers.c:1.160 php4/main/fopen_wrappers.c:1.161
  --- php4/main/fopen_wrappers.c:1.160Wed Mar 26 18:01:39 2003
  +++ php4/main/fopen_wrappers.c  Wed Mar 26 18:03:48 2003
  @@ -17,7 +17,7 @@
   +--+
 */
  
  -/* $Id: fopen_wrappers.c,v 1.160 2003/03/26 23:01:39 sterling Exp $ */
  +/* $Id: fopen_wrappers.c,v 1.161 2003/03/26 23:03:48 sterling Exp $ */
  
/* {{{ includes
 */
  @@ -493,7 +493,7 @@
   register char *p, *url_start;
  
   if (url == NULL) {
  -   return NULL;
  +   return ;
   }
  
   p = url;
  
  
  
  --
  PHP CVS Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 -- 
 Reductionists like to take things apart.  The rest of us are 
  just trying to get it together. 
 - Larry Wall, Programming Perl, 3rd Edition
 
 
 -- 
 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: php4 /main fopen_wrappers.c

2003-03-27 Thread Sterling Hughes
On Thu, 2003-03-27 at 11:23, Moriyoshi Koizumi wrote:
 Moriyoshi Koizumi [EMAIL PROTECTED] wrote:
  Moriyoshit
 
 Oh, I'm no shit...
 

Uh-oh, I think you just got a new nickname.

empty_string can be free'd by efree() which is what we're worrying about
more anyway.

-Sterling

 Moriyoshi
-- 
Good judgement comes from experience, and experience comes from 
bad judgement. 
- Fred Brooks


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



[PHP-CVS] cvs: php4 /sapi/cgi cgi_main.c /sapi/isapi php4isapi.c

2003-03-27 Thread Shane Caraveo
shane   Thu Mar 27 12:52:33 2003 EDT

  Modified files:  
/php4/sapi/cgi  cgi_main.c 
/php4/sapi/isapiphp4isapi.c 
  Log:
  handle invalid paths passed to us from iis
  
  
Index: php4/sapi/cgi/cgi_main.c
diff -u php4/sapi/cgi/cgi_main.c:1.219 php4/sapi/cgi/cgi_main.c:1.220
--- php4/sapi/cgi/cgi_main.c:1.219  Tue Mar 25 03:07:13 2003
+++ php4/sapi/cgi/cgi_main.cThu Mar 27 12:52:33 2003
@@ -20,7 +20,7 @@
+--+
 */
 
-/* $Id: cgi_main.c,v 1.219 2003/03/25 08:07:13 sebastian Exp $ */
+/* $Id: cgi_main.c,v 1.220 2003/03/27 17:52:33 shane Exp $ */
 
 #include php.h
 #include php_globals.h
@@ -827,7 +827,9 @@
 #endif
SG(request_info).request_method = 
sapi_cgibin_getenv(REQUEST_METHOD,0 TSRMLS_CC);
SG(request_info).query_string = sapi_cgibin_getenv(QUERY_STRING,0 
TSRMLS_CC);
-   if (script_path_translated)
+   /* some server configurations allow '..' to slip through in the
+  translated path.   We'll just refuse to handle such a path. */
+   if (script_path_translated  !strstr(script_path_translated,..))
SG(request_info).path_translated = 
estrdup(script_path_translated);
SG(request_info).content_type = (content_type ? content_type :  );
SG(request_info).content_length = 
(content_length?atoi(content_length):0);
Index: php4/sapi/isapi/php4isapi.c
diff -u php4/sapi/isapi/php4isapi.c:1.100 php4/sapi/isapi/php4isapi.c:1.101
--- php4/sapi/isapi/php4isapi.c:1.100   Mon Mar 24 06:21:15 2003
+++ php4/sapi/isapi/php4isapi.c Thu Mar 27 12:52:33 2003
@@ -818,13 +818,21 @@
 #endif
file_handle.type = ZEND_HANDLE_FILENAME;
file_handle.opened_path = NULL;
+   /* some server configurations allow '..' to slip through in the
+  translated path.   We'll just refuse to handle such a path. 
*/
+   if (strstr(SG(request_info).path_translated,..)) {
+   SG(sapi_headers).http_response_code = 404;
+   efree(SG(request_info).path_translated);
+   SG(request_info).path_translated = NULL;
+   }
 
 
php_execute_script(file_handle TSRMLS_CC);
if (SG(request_info).cookie_data) {
efree(SG(request_info).cookie_data);
}
-   efree(SG(request_info).path_translated);
+   if (SG(request_info).path_translated)
+   efree(SG(request_info).path_translated);
 #ifdef PHP_ENABLE_SEH
} __except(exceptionhandler(e, GetExceptionInformation())) {
char buf[1024];



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



[PHP-CVS] cvs: php4(PHP_4_3) /sapi/cgi cgi_main.c /sapi/isapi php4isapi.c

2003-03-27 Thread Shane Caraveo
shane   Thu Mar 27 12:57:58 2003 EDT

  Modified files:  (Branch: PHP_4_3)
/php4/sapi/cgi  cgi_main.c 
/php4/sapi/isapiphp4isapi.c 
  Log:
  MFH
  
  
Index: php4/sapi/cgi/cgi_main.c
diff -u php4/sapi/cgi/cgi_main.c:1.190.2.18 php4/sapi/cgi/cgi_main.c:1.190.2.19
--- php4/sapi/cgi/cgi_main.c:1.190.2.18 Sun Mar  9 21:35:59 2003
+++ php4/sapi/cgi/cgi_main.cThu Mar 27 12:57:58 2003
@@ -20,7 +20,7 @@
+--+
 */
 
-/* $Id: cgi_main.c,v 1.190.2.18 2003/03/10 02:35:59 shane Exp $ */
+/* $Id: cgi_main.c,v 1.190.2.19 2003/03/27 17:57:58 shane Exp $ */
 
 #include php.h
 #include php_globals.h
@@ -806,7 +806,9 @@
 #endif
SG(request_info).request_method = 
sapi_cgibin_getenv(REQUEST_METHOD,0 TSRMLS_CC);
SG(request_info).query_string = sapi_cgibin_getenv(QUERY_STRING,0 
TSRMLS_CC);
-   if (script_path_translated)
+   /* some server configurations allow '..' to slip through in the
+  translated path.   We'll just refuse to handle such a path. */
+   if (script_path_translated  !strstr(script_path_translated,..))
SG(request_info).path_translated = 
estrdup(script_path_translated);
SG(request_info).content_type = (content_type ? content_type :  );
SG(request_info).content_length = 
(content_length?atoi(content_length):0);
Index: php4/sapi/isapi/php4isapi.c
diff -u php4/sapi/isapi/php4isapi.c:1.92.2.3 php4/sapi/isapi/php4isapi.c:1.92.2.4
--- php4/sapi/isapi/php4isapi.c:1.92.2.3Mon Mar 24 06:21:26 2003
+++ php4/sapi/isapi/php4isapi.c Thu Mar 27 12:57:58 2003
@@ -744,16 +744,22 @@
 * variable won't be present, so fall back to 
old behaviour.
 */
efree( file_handle.filename );
-   file_handle.filename = 
SG(request_info.path_translated);
+   file_handle.filename = 
SG(request_info).path_translated;
file_handle.free_filename = 0;
}
}
 #else
-   file_handle.filename = SG(request_info.path_translated);
+   file_handle.filename = SG(request_info).path_translated;
file_handle.free_filename = 0;
 #endif
file_handle.type = ZEND_HANDLE_FILENAME;
file_handle.opened_path = NULL;
+   /* some server configurations allow '..' to slip through in the
+  translated path.   We'll just refuse to handle such a path. 
*/
+   if (strstr(SG(request_info).path_translated,..)) {
+   SG(sapi_headers).http_response_code = 404;
+   SG(request_info).path_translated = NULL;
+   }
 
php_request_startup(TSRMLS_C);
php_execute_script(file_handle TSRMLS_CC);



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



[PHP-CVS] cvs: php4 / configure.in

2003-03-27 Thread David Hill
ddhill  Thu Mar 27 13:02:00 2003 EDT

  Modified files:  
/php4   configure.in 
  Log:
  Correcting checking of flex version (dave)
  
  
Index: php4/configure.in
diff -u php4/configure.in:1.433 php4/configure.in:1.434
--- php4/configure.in:1.433 Tue Mar 25 08:43:13 2003
+++ php4/configure.in   Thu Mar 27 13:02:00 2003
@@ -1,4 +1,4 @@
-dnl ## $Id: configure.in,v 1.433 2003/03/25 13:43:13 sniper Exp $ -*- sh -*-
+dnl ## $Id: configure.in,v 1.434 2003/03/27 18:02:00 ddhill Exp $ -*- sh -*-
 dnl ## Process this file with autoconf to produce a configure script.
 
 divert(1)
@@ -155,11 +155,19 @@
 fi
 
 AC_MSG_CHECKING([flex version])
-set `echo  | $LEX -V -v --version 2/dev/null | grep 'version' | cut -d ' ' -f 3 | 
sed -e 's/\./ /g' | sed -e 's/[^0-9 ]//g'`
-if test ${1} != 2 -o ${2} != 5 -o ${3} -lt 4; then
-AC_MSG_WARN(You will need flex 2.5.4 or later if you want to regenerate 
Zend/PHP lexical parsers.)
-fi
+if test $LEX ;then
+   flexvers=`echo  | $LEX -V -v --version 2/dev/null | 
+   sed -e 's/^.* //' -e 's/\./ /g'`
+   if test ! -z $flexvers; then
+   set $flexvers
+   if test ${1} != 2 -o ${2} != 5 -o ${3} -lt 4; then
+   AC_MSG_WARN(You will need flex 2.5.4 or later if you want to 
regenerate Zend/PHP lexical parsers.)
+   fi
+   fi
 AC_MSG_RESULT(${1}.${2}.${3} (ok))
+else
+   AC_MSG_WARN(You will need flex 2.5.4 or later if you want to regenerate 
Zend/PHP lexical parsers.)
+fi
 
 dnl Platform-specific compile settings.
 dnl -



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



[PHP-CVS] cvs: php4 /ext/standard array.c

2003-03-27 Thread Ilia Alshanetsky
iliaa   Thu Mar 27 13:57:53 2003 EDT

  Modified files:  
/php4/ext/standard  array.c 
  Log:
  CS
  
  Index: php4/ext/standard/array.c
diff -u php4/ext/standard/array.c:1.222 php4/ext/standard/array.c:1.223
--- php4/ext/standard/array.c:1.222 Sat Feb 22 08:55:11 2003
+++ php4/ext/standard/array.c   Thu Mar 27 13:57:53 2003
@@ -21,7 +21,7 @@
+--+
 */
 
-/* $Id: array.c,v 1.222 2003/02/22 13:55:11 andrey Exp $ */
+/* $Id: array.c,v 1.223 2003/03/27 18:57:53 iliaa Exp $ */
 
 #include php.h
 #include php_ini.h
@@ -360,8 +360,7 @@
convert_to_string(second);
}
 
-   result = strnatcmp_ex(Z_STRVAL(first), Z_STRLEN(first),
- Z_STRVAL(second), Z_STRLEN(second), 
fold_case);
+   result = strnatcmp_ex(Z_STRVAL(first), Z_STRLEN(first), Z_STRVAL(second), 
Z_STRLEN(second), fold_case);
 
if (Z_TYPE_P(fval) != IS_STRING)
zval_dtor(first);
@@ -750,7 +749,7 @@
if (zend_hash_get_current_data(target_hash, (void **) entry) == 
FAILURE) {
RETURN_FALSE;
}
- 
+
*return_value = **entry;
zval_copy_ctor(return_value);
}
@@ -949,7 +948,7 @@
  *retval_ptr,  /* Return value - unused */
  *key; /* Entry key */
char  *string_key;
-   uint  string_key_len;
+   uint   string_key_len;
ulong  num_key;
HashPosition pos;
 
@@ -1095,7 +1094,7 @@
uint str_key_len;
char *string_key;
int (*is_equal_func)(zval *, zval *, zval * TSRMLS_DC) = is_equal_function;
-   
+
if (ZEND_NUM_ARGS()  2 || ZEND_NUM_ARGS()  3 ||
zend_get_parameters_ex(ZEND_NUM_ARGS(), value, array, strict) == 
FAILURE) {
WRONG_PARAM_COUNT;
@@ -1129,7 +1128,7 @@
RETURN_TRUE;
} else {
/* Return current key */
-   switch (zend_hash_get_current_key_ex(target_hash, 
string_key, str_key_len, num_key, 0,  pos)) {
+   switch (zend_hash_get_current_key_ex(target_hash, 
string_key, str_key_len, num_key, 0, pos)) {
case HASH_KEY_IS_STRING:
RETURN_STRINGL(string_key, 
str_key_len-1, 1);
break;
@@ -1142,7 +1141,7 @@

zend_hash_move_forward_ex(target_hash, pos);
}
-   
+
RETURN_FALSE;
 }
 
@@ -1706,8 +1705,7 @@
ALLOC_HASHTABLE(out_hash);
zend_hash_init(out_hash, 0, NULL, ZVAL_PTR_DTOR, 0);

-   /* Start at the beginning of the input hash and copy
-  entries to output hash until offset is reached */
+   /* Start at the beginning of the input hash and copy entries to output hash 
until offset is reached */
for (pos=0, p=in_hash-pListHead; posoffset  p ; pos++, p=p-pListNext) {
/* Get entry and increase reference count */
entry = *((zval **)p-pData);
@@ -1720,8 +1718,7 @@
zend_hash_next_index_insert(out_hash, entry, sizeof(zval *), 
NULL);
}

-   /* If hash for removed entries exists, go until offset+length
-  and copy the entries to it */
+   /* If hash for removed entries exists, go until offset+length and copy the 
entries to it */
if (removed != NULL) {
for ( ; posoffset+length  p; pos++, p=p-pListNext) {
entry = *((zval **)p-pData);
@@ -1736,8 +1733,7 @@

/* If there are entries to insert.. */
if (list != NULL) {
-   /* ..for each one, create a new zval, copy entry into it
-  and copy it into the output hash */
+   /* ..for each one, create a new zval, copy entry into it and copy it 
into the output hash */
for (i=0; ilist_count; i++) {
entry = *list[i];
if (entry-refcount=1000) {
@@ -1776,10 +1772,10 @@
 PHP_FUNCTION(array_push)
 {
zval  ***args,  /* Function arguments array */
-   *stack, /* Input array */
-   *new_var;   /* Variable to be pushed */
-   int  i, /* Loop counter */
-argc;  /* Number of function arguments */
+   *stack, /* Input array */
+   *new_var;   /* Variable to be pushed */
+   int  i, /* Loop counter */
+argc;  /* Number of function arguments */
 
/* Get the argument 

[PHP-CVS] cvs: php4(PHP_4_3) /ext/com COM.c

2003-03-27 Thread Harald Radi
phanto  Thu Mar 27 14:56:09 2003 EDT

  Modified files:  (Branch: PHP_4_3)
/php4/ext/com   COM.c 
  Log:
  fix #22899
  invoke is called twice
  
Index: php4/ext/com/COM.c
diff -u php4/ext/com/COM.c:1.90.2.5 php4/ext/com/COM.c:1.90.2.6
--- php4/ext/com/COM.c:1.90.2.5 Mon Feb 24 13:30:19 2003
+++ php4/ext/com/COM.c  Thu Mar 27 14:56:09 2003
@@ -18,7 +18,7 @@
| Wez Furlong  [EMAIL PROTECTED]  |
+--+
  */
-/* $Id: COM.c,v 1.90.2.5 2003/02/24 18:30:19 phanto Exp $ */
+/* $Id: COM.c,v 1.90.2.6 2003/03/27 19:56:09 phanto Exp $ */
 /*
  * This module implements support for COM components that support the IDispatch
  * interface.  Both local (COM) and remote (DCOM) components can be accessed.
@@ -124,7 +124,7 @@
if (C_ISREFD(obj)) {
if (C_HASTLIB(obj)) {
hr = C_TYPEINFO_VT(obj)-Invoke(C_TYPEINFO(obj), 
C_DISPATCH(obj), dispIdMember, wFlags, pDispParams, pVarResult, ExceptInfo, ArgErr);
-   if (FAILED(hr)) {
+   if (FAILED(hr)  (hr != DISP_E_EXCEPTION)) {
hr = C_DISPATCH_VT(obj)-Invoke(C_DISPATCH(obj), 
dispIdMember, IID_NULL, LOCALE_SYSTEM_DEFAULT, wFlags, pDispParams, pVarResult, 
ExceptInfo, ArgErr);
if (SUCCEEDED(hr)) {
/*



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



[PHP-CVS] cvs: php4 /ext/rpc/com com_wrapper.c

2003-03-27 Thread Harald Radi
phanto  Thu Mar 27 14:56:58 2003 EDT

  Modified files:  
/php4/ext/rpc/com   com_wrapper.c 
  Log:
  MFB ext/com
  fix #22899
  invoke is called twice
  
Index: php4/ext/rpc/com/com_wrapper.c
diff -u php4/ext/rpc/com/com_wrapper.c:1.91 php4/ext/rpc/com/com_wrapper.c:1.92
--- php4/ext/rpc/com/com_wrapper.c:1.91 Sat Feb 15 22:48:46 2003
+++ php4/ext/rpc/com/com_wrapper.c  Thu Mar 27 14:56:58 2003
@@ -18,7 +18,7 @@
| Wez Furlong [EMAIL PROTECTED]   |
+--+
  */
-/* $Id: com_wrapper.c,v 1.91 2003/02/16 03:48:46 wez Exp $ */
+/* $Id: com_wrapper.c,v 1.92 2003/03/27 19:56:58 phanto Exp $ */
 /*
  * This module implements support for COM components that support the IDispatch
  * interface.  Both local (COM) and remote (DCOM) components can be accessed.
@@ -89,7 +89,7 @@
if (C_HASTLIB(obj)) {
hr = C_TYPEINFO_VT(obj)-Invoke(C_TYPEINFO(obj), C_DISPATCH(obj),
dispIdMember, wFlags, pDispParams, pVarResult, ExceptInfo, 
ArgErr);
-   if (FAILED(hr)) {
+   if (FAILED(hr)  (hr != DISP_E_EXCEPTION)) {
hr = C_DISPATCH_VT(obj)-Invoke(C_DISPATCH(obj), dispIdMember, 
IID_NULL,
LOCALE_SYSTEM_DEFAULT, wFlags, pDispParams, 
pVarResult, ExceptInfo, ArgErr);
if (SUCCEEDED(hr)) {



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



[PHP-CVS] cvs: php4 /main php_variables.c

2003-03-27 Thread Moriyoshi Koizumi
moriyoshi   Thu Mar 27 16:13:47 2003 EDT

  Modified files:  
/php4/main  php_variables.c 
  Log:
  Improved php_import_environment_variables: avoid emalloc()ing in most cases
  
  
Index: php4/main/php_variables.c
diff -u php4/main/php_variables.c:1.57 php4/main/php_variables.c:1.58
--- php4/main/php_variables.c:1.57  Tue Mar 25 03:07:12 2003
+++ php4/main/php_variables.c   Thu Mar 27 16:13:47 2003
@@ -17,7 +17,7 @@
+--+
  */
 
-/* $Id: php_variables.c,v 1.57 2003/03/25 08:07:12 sebastian Exp $ */
+/* $Id: php_variables.c,v 1.58 2003/03/27 21:13:47 moriyoshi Exp $ */
 
 #include stdio.h
 #include php.h
@@ -344,7 +344,11 @@
 
 void _php_import_environment_variables(zval *array_ptr TSRMLS_DC)
 {
-   char **env, *p, *t;
+   char buf[128];
+   char **env, *p, *t = buf;
+   size_t alloc_size = sizeof(buf);
+   unsigned int nlen; /* ptrdiff_t is not portable */
+
/* turn off magic_quotes while importing environment variables */
int magic_quotes_gpc = PG(magic_quotes_gpc);
PG(magic_quotes_gpc) = 0;
@@ -354,8 +358,16 @@
if (!p) {   /* malformed entry? */
continue;
}
-   t = estrndup(*env, p - *env);
+   nlen = p - *env;
+   if (nlen = alloc_size) {
+   alloc_size = nlen + 64;
+   t = (t == buf ? emalloc(alloc_size): erealloc(t, alloc_size));
+   }
+   memcpy(t, *env, nlen);
+   t[nlen] = '\0';
php_register_variable(t, p+1, array_ptr TSRMLS_CC);
+   }
+   if (t != buf  t != NULL) {
efree(t);
}
PG(magic_quotes_gpc) = magic_quotes_gpc;



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



[PHP-CVS] cvs: php4 /ext/mbstring mbstring.c

2003-03-27 Thread Moriyoshi Koizumi
moriyoshi   Thu Mar 27 22:38:13 2003 EDT

  Modified files:  
/php4/ext/mbstring  mbstring.c 
  Log:
  Removed redundant aliases  CS fix.
  
  
Index: php4/ext/mbstring/mbstring.c
diff -u php4/ext/mbstring/mbstring.c:1.168 php4/ext/mbstring/mbstring.c:1.169
--- php4/ext/mbstring/mbstring.c:1.168  Fri Mar  7 00:15:16 2003
+++ php4/ext/mbstring/mbstring.cThu Mar 27 22:38:13 2003
@@ -17,7 +17,7 @@
+--+
  */
 
-/* $Id: mbstring.c,v 1.168 2003/03/07 05:15:16 sniper Exp $ */
+/* $Id: mbstring.c,v 1.169 2003/03/28 03:38:13 moriyoshi Exp $ */
 
 /*
  * PHP4 Multibyte String module mbstring
@@ -188,49 +188,36 @@
 
 /* {{{ function_entry mbstring_functions[] */
 function_entry mbstring_functions[] = {
-   PHP_FE(mb_convert_case, NULL)
-   PHP_FE(mb_strtoupper,   NULL)
-   PHP_FE(mb_strtolower,   NULL)
-   PHP_FE(mb_language, NULL)
-   PHP_FE(mb_internal_encoding,NULL)
-   PHP_FE(mb_http_input,   NULL)
+   PHP_FE(mb_convert_case, NULL)
+   PHP_FE(mb_strtoupper,   NULL)
+   PHP_FE(mb_strtolower,   NULL)
+   PHP_FE(mb_language, NULL)
+   PHP_FE(mb_internal_encoding,NULL)
+   PHP_FE(mb_http_input,   NULL)
PHP_FE(mb_http_output,  NULL)
PHP_FE(mb_detect_order, NULL)
PHP_FE(mb_substitute_character, NULL)
PHP_FE(mb_parse_str,(unsigned char *)second_args_force_ref)
-   PHP_FE(mb_output_handler,   NULL)
+   PHP_FE(mb_output_handler,   NULL)
PHP_FE(mb_preferred_mime_name,  NULL)
-   PHP_FE(mb_strlen,   NULL)
-   PHP_FE(mb_strpos,   NULL)
+   PHP_FE(mb_strlen,   NULL)
+   PHP_FE(mb_strpos,   NULL)
PHP_FE(mb_strrpos,  NULL)
PHP_FE(mb_substr_count, NULL)
-   PHP_FE(mb_substr,   NULL)
-   PHP_FE(mb_strcut,   NULL)
+   PHP_FE(mb_substr,   NULL)
+   PHP_FE(mb_strcut,   NULL)
PHP_FE(mb_strwidth, NULL)
-   PHP_FE(mb_strimwidth,   NULL)
+   PHP_FE(mb_strimwidth,   NULL)
PHP_FE(mb_convert_encoding, NULL)
PHP_FE(mb_detect_encoding,  NULL)
PHP_FE(mb_convert_kana, NULL)
-   PHP_FE(mb_encode_mimeheader,NULL)
-   PHP_FE(mb_decode_mimeheader,NULL)
-   PHP_FE(mb_convert_variables,(unsigned char 
*)third_and_rest_force_ref)
-   PHP_FE(mb_encode_numericentity, NULL)
-   PHP_FE(mb_decode_numericentity, NULL)
-   PHP_FE(mb_send_mail,NULL)
-   PHP_FE(mb_get_info, NULL)
-   PHP_FALIAS(mbstrlen,mb_strlen,  NULL)
-   PHP_FALIAS(mbstrpos,mb_strpos,  NULL)
-   PHP_FALIAS(mbstrrpos,   mb_strrpos, NULL)
-   PHP_FALIAS(mbsubstr,mb_substr,  NULL)
-   PHP_FALIAS(mbstrcut,mb_strcut,  NULL)
-   PHP_FALIAS(i18n_internal_encoding,  mb_internal_encoding,   NULL)
-   PHP_FALIAS(i18n_http_input, mb_http_input,  NULL)
-   PHP_FALIAS(i18n_http_output,mb_http_output, NULL)
-   PHP_FALIAS(i18n_convert,mb_convert_encoding,NULL)
-   PHP_FALIAS(i18n_discover_encoding,  mb_detect_encoding, NULL)
-   PHP_FALIAS(i18n_mime_header_encode, mb_encode_mimeheader,   NULL)
-   PHP_FALIAS(i18n_mime_header_decode, mb_decode_mimeheader,   NULL)
-   PHP_FALIAS(i18n_ja_jp_hantozen, mb_convert_kana,NULL)
+   PHP_FE(mb_encode_mimeheader,NULL)
+   PHP_FE(mb_decode_mimeheader,NULL)
+   PHP_FE(mb_convert_variables,(unsigned char *)third_and_rest_force_ref)
+   PHP_FE(mb_encode_numericentity, NULL)
+   PHP_FE(mb_decode_numericentity, NULL)
+   PHP_FE(mb_send_mail,NULL)
+   PHP_FE(mb_get_info, NULL)
 #if HAVE_MBREGEX
PHP_MBREGEX_FUNCTION_ENTRIES
 #endif



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