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

2003-03-28 Thread Ilia Alshanetsky
iliaa   Fri Mar 28 09:31:31 2003 EDT

  Modified files:  
/php4/ext/standard  file.c 
  Log:
  CS
  
  Index: php4/ext/standard/file.c
diff -u php4/ext/standard/file.c:1.328 php4/ext/standard/file.c:1.329
--- php4/ext/standard/file.c:1.328  Fri Mar 21 17:22:15 2003
+++ php4/ext/standard/file.cFri Mar 28 09:31:31 2003
@@ -21,7 +21,7 @@
+--+
  */
 
-/* $Id: file.c,v 1.328 2003/03/21 22:22:15 sterling Exp $ */
+/* $Id: file.c,v 1.329 2003/03/28 14:31:31 iliaa Exp $ */
 
 /* Synced with php 3.0 revision 1.218 1999-06-16 [ssb] */
 
@@ -539,10 +539,10 @@
if (!(p = php_stream_locate_eol(stream, target_buf, target_len 
TSRMLS_CC))) {
p = e;
goto parse_eol;
-   }
-   
+   }
+
if (stream-flags  PHP_STREAM_FLAG_EOL_MAC) {
-   eol_marker = '\r';
+   eol_marker = '\r';
}   
 
/* for performance reasons the code is duplicated, so that the if 
(include_new_line) 
@@ -558,7 +558,7 @@
add_index_stringl(return_value, i++, slashed, 
len, 0);
} else {
add_index_stringl(return_value, i++, 
estrndup(s, p-s), p-s, 0);
-   }
+   }
s = p;
} while ((p = memchr(p, eol_marker, (e-p;
} else {
@@ -573,7 +573,7 @@
add_index_stringl(return_value, i++, slashed, 
len, 0);
} else {
add_index_stringl(return_value, i++, 
estrndup(s, p-s), p-s, 0);
-   }
+   }
s = ++p;
} while ((p = memchr(p, eol_marker, (e-p;
}
@@ -582,8 +582,8 @@
if (s != e) {
p = e;
goto parse_eol;
-   }
-   }
+   }
+   }
 
if (target_buf) {
efree(target_buf);
@@ -637,10 +637,9 @@
 
stream = php_stream_fopen_tmpfile();
 
-   if (stream) {
+   if (stream) {
php_stream_to_zval(stream, return_value);
-   }
-   else{
+   } else {
RETURN_FALSE;
}
 }
@@ -665,9 +664,7 @@
ZEND_FETCH_RESOURCE(context, php_stream_context*, zcontext, -1, 
stream-context, le_stream_context);
}

-   stream = php_stream_open_wrapper_ex(filename, mode,
-   (use_include_path ? USE_PATH : 0) | ENFORCE_SAFE_MODE 
| REPORT_ERRORS,
-   NULL, context);
+   stream = php_stream_open_wrapper_ex(filename, mode, (use_include_path ? 
USE_PATH : 0) | ENFORCE_SAFE_MODE | REPORT_ERRORS, NULL, context);
 
if (stream == NULL) {
RETURN_FALSE;
@@ -822,8 +819,9 @@
if (argc == 1) {
/* ask streams to give us a buffer of an appropriate size */
buf = php_stream_get_line(stream, NULL, 0, line_len);
-   if (buf == NULL)
+   if (buf == NULL) {
goto exit_failed;
+   }
} else if (argc  1) {
convert_to_long_ex(arg2);
len = Z_LVAL_PP(arg2);
@@ -834,8 +832,9 @@
}
 
buf = ecalloc(len + 1, sizeof(char));
-   if (php_stream_get_line(stream, buf, len, line_len) == NULL)
+   if (php_stream_get_line(stream, buf, len, line_len) == NULL) {
goto exit_failed;
+   }
}

if (PG(magic_quotes_runtime)) {
@@ -853,8 +852,9 @@
 
 exit_failed:
RETVAL_FALSE;
-   if (buf)
+   if (buf) {
efree(buf);
+   }
 }
 /* }}} */
 
@@ -902,28 +902,31 @@
int allowed_tags_len=0;
 
switch(ZEND_NUM_ARGS()) {
-   case 1:
-   if (zend_get_parameters_ex(1, fd) == FAILURE) {
-   RETURN_FALSE;
-   }
-   break;
-   case 2:
-   if (zend_get_parameters_ex(2, fd, bytes) == FAILURE) {
-   RETURN_FALSE;
-   }
-   break;
-   case 3:
-   if (zend_get_parameters_ex(3, fd, bytes, allow) == FAILURE) {
-   RETURN_FALSE;
-   }
-   convert_to_string_ex(allow);
-   allowed_tags = Z_STRVAL_PP(allow);
-   allowed_tags_len = Z_STRLEN_PP(allow);
-   break;
-   default:
-   WRONG_PARAM_COUNT;
-   /* NOTREACHED */
-   break;
+   case 1:
+ 

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

2003-03-30 Thread Ilia Alshanetsky
iliaa   Sun Mar 30 15:48:05 2003 EDT

  Modified files:  
/php4/ext/gd/libgd  gd.c 
  Log:
  Fixed bug #22965 (Crash in gd lib's ImageFillToBorder()).
  
  
Index: php4/ext/gd/libgd/gd.c
diff -u php4/ext/gd/libgd/gd.c:1.48 php4/ext/gd/libgd/gd.c:1.49
--- php4/ext/gd/libgd/gd.c:1.48 Tue Mar 11 19:51:03 2003
+++ php4/ext/gd/libgd/gd.c  Sun Mar 30 15:48:05 2003
@@ -1723,90 +1723,76 @@
}
 }
 
-void
-gdImageFillToBorder (gdImagePtr im, int x, int y, int border, int color)
+void gdImageFillToBorder (gdImagePtr im, int x, int y, int border, int color)
 {
-  int lastBorder;
-  /* Seek left */
-  int leftLimit, rightLimit;
-  int i;
-  leftLimit = (-1);
-  if (border  0)
-{
-  /* Refuse to fill to a non-solid border */
-  return;
-}
-  for (i = x; (i = 0); i--)
-{
-  if (gdImageGetPixel (im, i, y) == border)
-   {
- break;
-   }
-  gdImageSetPixel (im, i, y, color);
-  leftLimit = i;
-}
-  if (leftLimit == (-1))
-{
-  return;
-}
-  /* Seek right */
-  rightLimit = x;
-  for (i = (x + 1); (i  im-sx); i++)
-{
-  if (gdImageGetPixel (im, i, y) == border)
-   {
- break;
-   }
-  gdImageSetPixel (im, i, y, color);
-  rightLimit = i;
-}
-  /* Look at lines above and below and start paints */
-  /* Above */
-  if (y  0)
-{
-  lastBorder = 1;
-  for (i = leftLimit; (i = rightLimit); i++)
-   {
- int c;
- c = gdImageGetPixel (im, i, y - 1);
- if (lastBorder)
-   {
- if ((c != border)  (c != color))
-   {
- gdImageFillToBorder (im, i, y - 1,
-  border, color);
- lastBorder = 0;
+   int lastBorder;
+   /* Seek left */
+   int leftLimit = -1, rightLimit;
+   int i;
+
+   if (border  0) {
+   /* Refuse to fill to a non-solid border */
+   return;
+   }
+
+   if (x = im-sx) {
+   x = im-sx - 1;
+   }
+   if (y = im-sy) {
+   y = im-sy - 1;
+   }
+
+   for (i = x; i = 0; i--) {
+   if (gdImageGetPixel(im, i, y) == border) {
+   break;
}
-   }
- else if ((c == border) || (c == color))
-   {
- lastBorder = 1;
-   }
-   }
-}
-  /* Below */
-  if (y  ((im-sy) - 1))
-{
-  lastBorder = 1;
-  for (i = leftLimit; (i = rightLimit); i++)
-   {
- int c;
- c = gdImageGetPixel (im, i, y + 1);
- if (lastBorder)
-   {
- if ((c != border)  (c != color))
-   {
- gdImageFillToBorder (im, i, y + 1,
-  border, color);
- lastBorder = 0;
+   gdImageSetPixel(im, i, y, color);
+   leftLimit = i;
+   }
+   if (leftLimit == -1) {
+   return;
+   }
+   /* Seek right */
+   rightLimit = x;
+   for (i = (x + 1); i  im-sx; i++) {
+   if (gdImageGetPixel(im, i, y) == border) {
+   break;
+   }
+   gdImageSetPixel(im, i, y, color);
+   rightLimit = i;
+   }
+   /* Look at lines above and below and start paints */
+   /* Above */
+   if (y  0) {
+   lastBorder = 1;
+   for (i = leftLimit; i = rightLimit; i++) {
+   int c = gdImageGetPixel(im, i, y - 1);
+   if (lastBorder) {
+   if ((c != border)  (c != color)) {
+   gdImageFillToBorder(im, i, y - 1, border, 
color);
+   lastBorder = 0;
+   }
+   } else if ((c == border) || (c == color)) {
+   lastBorder = 1;
+   }
+   }
+   }
+   /* Below */
+   if (y  ((im-sy) - 1)) {
+   lastBorder = 1;
+   for (i = leftLimit; i = rightLimit; i++) {
+   int c = gdImageGetPixel(im, i, y + 1);
+
+   if (lastBorder) {
+   if ((c != border)  (c != color)) {
+   gdImageFillToBorder(im, i, y + 1, border, 
color);
+   lastBorder = 0;
+   }
+   } else if ((c == border) || (c == color)) {
+   lastBorder = 1;
+   }
}
-   }
- else if ((c == border) || (c == color))
-   {
- lastBorder = 1;
-   }
}
-}
 }
 
 void



-- 
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/gd/libgd gd.c

2003-03-30 Thread Ilia Alshanetsky
iliaa   Sun Mar 30 15:48:14 2003 EDT

  Modified files:  (Branch: PHP_4_3)
/php4/ext/gd/libgd  gd.c 
  Log:
  MFH
  
  
Index: php4/ext/gd/libgd/gd.c
diff -u php4/ext/gd/libgd/gd.c:1.24.2.6 php4/ext/gd/libgd/gd.c:1.24.2.7
--- php4/ext/gd/libgd/gd.c:1.24.2.6 Tue Mar 11 20:02:40 2003
+++ php4/ext/gd/libgd/gd.c  Sun Mar 30 15:48:14 2003
@@ -1723,90 +1723,76 @@
}
 }
 
-void
-gdImageFillToBorder (gdImagePtr im, int x, int y, int border, int color)
+void gdImageFillToBorder (gdImagePtr im, int x, int y, int border, int color)
 {
-  int lastBorder;
-  /* Seek left */
-  int leftLimit, rightLimit;
-  int i;
-  leftLimit = (-1);
-  if (border  0)
-{
-  /* Refuse to fill to a non-solid border */
-  return;
-}
-  for (i = x; (i = 0); i--)
-{
-  if (gdImageGetPixel (im, i, y) == border)
-   {
- break;
-   }
-  gdImageSetPixel (im, i, y, color);
-  leftLimit = i;
-}
-  if (leftLimit == (-1))
-{
-  return;
-}
-  /* Seek right */
-  rightLimit = x;
-  for (i = (x + 1); (i  im-sx); i++)
-{
-  if (gdImageGetPixel (im, i, y) == border)
-   {
- break;
-   }
-  gdImageSetPixel (im, i, y, color);
-  rightLimit = i;
-}
-  /* Look at lines above and below and start paints */
-  /* Above */
-  if (y  0)
-{
-  lastBorder = 1;
-  for (i = leftLimit; (i = rightLimit); i++)
-   {
- int c;
- c = gdImageGetPixel (im, i, y - 1);
- if (lastBorder)
-   {
- if ((c != border)  (c != color))
-   {
- gdImageFillToBorder (im, i, y - 1,
-  border, color);
- lastBorder = 0;
+   int lastBorder;
+   /* Seek left */
+   int leftLimit = -1, rightLimit;
+   int i;
+
+   if (border  0) {
+   /* Refuse to fill to a non-solid border */
+   return;
+   }
+
+   if (x = im-sx) {
+   x = im-sx - 1;
+   }
+   if (y = im-sy) {
+   y = im-sy - 1;
+   }
+
+   for (i = x; i = 0; i--) {
+   if (gdImageGetPixel(im, i, y) == border) {
+   break;
}
-   }
- else if ((c == border) || (c == color))
-   {
- lastBorder = 1;
-   }
-   }
-}
-  /* Below */
-  if (y  ((im-sy) - 1))
-{
-  lastBorder = 1;
-  for (i = leftLimit; (i = rightLimit); i++)
-   {
- int c;
- c = gdImageGetPixel (im, i, y + 1);
- if (lastBorder)
-   {
- if ((c != border)  (c != color))
-   {
- gdImageFillToBorder (im, i, y + 1,
-  border, color);
- lastBorder = 0;
+   gdImageSetPixel(im, i, y, color);
+   leftLimit = i;
+   }
+   if (leftLimit == -1) {
+   return;
+   }
+   /* Seek right */
+   rightLimit = x;
+   for (i = (x + 1); i  im-sx; i++) {
+   if (gdImageGetPixel(im, i, y) == border) {
+   break;
+   }
+   gdImageSetPixel(im, i, y, color);
+   rightLimit = i;
+   }
+   /* Look at lines above and below and start paints */
+   /* Above */
+   if (y  0) {
+   lastBorder = 1;
+   for (i = leftLimit; i = rightLimit; i++) {
+   int c = gdImageGetPixel(im, i, y - 1);
+   if (lastBorder) {
+   if ((c != border)  (c != color)) {
+   gdImageFillToBorder(im, i, y - 1, border, 
color);
+   lastBorder = 0;
+   }
+   } else if ((c == border) || (c == color)) {
+   lastBorder = 1;
+   }
+   }
+   }
+   /* Below */
+   if (y  ((im-sy) - 1)) {
+   lastBorder = 1;
+   for (i = leftLimit; i = rightLimit; i++) {
+   int c = gdImageGetPixel(im, i, y + 1);
+
+   if (lastBorder) {
+   if ((c != border)  (c != color)) {
+   gdImageFillToBorder(im, i, y + 1, border, 
color);
+   lastBorder = 0;
+   }
+   } else if ((c == border) || (c == color)) {
+   lastBorder = 1;
+   }
}
-   }
- else if ((c == border) || (c == color))
-   {
- lastBorder = 1;
-   }
}
-}
 }
 
 void



-- 
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-30 Thread Ilia Alshanetsky
iliaa   Sun Mar 30 15:48:48 2003 EDT

  Modified files:  (Branch: PHP_4_3)
/php4   NEWS 
  Log:
  Bug fixing news.
  
  
Index: php4/NEWS
diff -u php4/NEWS:1.1247.2.154 php4/NEWS:1.1247.2.155
--- php4/NEWS:1.1247.2.154  Thu Mar 27 08:32:45 2003
+++ php4/NEWS   Sun Mar 30 15:48:48 2003
@@ -33,6 +33,7 @@
 - Fixed a bug in GD's truecolor TTF handling. (Derick)
 - Fixed several 64-bit problems. (Dave)
 - Fixed several errors in hwapi extension. Objects weren't handled properly. (Uwe)
+- Fixed bug #22965 (Crash in gd lib's ImageFillToBorder()). (Ilia)
 - Fixed bug #22844 (when changing bool value via -d or ini_set, On would 
   become Off). (Ilia)
 - Fixed bug #22775 (Fatal errors exit with status 0 with CGI/CLI). (Jani)



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



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

2003-03-31 Thread Ilia Alshanetsky
iliaa   Mon Mar 31 17:13:01 2003 EDT

  Modified files:  
/php4/main/streams  streams.c 
  Log:
  WS
  
  Index: php4/main/streams/streams.c
diff -u php4/main/streams/streams.c:1.14 php4/main/streams/streams.c:1.15
--- php4/main/streams/streams.c:1.14Wed Mar 19 20:23:04 2003
+++ php4/main/streams/streams.c Mon Mar 31 17:13:01 2003
@@ -19,7 +19,7 @@
+--+
  */
 
-/* $Id: streams.c,v 1.14 2003/03/20 01:23:04 wez Exp $ */
+/* $Id: streams.c,v 1.15 2003/03/31 22:13:01 iliaa Exp $ */
 
 #define _GNU_SOURCE
 #include php.h
@@ -56,16 +56,17 @@
 static int forget_persistent_resource_id_numbers(zend_rsrc_list_entry *rsrc TSRMLS_DC)
 {
php_stream *stream;
-   
-   if (Z_TYPE_P(rsrc) != le_pstream)
+
+   if (Z_TYPE_P(rsrc) != le_pstream) {
return 0;
+   }
 
stream = (php_stream*)rsrc-ptr;
 
 #if STREAM_DEBUG
 fprintf(stderr, forget_persistent: %s:%p\n, stream-ops-label, stream);
 #endif
-   
+
stream-rsrc_id = FAILURE;
 
return 0;
@@ -123,15 +124,17 @@
 
for (i = 0, l = 0; i  wrapper-err_count; i++) {
l += strlen(wrapper-err_stack[i]);
-   if (i  wrapper-err_count - 1)
+   if (i  wrapper-err_count - 1) {
l += brlen;
+   }
}
msg = emalloc(l + 1);
msg[0] = '\0';
for (i = 0; i  wrapper-err_count; i++) {
strcat(msg, wrapper-err_stack[i]);
-   if (i  wrapper-err_count - 1)
+   if (i  wrapper-err_count - 1) { 
strcat(msg, br);
+   }
}
 
free_msg = 1;
@@ -145,8 +148,9 @@
php_strip_url_passwd(tmp);
php_error_docref1(NULL TSRMLS_CC, tmp, E_WARNING, %s: %s, caption, msg);
efree(tmp);
-   if (free_msg)
+   if (free_msg) {
efree(msg);
+   }
 }
 
 void php_stream_tidy_wrapper_error_log(php_stream_wrapper *wrapper TSRMLS_DC)
@@ -155,10 +159,12 @@
/* tidy up the error stack */
int i;
 
-   for (i = 0; i  wrapper-err_count; i++)
+   for (i = 0; i  wrapper-err_count; i++) {
efree(wrapper-err_stack[i]);
-   if (wrapper-err_stack)
+   }
+   if (wrapper-err_stack) {
efree(wrapper-err_stack);
+   }
wrapper-err_stack = NULL;
wrapper-err_count = 0;
}
@@ -179,8 +185,9 @@
} else {
/* append to stack */
wrapper-err_stack = erealloc(wrapper-err_stack, (wrapper-err_count 
+ 1) * sizeof(char *));
-   if (wrapper-err_stack)
+   if (wrapper-err_stack) {
wrapper-err_stack[wrapper-err_count++] = buffer;
+   }
}
 }
 
@@ -191,7 +198,7 @@
 PHPAPI php_stream *_php_stream_alloc(php_stream_ops *ops, void *abstract, const char 
*persistent_id, const char *mode STREAMS_DC TSRMLS_DC) /* {{{ */
 {
php_stream *ret;
-   
+
ret = (php_stream*) pemalloc_rel_orig(sizeof(php_stream), persistent_id ? 1 : 
0);
 
memset(ret, 0, sizeof(php_stream));
@@ -199,14 +206,15 @@
 #if STREAM_DEBUG
 fprintf(stderr, stream_alloc: %s:%p persistent=%s\n, ops-label, ret, 
persistent_id);
 #endif
-   
+
ret-ops = ops;
ret-abstract = abstract;
ret-is_persistent = persistent_id ? 1 : 0;
ret-chunk_size = FG(def_chunk_size);
-   
-   if (FG(auto_detect_line_endings))
+
+   if (FG(auto_detect_line_endings)) {
ret-flags |= PHP_STREAM_FLAG_DETECT_EOL;
+   }
 
if (persistent_id) {
list_entry le;
@@ -222,10 +230,10 @@
return NULL;
}
}
-   
+
ret-rsrc_id = ZEND_REGISTER_RESOURCE(NULL, ret, persistent_id ? le_pstream : 
le_stream);
strlcpy(ret-mode, mode, sizeof(ret-mode));
-   
+
return ret;
 }
 /* }}} */
@@ -240,10 +248,11 @@
 #if STREAM_DEBUG
 fprintf(stderr, stream_free: %s:%p[%s] in_free=%d opts=%08x\n, stream-ops-label, 
stream, stream-__orig_path, stream-in_free, close_options);
 #endif
-   
+
/* recursion protection */
-   if (stream-in_free)
+   if (stream-in_free) {
return 1;
+   }
 
stream-in_free++;
 
@@ -269,17 +278,15 @@
 fprintf(stderr, stream_free: %s:%p[%s] preserve_handle=%d release_cast=%d 
remove_rsrc=%d\n,
stream-ops-label, stream, stream-__orig_path, preserve_handle, 
release_cast, remove_rsrc);
 #endif
-   
+
/* make 

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

2003-04-01 Thread Ilia Alshanetsky
iliaa   Tue Apr  1 19:25:46 2003 EDT

  Modified files:  
/php4/ext/standard  string.c 
  Log:
  Fixed possible integer overflow in str_repeat().
  
  
Index: php4/ext/standard/string.c
diff -u php4/ext/standard/string.c:1.367 php4/ext/standard/string.c:1.368
--- php4/ext/standard/string.c:1.367Tue Apr  1 07:46:01 2003
+++ php4/ext/standard/string.c  Tue Apr  1 19:25:45 2003
@@ -18,7 +18,7 @@
+--+
  */
 
-/* $Id: string.c,v 1.367 2003/04/01 12:46:01 momo Exp $ */
+/* $Id: string.c,v 1.368 2003/04/02 00:25:45 iliaa Exp $ */
 
 /* Synced with php 3.0 revision 1.193 1999-06-16 [ssb] */
 
@@ -3787,6 +3787,10 @@

/* Initialize the result string */  
result_len = Z_STRLEN_PP(input_str) * Z_LVAL_PP(mult);
+   if (result_len  1 || result_len  2147483647) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, You may not create 
strings longer then 2147483647 bytes);
+   RETURN_FALSE;
+   }
result = (char *)emalloc(result_len + 1);

/* Heavy optimization for situations where input string is 1 byte long */



-- 
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/standard string.c

2003-04-01 Thread Ilia Alshanetsky
iliaa   Tue Apr  1 19:25:57 2003 EDT

  Modified files:  (Branch: PHP_4_3)
/php4/ext/standard  string.c 
  Log:
  MFH
  
  
Index: php4/ext/standard/string.c
diff -u php4/ext/standard/string.c:1.333.2.18 php4/ext/standard/string.c:1.333.2.19
--- php4/ext/standard/string.c:1.333.2.18   Fri Mar  7 08:42:20 2003
+++ php4/ext/standard/string.c  Tue Apr  1 19:25:57 2003
@@ -18,7 +18,7 @@
+--+
  */
 
-/* $Id: string.c,v 1.333.2.18 2003/03/07 13:42:20 ddhill Exp $ */
+/* $Id: string.c,v 1.333.2.19 2003/04/02 00:25:57 iliaa Exp $ */
 
 /* Synced with php 3.0 revision 1.193 1999-06-16 [ssb] */
 
@@ -3531,6 +3531,10 @@

/* Initialize the result string */  
result_len = Z_STRLEN_PP(input_str) * Z_LVAL_PP(mult);
+   if (result_len  1 || result_len  2147483647) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, You may not create 
strings longer then 2147483647 bytes);
+   RETURN_FALSE;
+   }
result = (char *)emalloc(result_len + 1);

/* Heavy optimization for situations where input string is 1 byte long */



-- 
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/ftp php_ftp.c

2003-04-02 Thread Ilia Alshanetsky
iliaa   Wed Apr  2 19:55:45 2003 EDT

  Modified files:  (Branch: PHP_4_3)
/php4/ext/ftp   php_ftp.c 
  Log:
  Fixed bug #23004 (When ftp_close() is called, sent QUIT to the ftp server)
  
  
Index: php4/ext/ftp/php_ftp.c
diff -u php4/ext/ftp/php_ftp.c:1.74.2.6 php4/ext/ftp/php_ftp.c:1.74.2.7
--- php4/ext/ftp/php_ftp.c:1.74.2.6 Mon Mar 10 10:57:07 2003
+++ php4/ext/ftp/php_ftp.c  Wed Apr  2 19:55:45 2003
@@ -17,7 +17,7 @@
+--+
  */
 
-/* $Id: php_ftp.c,v 1.74.2.6 2003/03/10 15:57:07 ddhill Exp $ */
+/* $Id: php_ftp.c,v 1.74.2.7 2003/04/03 00:55:45 iliaa Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -1076,6 +1076,8 @@
}
 
ZEND_FETCH_RESOURCE(ftp, ftpbuf_t*, z_ftp, -1, le_ftpbuf_name, le_ftpbuf);
+
+   ftp_quit(ftp);
 
RETURN_BOOL(zend_list_delete(Z_LVAL_P(z_ftp)) == SUCCESS);
 }



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



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

2003-04-02 Thread Ilia Alshanetsky
iliaa   Wed Apr  2 19:55:56 2003 EDT

  Modified files:  
/php4/ext/ftp   php_ftp.c 
  Log:
  MFH
  
  
Index: php4/ext/ftp/php_ftp.c
diff -u php4/ext/ftp/php_ftp.c:1.86 php4/ext/ftp/php_ftp.c:1.87
--- php4/ext/ftp/php_ftp.c:1.86 Mon Mar 10 10:52:10 2003
+++ php4/ext/ftp/php_ftp.c  Wed Apr  2 19:55:56 2003
@@ -17,7 +17,7 @@
+--+
  */
 
-/* $Id: php_ftp.c,v 1.86 2003/03/10 15:52:10 ddhill Exp $ */
+/* $Id: php_ftp.c,v 1.87 2003/04/03 00:55:56 iliaa Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -1122,6 +1122,8 @@
}
 
ZEND_FETCH_RESOURCE(ftp, ftpbuf_t*, z_ftp, -1, le_ftpbuf_name, le_ftpbuf);
+
+   ftp_quit(ftp);
 
RETURN_BOOL(zend_list_delete(Z_LVAL_P(z_ftp)) == SUCCESS);
 }



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



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

2003-04-03 Thread Ilia Alshanetsky
iliaa   Thu Apr  3 19:16:48 2003 EDT

  Modified files:  
/php4/ext/gdgd.c 
  Log:
  Fix segfault in imagecopyresized().
  
  
Index: php4/ext/gd/gd.c
diff -u php4/ext/gd/gd.c:1.264 php4/ext/gd/gd.c:1.265
--- php4/ext/gd/gd.c:1.264  Thu Apr  3 19:09:23 2003
+++ php4/ext/gd/gd.cThu Apr  3 19:16:47 2003
@@ -18,7 +18,7 @@
+--+
  */
 
-/* $Id: gd.c,v 1.264 2003/04/04 00:09:23 sniper Exp $ */
+/* $Id: gd.c,v 1.265 2003/04/04 00:16:47 iliaa Exp $ */
 
 /* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center,
Cold Spring Harbor Labs. */
@@ -2946,6 +2946,11 @@
dstY = Z_LVAL_PP(DY);
dstH = Z_LVAL_PP(DH);
dstW = Z_LVAL_PP(DW);
+   
+   if (dstW  0 || dstH  0 || srcW  0 || srcH  0) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, Invalid image 
dimensions);
+   RETURN_FALSE;
+   }
 
gdImageCopyResized(im_dst, im_src, dstX, dstY, srcX, srcY, dstW, dstH, srcW, 
srcH);
RETURN_TRUE;



-- 
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/gd gd.c

2003-04-03 Thread Ilia Alshanetsky
iliaa   Thu Apr  3 19:16:55 2003 EDT

  Modified files:  (Branch: PHP_4_3)
/php4/ext/gdgd.c 
  Log:
  MFH
  
  
Index: php4/ext/gd/gd.c
diff -u php4/ext/gd/gd.c:1.221.2.21 php4/ext/gd/gd.c:1.221.2.22
--- php4/ext/gd/gd.c:1.221.2.21 Thu Apr  3 18:10:17 2003
+++ php4/ext/gd/gd.cThu Apr  3 19:16:54 2003
@@ -18,7 +18,7 @@
+--+
  */
 
-/* $Id: gd.c,v 1.221.2.21 2003/04/03 23:10:17 sniper Exp $ */
+/* $Id: gd.c,v 1.221.2.22 2003/04/04 00:16:54 iliaa Exp $ */
 
 /* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center, 
Cold Spring Harbor Labs. */
@@ -2861,6 +2861,11 @@
dstY = Z_LVAL_PP(DY);
dstH = Z_LVAL_PP(DH);
dstW = Z_LVAL_PP(DW);
+   
+   if (dstW  0 || dstH  0 || srcW  0 || srcH  0) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, Invalid image 
dimensions);
+   RETURN_FALSE;
+   }
 
gdImageCopyResized(im_dst, im_src, dstX, dstY, srcX, srcY, dstW, dstH, srcW, 
srcH);
RETURN_TRUE;



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



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

2003-04-03 Thread Ilia Alshanetsky
iliaa   Thu Apr  3 19:29:37 2003 EDT

  Modified files:  (Branch: PHP_4_3)
/php4   TODO_SEGFAULTS 
  Log:
  Fixed segv as well as info about new segvs in gd.
  
  
Index: php4/TODO_SEGFAULTS
diff -u php4/TODO_SEGFAULTS:1.1.2.22 php4/TODO_SEGFAULTS:1.1.2.23
--- php4/TODO_SEGFAULTS:1.1.2.22Thu Apr  3 15:07:40 2003
+++ php4/TODO_SEGFAULTS Thu Apr  3 19:29:37 2003
@@ -9,10 +9,11 @@
 exif_imagetype,exif_thumbnail (Rasmus)
 dbase_open (Rasmus)
 array_pad (Rasmus)
-str_repeat (Ilia)
 setlocale (Rasmus)
 unregister_tick_function (Rasmus)
 bcsub (Rasmus)
+str_repeat (Ilia)
+imagecopyresized (Ilia)
 mb_ereg, mb_ereg_match, mb_eregi, mb_split (Moriyoshi)
 xml_parser_create (Moriyoshi)
 ob_start (Sascha)
@@ -26,6 +27,7 @@
 mb_strcut('', 2147483647);  (2)
 chunk_split (3)
 socket_select   (4)
+php_imagepolygon   (5)

 (1) heap corruption, mostly visible in malloc-related calls.  Whether you see 
 this or not might depend on your libc/compiler.  Hard to track down,
@@ -74,7 +76,8 @@
 
 echo dbase_open | php do_crash.txt
 
-
+(5) integer overflow inside php_imagepolygon and possible subsequent 
+integer overflows inside gdlib's gdImageFilledPolygon().
 
 
 Ammendment 1.



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



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

2003-04-03 Thread Ilia Alshanetsky
iliaa   Thu Apr  3 19:44:35 2003 EDT

  Modified files:  (Branch: PHP_4_3)
/php4   TODO_SEGFAULTS 
  Log:
  More gd stuff.
  
  
Index: php4/TODO_SEGFAULTS
diff -u php4/TODO_SEGFAULTS:1.1.2.23 php4/TODO_SEGFAULTS:1.1.2.24
--- php4/TODO_SEGFAULTS:1.1.2.23Thu Apr  3 19:29:37 2003
+++ php4/TODO_SEGFAULTS Thu Apr  3 19:44:34 2003
@@ -28,6 +28,7 @@
 chunk_split (3)
 socket_select   (4)
 php_imagepolygon   (5)
+imagesetstyle  (6)

 (1) heap corruption, mostly visible in malloc-related calls.  Whether you see 
 this or not might depend on your libc/compiler.  Hard to track down,
@@ -79,6 +80,10 @@
 (5) integer overflow inside php_imagepolygon and possible subsequent 
 integer overflows inside gdlib's gdImageFilledPolygon().
 
+(6) integer overflow if the number of elements in the array passed as
+second argument * sizeof(int) result in an overflow.
+gdImageSetStyle function called by this php wrapper can die for the
+same reason.  
 
 Ammendment 1.
 



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



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

2003-04-03 Thread Ilia Alshanetsky
iliaa   Thu Apr  3 20:17:35 2003 EDT

  Modified files:  (Branch: PHP_4_3)
/php4   TODO_SEGFAULTS 
  Log:
  Notes about various possible integer overflows in bundled gd library.
  
  
Index: php4/TODO_SEGFAULTS
diff -u php4/TODO_SEGFAULTS:1.1.2.24 php4/TODO_SEGFAULTS:1.1.2.25
--- php4/TODO_SEGFAULTS:1.1.2.24Thu Apr  3 19:44:34 2003
+++ php4/TODO_SEGFAULTS Thu Apr  3 20:17:35 2003
@@ -29,6 +29,7 @@
 socket_select   (4)
 php_imagepolygon   (5)
 imagesetstyle  (6)
+bundled gd (7)

 (1) heap corruption, mostly visible in malloc-related calls.  Whether you see 
 this or not might depend on your libc/compiler.  Hard to track down,
@@ -84,6 +85,20 @@
 second argument * sizeof(int) result in an overflow.
 gdImageSetStyle function called by this php wrapper can die for the
 same reason.  
+
+(7) multiple integer overflows that can occur when trying to allocate a buffer
+for a new image. Affected functions:
+gdImageCreateFromJpegCtx
+readwbmp
+gdImageCreateFromXpm
+gdImageCreateFromPngCtx
+gdImagePngCtx
+gdImageCreateFromJpegCtx
+gdImageJpegCtx
+gdImageCreateFromGd2Ctx
+gdImageCreateFromGd2PartCtx
+_gdImageGd2
+GetDataBlock (gd_gif_in.c)
 
 Ammendment 1.
 



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



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

2003-04-03 Thread Ilia Alshanetsky
iliaa   Thu Apr  3 20:33:58 2003 EDT

  Modified files:  
/php4/ext/gdgd.c 
  Log:
  Might as well disallow 0x0 images.
  
  Thanks Marcus.
  
  
Index: php4/ext/gd/gd.c
diff -u php4/ext/gd/gd.c:1.265 php4/ext/gd/gd.c:1.266
--- php4/ext/gd/gd.c:1.265  Thu Apr  3 19:16:47 2003
+++ php4/ext/gd/gd.cThu Apr  3 20:33:57 2003
@@ -18,7 +18,7 @@
+--+
  */
 
-/* $Id: gd.c,v 1.265 2003/04/04 00:16:47 iliaa Exp $ */
+/* $Id: gd.c,v 1.266 2003/04/04 01:33:57 iliaa Exp $ */
 
 /* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center,
Cold Spring Harbor Labs. */
@@ -2947,7 +2947,7 @@
dstH = Z_LVAL_PP(DH);
dstW = Z_LVAL_PP(DW);

-   if (dstW  0 || dstH  0 || srcW  0 || srcH  0) {
+   if (dstW = 0 || dstH = 0 || srcW = 0 || srcH = 0) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, Invalid image 
dimensions);
RETURN_FALSE;
}



-- 
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/gd gd.c

2003-04-03 Thread Ilia Alshanetsky
iliaa   Thu Apr  3 20:34:08 2003 EDT

  Modified files:  (Branch: PHP_4_3)
/php4/ext/gdgd.c 
  Log:
  MFH
  
  
Index: php4/ext/gd/gd.c
diff -u php4/ext/gd/gd.c:1.221.2.22 php4/ext/gd/gd.c:1.221.2.23
--- php4/ext/gd/gd.c:1.221.2.22 Thu Apr  3 19:16:54 2003
+++ php4/ext/gd/gd.cThu Apr  3 20:34:08 2003
@@ -18,7 +18,7 @@
+--+
  */
 
-/* $Id: gd.c,v 1.221.2.22 2003/04/04 00:16:54 iliaa Exp $ */
+/* $Id: gd.c,v 1.221.2.23 2003/04/04 01:34:08 iliaa Exp $ */
 
 /* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center, 
Cold Spring Harbor Labs. */
@@ -2862,7 +2862,7 @@
dstH = Z_LVAL_PP(DH);
dstW = Z_LVAL_PP(DW);

-   if (dstW  0 || dstH  0 || srcW  0 || srcH  0) {
+   if (dstW = 0 || dstH = 0 || srcW = 0 || srcH = 0) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, Invalid image 
dimensions);
RETURN_FALSE;
}



-- 
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/hyperwave hg_comm.c /ext/pcntl pcntl.c php_pcntl.h /ext/sockets php_sockets.h sockets.c

2003-06-06 Thread Ilia Alshanetsky
iliaa   Thu Jun  5 19:48:17 2003 EDT

  Modified files:  (Branch: PHP_4_3)
/php4/ext/hyperwave hg_comm.c 
/php4/ext/pcntl pcntl.c php_pcntl.h 
/php4/ext/sockets   php_sockets.h sockets.c 
  Log:
  Fix compile warnings (mostly MFH from 5.0 branch)
  
  
Index: php4/ext/hyperwave/hg_comm.c
diff -u php4/ext/hyperwave/hg_comm.c:1.52.8.1 php4/ext/hyperwave/hg_comm.c:1.52.8.2
--- php4/ext/hyperwave/hg_comm.c:1.52.8.1   Tue Dec 31 11:34:39 2002
+++ php4/ext/hyperwave/hg_comm.cThu Jun  5 19:48:16 2003
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: hg_comm.c,v 1.52.8.1 2002/12/31 16:34:39 sebastian Exp $ */
+/* $Id: hg_comm.c,v 1.52.8.2 2003/06/05 23:48:16 iliaa Exp $ */
 
 /* #define HW_DEBUG */
 
@@ -31,7 +31,7 @@
 #include string.h 
 #include sys/types.h
 #ifdef PHP_WIN32
-# include winsock.h
+# include winsock2.h
 # define EWOULDBLOCK WSAEWOULDBLOCK
 # define ETIMEDOUT WSAETIMEDOUT
 # define bcopy memcpy
@@ -42,6 +42,7 @@
 # include netdb.h
 # include unistd.h
 # include sys/param.h
+# include arpa/inet.h
 #endif
 #include fcntl.h
 #include errno.h
@@ -5034,10 +5035,8 @@
 
switch(hostptr-h_addrtype) {
struct in_addr *ptr1;
-   char *ptr;
case AF_INET:
-   ptr = hostptr-h_addr_list[0];
-   ptr1 = (struct in_addr *) ptr;
+   ptr1 = (struct in_addr *) hostptr-h_addr_list[0];
hostip = inet_ntoa(*ptr1);
break;
default:
@@ -5221,10 +5220,8 @@
 
switch(hostptr-h_addrtype) {
struct in_addr *ptr1;
-   char *ptr;
case AF_INET:
-   ptr = hostptr-h_addr_list[0];
-   ptr1 = (struct in_addr *) ptr;
+   ptr1 = (struct in_addr *) hostptr-h_addr_list[0];
hostip = inet_ntoa(*ptr1);
break;
default:
@@ -5403,10 +5400,8 @@
 
switch(hostptr-h_addrtype) {
struct in_addr *ptr1;
-   char *ptr;
case AF_INET:
-   ptr = hostptr-h_addr_list[0];
-   ptr1 = (struct in_addr *) ptr;
+   ptr1 = (struct in_addr *) hostptr-h_addr_list[0];
hostip = inet_ntoa(*ptr1);
break;
default:
Index: php4/ext/pcntl/pcntl.c
diff -u php4/ext/pcntl/pcntl.c:1.28.4.2 php4/ext/pcntl/pcntl.c:1.28.4.3
--- php4/ext/pcntl/pcntl.c:1.28.4.2 Tue Dec 31 11:35:08 2002
+++ php4/ext/pcntl/pcntl.c  Thu Jun  5 19:48:17 2003
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: pcntl.c,v 1.28.4.2 2002/12/31 16:35:08 sebastian Exp $ */
+/* $Id: pcntl.c,v 1.28.4.3 2003/06/05 23:48:17 iliaa Exp $ */
 
 #define PCNTL_DEBUG 0
 
@@ -69,6 +69,9 @@
 #ifdef COMPILE_DL_PCNTL
 ZEND_GET_MODULE(pcntl)
 #endif
+
+static void pcntl_signal_handler(int);
+static void pcntl_tick_handler();
   
 void php_register_signal_constants(INIT_FUNC_ARGS)
 {
Index: php4/ext/pcntl/php_pcntl.h
diff -u php4/ext/pcntl/php_pcntl.h:1.11.4.1 php4/ext/pcntl/php_pcntl.h:1.11.4.2
--- php4/ext/pcntl/php_pcntl.h:1.11.4.1 Tue Dec 31 11:35:08 2002
+++ php4/ext/pcntl/php_pcntl.h  Thu Jun  5 19:48:17 2003
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: php_pcntl.h,v 1.11.4.1 2002/12/31 16:35:08 sebastian Exp $ */
+/* $Id: php_pcntl.h,v 1.11.4.2 2003/06/05 23:48:17 iliaa Exp $ */
 
 #ifndef PHP_PCNTL_H
 #define PHP_PCNTL_H
@@ -50,10 +50,6 @@
 PHP_FUNCTION(pcntl_wstopsig);
 PHP_FUNCTION(pcntl_signal);
 PHP_FUNCTION(pcntl_exec);
-
-static void pcntl_signal_handler(int);
-static void pcntl_tick_handler();
-
 
 ZEND_BEGIN_MODULE_GLOBALS(pcntl)
HashTable php_signal_table;
Index: php4/ext/sockets/php_sockets.h
diff -u php4/ext/sockets/php_sockets.h:1.26.2.3 php4/ext/sockets/php_sockets.h:1.26.2.4
--- php4/ext/sockets/php_sockets.h:1.26.2.3 Thu Apr 17 19:20:58 2003
+++ php4/ext/sockets/php_sockets.h  Thu Jun  5 19:48:17 2003
@@ -22,7 +22,7 @@
 #ifndef PHP_SOCKETS_H
 #define PHP_SOCKETS_H
 
-/* $Id: php_sockets.h,v 1.26.2.3 2003/04/17 23:20:58 sniper Exp $ */
+/* $Id: php_sockets.h,v 1.26.2.4 2003/06/05 23:48:17 iliaa Exp $ */
 
 #if HAVE_SOCKETS
 
@@ -100,12 +100,6 @@
 typedef struct {
zend_bool   use_system_read;
 } php_sockets_globals;
-
-/* Prototypes */
-static int php_open_listen_sock(php_socket **php_sock, int port, int backlog 
TSRMLS_DC);
-static int php_accept_connect(php_socket *in_sock, php_socket **new_sock, struct 
sockaddr *la TSRMLS_DC);
-static int php_read(int bsd_socket, void *buf, size_t maxlen, int flags);
-static char *php_strerror(int error TSRMLS_DC);
 
 ZEND_BEGIN_MODULE_GLOBALS(sockets)
int 

[PHP-CVS] cvs: php4 /ext/sockets php_sockets.h sockets.c

2003-05-27 Thread Ilia Alshanetsky
iliaa   Tue May 27 21:04:06 2003 EDT

  Modified files:  
/php4/ext/sockets   php_sockets.h sockets.c 
  Log:
  Fixed compiler warnings.
  
  
Index: php4/ext/sockets/php_sockets.h
diff -u php4/ext/sockets/php_sockets.h:1.29 php4/ext/sockets/php_sockets.h:1.30
--- php4/ext/sockets/php_sockets.h:1.29 Thu Apr 17 19:18:58 2003
+++ php4/ext/sockets/php_sockets.h  Tue May 27 21:04:06 2003
@@ -22,7 +22,7 @@
 #ifndef PHP_SOCKETS_H
 #define PHP_SOCKETS_H
 
-/* $Id: php_sockets.h,v 1.29 2003/04/17 23:18:58 sniper Exp $ */
+/* $Id: php_sockets.h,v 1.30 2003/05/28 01:04:06 iliaa Exp $ */
 
 #if HAVE_SOCKETS
 
@@ -102,10 +102,12 @@
 } php_sockets_globals;
 
 /* Prototypes */
+#ifdef ilia_0 /* not needed, only causes a compiler warning */
 static int php_open_listen_sock(php_socket **php_sock, int port, int backlog 
TSRMLS_DC);
 static int php_accept_connect(php_socket *in_sock, php_socket **new_sock, struct 
sockaddr *la TSRMLS_DC);
 static int php_read(int bsd_socket, void *buf, size_t maxlen, int flags);
 static char *php_strerror(int error TSRMLS_DC);
+#endif
 
 ZEND_BEGIN_MODULE_GLOBALS(sockets)
int last_error;
Index: php4/ext/sockets/sockets.c
diff -u php4/ext/sockets/sockets.c:1.140 php4/ext/sockets/sockets.c:1.141
--- php4/ext/sockets/sockets.c:1.140Fri Apr 25 04:10:11 2003
+++ php4/ext/sockets/sockets.c  Tue May 27 21:04:06 2003
@@ -19,7 +19,7 @@
+--+
  */
 
-/* $Id: sockets.c,v 1.140 2003/04/25 08:10:11 sniper Exp $ */
+/* $Id: sockets.c,v 1.141 2003/05/28 01:04:06 iliaa Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -82,6 +82,7 @@
 #define PF_INET AF_INET
 #endif
 
+static char *php_strerror(int error TSRMLS_DC);
 
 #define PHP_NORMAL_READ 0x0001
 #define PHP_BINARY_READ 0x0002



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



[PHP-CVS] cvs: php4 /ext/sysvshm php_sysvshm.h sysvshm.c

2003-05-29 Thread Ilia Alshanetsky
iliaa   Wed May 28 18:21:14 2003 EDT

  Modified files:  
/php4/ext/sysvshm   php_sysvshm.h sysvshm.c 
  Log:
  Fixed compiler warnings.
  
  
Index: php4/ext/sysvshm/php_sysvshm.h
diff -u php4/ext/sysvshm/php_sysvshm.h:1.13 php4/ext/sysvshm/php_sysvshm.h:1.14
--- php4/ext/sysvshm/php_sysvshm.h:1.13 Thu Mar  6 19:52:04 2003
+++ php4/ext/sysvshm/php_sysvshm.h  Wed May 28 18:21:13 2003
@@ -16,7 +16,7 @@
+--+
 */
 
-/* $Id: php_sysvshm.h,v 1.13 2003/03/07 00:52:04 sniper Exp $ */
+/* $Id: php_sysvshm.h,v 1.14 2003/05/28 22:21:13 iliaa Exp $ */
 
 #ifndef PHP_SYSVSHM_H
 #define PHP_SYSVSHM_H
@@ -63,10 +63,6 @@
 PHP_FUNCTION(shm_put_var);
 PHP_FUNCTION(shm_get_var);
 PHP_FUNCTION(shm_remove_var);
-
-static int php_put_shm_data(sysvshm_chunk_head *ptr,long key,char *data, long len);
-static long php_check_shm_data(sysvshm_chunk_head *ptr, long key);
-static int php_remove_shm_data(sysvshm_chunk_head *ptr, long shm_varpos);
 
 extern sysvshm_module php_sysvshm;
 
Index: php4/ext/sysvshm/sysvshm.c
diff -u php4/ext/sysvshm/sysvshm.c:1.61 php4/ext/sysvshm/sysvshm.c:1.62
--- php4/ext/sysvshm/sysvshm.c:1.61 Thu Mar  6 19:52:04 2003
+++ php4/ext/sysvshm/sysvshm.c  Wed May 28 18:21:13 2003
@@ -16,7 +16,7 @@
+--+
  */
  
-/* $Id: sysvshm.c,v 1.61 2003/03/07 00:52:04 sniper Exp $ */
+/* $Id: sysvshm.c,v 1.62 2003/05/28 22:21:13 iliaa Exp $ */
 
 /* This has been built and tested on Linux 2.2.14 
  *
@@ -74,6 +74,10 @@
 #undef shm_ptr /* undefine AIX-specific macro */
 
 THREAD_LS sysvshm_module php_sysvshm;
+
+static int php_put_shm_data(sysvshm_chunk_head *ptr, long key, char *data, long len);
+static long php_check_shm_data(sysvshm_chunk_head *ptr, long key);
+static int php_remove_shm_data(sysvshm_chunk_head *ptr, long shm_varpos);
 
 /* {{{ php_release_sysvshm
  */



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



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

2003-05-31 Thread Ilia Alshanetsky
iliaa   Fri May 30 09:20:01 2003 EDT

  Modified files:  
/php4/ext/mbstring  mbfilter.c 
  Log:
  Fixed bug #23897 (Fixed a check for mbfilter_ru.h) [EMAIL PROTECTED]
  
  
Index: php4/ext/mbstring/mbfilter.c
diff -u php4/ext/mbstring/mbfilter.c:1.55 php4/ext/mbstring/mbfilter.c:1.56
--- php4/ext/mbstring/mbfilter.c:1.55   Fri Apr  4 04:06:23 2003
+++ php4/ext/mbstring/mbfilter.cFri May 30 09:20:01 2003
@@ -80,7 +80,7 @@
  *
  */
 
-/* $Id: mbfilter.c,v 1.55 2003/04/04 09:06:23 moriyoshi Exp $ */
+/* $Id: mbfilter.c,v 1.56 2003/05/30 13:20:01 iliaa Exp $ */
 
 
 #ifdef HAVE_CONFIG_H
@@ -107,7 +107,7 @@
 #if defined(HAVE_MBSTR_KR)
 #include mbfilter_kr.h
 #endif
-#if defined(HAVE_MBSTR_KR)
+#if defined(HAVE_MBSTR_RU)
 #include mbfilter_ru.h
 #endif
 



-- 
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/mbstring mbfilter.c

2003-05-31 Thread Ilia Alshanetsky
iliaa   Fri May 30 09:20:18 2003 EDT

  Modified files:  (Branch: PHP_4_3)
/php4/ext/mbstring  mbfilter.c 
  Log:
  MFH
  
  
Index: php4/ext/mbstring/mbfilter.c
diff -u php4/ext/mbstring/mbfilter.c:1.52.2.3 php4/ext/mbstring/mbfilter.c:1.52.2.4
--- php4/ext/mbstring/mbfilter.c:1.52.2.3   Fri Apr  4 04:07:02 2003
+++ php4/ext/mbstring/mbfilter.cFri May 30 09:20:17 2003
@@ -80,7 +80,7 @@
  *
  */
 
-/* $Id: mbfilter.c,v 1.52.2.3 2003/04/04 09:07:02 moriyoshi Exp $ */
+/* $Id: mbfilter.c,v 1.52.2.4 2003/05/30 13:20:17 iliaa Exp $ */
 
 
 #ifdef HAVE_CONFIG_H
@@ -107,7 +107,7 @@
 #if defined(HAVE_MBSTR_KR)
 #include mbfilter_kr.h
 #endif
-#if defined(HAVE_MBSTR_KR)
+#if defined(HAVE_MBSTR_RU)
 #include mbfilter_ru.h
 #endif
 



-- 
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-05-31 Thread Ilia Alshanetsky
iliaa   Fri May 30 09:20:55 2003 EDT

  Modified files:  (Branch: PHP_4_3)
/php4   NEWS 
  Log:
  Bug fixing news.
  
  
Index: php4/NEWS
diff -u php4/NEWS:1.1247.2.219 php4/NEWS:1.1247.2.220
--- php4/NEWS:1.1247.2.219  Fri May 30 05:45:57 2003
+++ php4/NEWS   Fri May 30 09:20:55 2003
@@ -6,6 +6,7 @@
 - Added new command line parameters -B, -F, -R and -E which allow to process 
   stdin line by line (See 'php -h' or 'man php' for more). (Marcus)
 - Added DBA handler 'inifile' to support ini files. (Marcus)
+- Fixed bug #23897 (Fixed a check for mbfilter_ru.h) [EMAIL PROTECTED]
 
 29 May 2003, Version 4.3.2
 - Syncronized bundled GD library with GD 2.0.12. (Ilia)



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



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

2003-05-31 Thread Ilia Alshanetsky
iliaa   Fri May 30 10:08:14 2003 EDT

  Modified files:  
/php4/ext/mysql php_mysql.c 
  Log:
  Fixed bug #23888 (Missing input validation for flags parameter)
  
  
Index: php4/ext/mysql/php_mysql.c
diff -u php4/ext/mysql/php_mysql.c:1.190 php4/ext/mysql/php_mysql.c:1.191
--- php4/ext/mysql/php_mysql.c:1.190Wed May 28 12:19:08 2003
+++ php4/ext/mysql/php_mysql.c  Fri May 30 10:08:14 2003
@@ -18,7 +18,7 @@
+--+
 */
  
-/* $Id: php_mysql.c,v 1.190 2003/05/28 16:19:08 rasmus Exp $ */
+/* $Id: php_mysql.c,v 1.191 2003/05/30 14:08:14 iliaa Exp $ */
 
 /* TODO:
  *
@@ -525,6 +525,7 @@
}
convert_to_string_ex(z_user);
convert_to_string_ex(z_passwd);
+   convert_to_boolean_ex(z_new_link);
user = Z_STRVAL_PP(z_user);
passwd = Z_STRVAL_PP(z_passwd);
new_link = Z_BVAL_PP(z_new_link);
@@ -535,6 +536,7 @@
}
convert_to_string_ex(z_user);
convert_to_string_ex(z_passwd);
+   convert_to_long_ex(z_client_flags);
user = Z_STRVAL_PP(z_user);
passwd = Z_STRVAL_PP(z_passwd);
client_flags = 
Z_LVAL_PP(z_client_flags);
@@ -547,6 +549,8 @@
}
convert_to_string_ex(z_user);
convert_to_string_ex(z_passwd);
+   convert_to_boolean_ex(z_new_link);
+   convert_to_long_ex(z_client_flags);
user = Z_STRVAL_PP(z_user);
passwd = Z_STRVAL_PP(z_passwd);
new_link = Z_BVAL_PP(z_new_link);



-- 
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 php_mysql.c

2003-05-31 Thread Ilia Alshanetsky
iliaa   Fri May 30 10:08:39 2003 EDT

  Modified files:  (Branch: PHP_4_3)
/php4/ext/mysql php_mysql.c 
  Log:
  MFH
  
  
Index: php4/ext/mysql/php_mysql.c
diff -u php4/ext/mysql/php_mysql.c:1.174.2.14 php4/ext/mysql/php_mysql.c:1.174.2.15
--- php4/ext/mysql/php_mysql.c:1.174.2.14   Fri May 30 09:00:17 2003
+++ php4/ext/mysql/php_mysql.c  Fri May 30 10:08:38 2003
@@ -18,7 +18,7 @@
+--+
 */
  
-/* $Id: php_mysql.c,v 1.174.2.14 2003/05/30 13:00:17 georg Exp $ */
+/* $Id: php_mysql.c,v 1.174.2.15 2003/05/30 14:08:38 iliaa Exp $ */
 
 /* TODO:
  *
@@ -525,6 +525,7 @@
}
convert_to_string_ex(z_user);
convert_to_string_ex(z_passwd);
+   convert_to_boolean_ex(z_new_link);
user = Z_STRVAL_PP(z_user);
passwd = Z_STRVAL_PP(z_passwd);
new_link = Z_BVAL_PP(z_new_link);
@@ -535,6 +536,7 @@
}
convert_to_string_ex(z_user);
convert_to_string_ex(z_passwd);
+   convert_to_long_ex(z_client_flags);
user = Z_STRVAL_PP(z_user);
passwd = Z_STRVAL_PP(z_passwd);
client_flags = 
Z_LVAL_PP(z_client_flags);
@@ -547,6 +549,8 @@
}
convert_to_string_ex(z_user);
convert_to_string_ex(z_passwd);
+   convert_to_boolean_ex(z_new_link);
+   convert_to_long_ex(z_client_flags);
user = Z_STRVAL_PP(z_user);
passwd = Z_STRVAL_PP(z_passwd);
new_link = Z_BVAL_PP(z_new_link);



-- 
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-05-31 Thread Ilia Alshanetsky
iliaa   Fri May 30 10:09:21 2003 EDT

  Modified files:  (Branch: PHP_4_3)
/php4   NEWS 
  Log:
  MFH
  
  
Index: php4/NEWS
diff -u php4/NEWS:1.1247.2.221 php4/NEWS:1.1247.2.222
--- php4/NEWS:1.1247.2.221  Fri May 30 09:57:20 2003
+++ php4/NEWS   Fri May 30 10:09:21 2003
@@ -8,6 +8,7 @@
 - Added DBA handler 'inifile' to support ini files. (Marcus)
 - Fixed bug #23897 (Fixed a check for mbfilter_ru.h). ([EMAIL PROTECTED], Ilia)
 - Fixed bug #23894 (sprintf() decimal specifiers problem). (Moriyoshi)
+- Fixed bug #23888 (Missing input validation for flags parameter) (Ilia)
 
 29 May 2003, Version 4.3.2
 - Syncronized bundled GD library with GD 2.0.12. (Ilia)



-- 
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/odbc php_odbc.c

2003-05-31 Thread Ilia Alshanetsky
iliaa   Fri May 30 10:45:20 2003 EDT

  Modified files:  (Branch: PHP_4_3)
/php4/ext/odbc  php_odbc.c 
  Log:
  MFH (fix for bug #23898)
  
  
Index: php4/ext/odbc/php_odbc.c
diff -u php4/ext/odbc/php_odbc.c:1.143.2.10 php4/ext/odbc/php_odbc.c:1.143.2.11
--- php4/ext/odbc/php_odbc.c:1.143.2.10 Thu May 29 08:34:38 2003
+++ php4/ext/odbc/php_odbc.cFri May 30 10:45:20 2003
@@ -20,7 +20,7 @@
+--+
 */
 
-/* $Id: php_odbc.c,v 1.143.2.10 2003/05/29 12:34:38 kalowsky Exp $ */
+/* $Id: php_odbc.c,v 1.143.2.11 2003/05/30 14:45:20 iliaa Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -1613,7 +1613,7 @@
if (rc == SQL_SUCCESS_WITH_INFO) {
Z_STRLEN_P(tmp) = result-longreadlen;
} else if (result-values[i].vallen == SQL_NULL_DATA) {
-   Z_STRVAL_P(tmp) = empty_string;
+   ZVAL_NULL(tmp);
break;
} else {
Z_STRLEN_P(tmp) = result-values[i].vallen;
@@ -1623,7 +1623,7 @@
 
default:
if (result-values[i].vallen == SQL_NULL_DATA) {
-   Z_STRVAL_P(tmp) = empty_string;
+   ZVAL_NULL(tmp);
break;
}
Z_STRLEN_P(tmp) = result-values[i].vallen;
@@ -1845,7 +1845,10 @@
RETURN_FALSE;
}
 
-   if (result-values[field_ind].vallen == SQL_NULL_DATA || rc == 
SQL_NO_DATA_FOUND) {
+   if (result-values[field_ind].vallen == SQL_NULL_DATA) {
+   efree(field);
+   RETURN_NULL();
+   } else if (rc == SQL_NO_DATA_FOUND) {
efree(field);
RETURN_FALSE;
}
@@ -1861,7 +1864,7 @@

default:
if (result-values[field_ind].vallen == SQL_NULL_DATA) {
-   RETURN_FALSE;
+   RETURN_NULL();
} else {
RETURN_STRINGL(result-values[field_ind].value, 
result-values[field_ind].vallen, 1);
}
@@ -1890,7 +1893,7 @@

if (result-values[field_ind].vallen == SQL_NULL_DATA) {
efree(field);
-   RETURN_FALSE;
+   RETURN_NULL();
}
/* chop the trailing \0 by outputing only 4095 bytes */
PHPWRITE(field,(rc == SQL_SUCCESS_WITH_INFO) ? 4095 :
@@ -1997,7 +2000,7 @@
if (rc == SQL_SUCCESS_WITH_INFO)
php_printf(buf,result-longreadlen);
else if (result-values[i].vallen == 
SQL_NULL_DATA) {
-   php_printf(nbsp;/td);
+   php_printf(tdNULL/td);
break;
} else {
php_printf(buf, 
result-values[i].vallen);
@@ -2006,7 +2009,7 @@
break;
default:
if (result-values[i].vallen == SQL_NULL_DATA) 
{
-   php_printf(tdnbsp;/td);
+   php_printf(tdNULL/td);
} else {
php_printf(td%s/td, 
result-values[i].value);
}



-- 
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-05-31 Thread Ilia Alshanetsky
iliaa   Fri May 30 10:46:20 2003 EDT

  Modified files:  (Branch: PHP_4_3)
/php4   NEWS 
  Log:
  Bug fixing news.
  
  
Index: php4/NEWS
diff -u php4/NEWS:1.1247.2.223 php4/NEWS:1.1247.2.224
--- php4/NEWS:1.1247.2.223  Fri May 30 10:17:16 2003
+++ php4/NEWS   Fri May 30 10:46:19 2003
@@ -6,6 +6,8 @@
 - Added new command line parameters -B, -F, -R and -E which allow to process 
   stdin line by line (See 'php -h' or 'man php' for more). (Marcus)
 - Added DBA handler 'inifile' to support ini files. (Marcus)
+- Fixed bug #23898 (Proper handling of NULLs in odbc_result, odbc_fetch_into
+  and odbc_result_all). (Ilia)
 - Fixed bug #23897 (Fixed a check for mbfilter_ru.h). ([EMAIL PROTECTED], Ilia)
 - Fixed bug #23894 (sprintf() decimal specifiers problem). (Moriyoshi)
 - Fixed bug #23888 (Missing input validation for flags parameter). (Ilia)



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



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

2003-05-31 Thread Ilia Alshanetsky
iliaa   Fri May 30 20:32:45 2003 EDT

  Modified files:  
/php4/ext/standard  file.c 
  Log:
  Fixed bug #23913 (make rename() work across partitions on *nix)
  
  
Index: php4/ext/standard/file.c
diff -u php4/ext/standard/file.c:1.343 php4/ext/standard/file.c:1.344
--- php4/ext/standard/file.c:1.343  Wed May 21 17:36:51 2003
+++ php4/ext/standard/file.cFri May 30 20:32:45 2003
@@ -21,7 +21,7 @@
+--+
  */
 
-/* $Id: file.c,v 1.343 2003/05/21 21:36:51 pollita Exp $ */
+/* $Id: file.c,v 1.344 2003/05/31 00:32:45 iliaa Exp $ */
 
 /* Synced with php 3.0 revision 1.218 1999-06-16 [ssb] */
 
@@ -1391,6 +1391,14 @@
ret = VCWD_RENAME(old_name, new_name);
 
if (ret == -1) {
+#ifdef EXDEV
+   if (errno == EXDEV) {
+   if (php_copy_file(old_name, new_name TSRMLS_CC) == SUCCESS) {
+   VCWD_UNLINK(old_name);
+   RETURN_TRUE;
+   }
+   }
+#endif 
php_error_docref2(NULL TSRMLS_CC, old_name, new_name, E_WARNING, %s, 
strerror(errno));
RETURN_FALSE;
}



-- 
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-05-31 Thread Ilia Alshanetsky
iliaa   Fri May 30 20:34:14 2003 EDT

  Modified files:  (Branch: PHP_4_3)
/php4   NEWS 
  Log:
  Bug fixing news.
  
  
Index: php4/NEWS
diff -u php4/NEWS:1.1247.2.227 php4/NEWS:1.1247.2.228
--- php4/NEWS:1.1247.2.227  Fri May 30 17:40:13 2003
+++ php4/NEWS   Fri May 30 20:34:14 2003
@@ -16,6 +16,7 @@
 - Added a DEBUG note to 'php -v' output when --enable-debug is used. (Derick)
 - Fixed ext/yaz to not log unless yaz.log_file is set. (Adam Dickmeiss)
 - Fixed ext/exif to honor magic_quotes_runtime php.ini option. (Marcus)
+- Fixed bug #23913 (make rename() work across partitions on *nix) (Ilia)
 - Fixed bug #23898 (Proper handling of NULLs in odbc_result, odbc_fetch_into
   and odbc_result_all). (Ilia)
 - Fixed bug #23897 (Fixed a check for mbfilter_ru.h). ([EMAIL PROTECTED], Ilia)



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



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

2003-06-03 Thread Ilia Alshanetsky
iliaa   Mon Jun  2 20:06:01 2003 EDT

  Modified files:  
/php4/ext/standard  css.c 
  Log:
  Fixed bug #23912 (Invalid CSS in phpinfo() output)
  
  
Index: php4/ext/standard/css.c
diff -u php4/ext/standard/css.c:1.9 php4/ext/standard/css.c:1.10
--- php4/ext/standard/css.c:1.9 Mon Apr 21 23:21:29 2003
+++ php4/ext/standard/css.c Mon Jun  2 20:06:01 2003
@@ -16,7 +16,7 @@
+--+
 */
 
-/* $Id: css.c,v 1.9 2003/04/22 03:21:29 sas Exp $ */
+/* $Id: css.c,v 1.10 2003/06/03 00:06:01 iliaa Exp $ */
 
 #include php.h
 #include info.h
@@ -29,23 +29,22 @@
PUTS(body {background-color: #ff; color: #00;}\n);
PUTS(body, td, th, h1, h2 {font-family: sans-serif;}\n);
PUTS(pre {margin: 0px; font-family: monospace;}\n);
-   PUTS(a:link {color: #99; text-decoration: none;}\n);
+   PUTS(a:link {color: #99; text-decoration: none; background-color: 
#ff;}\n);
PUTS(a:hover {text-decoration: underline;}\n);
PUTS(table {border-collapse: collapse;}\n);
PUTS(.center {text-align: center;}\n);
PUTS(.center table { margin-left: auto; margin-right: auto; text-align: 
left;}\n);
-   PUTS(.center th { text-align: center; !important }\n);
+   PUTS(.center th { text-align: center !important; }\n);
PUTS(td, th { border: 1px solid #00; font-size: 75%; vertical-align: 
baseline;}\n);
PUTS(h1 {font-size: 150%;}\n);
PUTS(h2 {font-size: 125%;}\n);
PUTS(.p {text-align: left;}\n);
-   PUTS(.e {background-color: #ff; font-weight: bold;}\n);
-   PUTS(.h {background-color: #cc; font-weight: bold;}\n);
-   PUTS(.v {background-color: #cc;}\n);
-   PUTS(.vr {background-color: #cc; text-align: right;}\n);
-   PUTS(i {color: #66;}\n);
+   PUTS(.e {background-color: #ff; font-weight: bold; color: #00;}\n);
+   PUTS(.h {background-color: #cc; font-weight: bold; color: #00;}\n);
+   PUTS(.v {background-color: #cc; color: #00;}\n);
+   PUTS(.vr {background-color: #cc; text-align: right; color: #00;}\n);
PUTS(img {float: right; border: 0px;}\n);
-   PUTS(hr {width: 600px; align: center; background-color: #cc; border: 0px; 
height: 1px;}\n);
+   PUTS(hr {width: 600px; background-color: #cc; border: 0px; height: 1px; 
color: #00;}\n);
 }
 /* }}} */
 



-- 
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/standard css.c

2003-06-03 Thread Ilia Alshanetsky
iliaa   Mon Jun  2 20:06:14 2003 EDT

  Modified files:  (Branch: PHP_4_3)
/php4/ext/standard  css.c 
  Log:
  MFH: Fixed bug #23912 (Invalid CSS in phpinfo() output)
  
  
Index: php4/ext/standard/css.c
diff -u php4/ext/standard/css.c:1.6.2.1 php4/ext/standard/css.c:1.6.2.2
--- php4/ext/standard/css.c:1.6.2.1 Tue Dec 31 11:35:25 2002
+++ php4/ext/standard/css.c Mon Jun  2 20:06:14 2003
@@ -16,7 +16,7 @@
+--+
 */
 
-/* $Id: css.c,v 1.6.2.1 2002/12/31 16:35:25 sebastian Exp $ */
+/* $Id: css.c,v 1.6.2.2 2003/06/03 00:06:14 iliaa Exp $ */
 
 #include php.h
 #include info.h
@@ -31,22 +31,22 @@
PUTS(body {background-color: #ff; color: #00;}\n);
PUTS(body, td, th, h1, h2 {font-family: sans-serif;}\n);
PUTS(pre {margin: 0px; font-family: monospace;}\n);
-   PUTS(a:link {color: #99; text-decoration: none;}\n);
+   PUTS(a:link {color: #99; text-decoration: none; background-color: 
#ff;}\n);
PUTS(a:hover {text-decoration: underline;}\n);
PUTS(table {border-collapse: collapse;}\n);
PUTS(.center {text-align: center;}\n);
PUTS(.center table { margin-left: auto; margin-right: auto; text-align: 
left;}\n);
-   PUTS(.center th { text-align: center; !important }\n);
+   PUTS(.center th { text-align: center !important; }\n);
PUTS(td, th { border: 1px solid #00; font-size: 75%; vertical-align: 
baseline;}\n);
PUTS(h1 {font-size: 150%;}\n);
PUTS(h2 {font-size: 125%;}\n);
PUTS(.p {text-align: left;}\n);
-   PUTS(.e {background-color: #ff; font-weight: bold;}\n);
-   PUTS(.h {background-color: #cc; font-weight: bold;}\n);
-   PUTS(.v {background-color: #cc;}\n);
-   PUTS(i {color: #66;}\n);
+   PUTS(.e {background-color: #ff; font-weight: bold; color: #00;}\n);
+   PUTS(.h {background-color: #cc; font-weight: bold; color: #00;}\n);
+   PUTS(.v {background-color: #cc; color: #00;}\n);
+   PUTS(i {color: #66; background-color: #cc;}\n);
PUTS(img {float: right; border: 0px;}\n);
-   PUTS(hr {width: 600px; align: center; background-color: #cc; border: 0px; 
height: 1px;}\n);
+   PUTS(hr {width: 600px; background-color: #cc; border: 0px; height: 1px; 
color: #00;}\n);
 }
 /* }}} */
 



-- 
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-06-03 Thread Ilia Alshanetsky
iliaa   Mon Jun  2 20:07:20 2003 EDT

  Modified files:  (Branch: PHP_4_3)
/php4   NEWS 
  Log:
  Bug fixing news.
  
  
Index: php4/NEWS
diff -u php4/NEWS:1.1247.2.233 php4/NEWS:1.1247.2.234
--- php4/NEWS:1.1247.2.233  Sat May 31 13:37:55 2003
+++ php4/NEWS   Mon Jun  2 20:07:20 2003
@@ -17,7 +17,8 @@
 - Added long options into CLI  CGI (e.g. --version). (Marcus)
 - Fixed ext/yaz to not log unless yaz.log_file is set. (Adam Dickmeiss)
 - Fixed ext/exif to honor magic_quotes_runtime php.ini option. (Marcus)
-- Fixed bug #23913 (make rename() work across partitions on *nix) (Ilia)
+- Fixed bug #23913 (make rename() work across partitions on *nix). (Ilia)
+- Fixed bug #23912 (Invalid CSS in phpinfo() output). (Ilia)
 - Fixed bug #23898 (Proper handling of NULLs in odbc_result, odbc_fetch_into
   and odbc_result_all). (Ilia)
 - Fixed bug #23897 (Fixed a check for mbfilter_ru.h). ([EMAIL PROTECTED], Ilia)



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



[PHP-CVS] cvs: php4 /ext/gd/libgd gd_gd2.c gd_jpeg.c

2003-06-04 Thread Ilia Alshanetsky
iliaa   Tue Jun  3 19:23:22 2003 EDT

  Modified files:  
/php4/ext/gd/libgd  gd_gd2.c gd_jpeg.c 
  Log:
  Integer overflow checks.
  
  
Index: php4/ext/gd/libgd/gd_gd2.c
diff -u php4/ext/gd/libgd/gd_gd2.c:1.12 php4/ext/gd/libgd/gd_gd2.c:1.13
--- php4/ext/gd/libgd/gd_gd2.c:1.12 Sat Apr  5 12:23:55 2003
+++ php4/ext/gd/libgd/gd_gd2.c  Tue Jun  3 19:23:21 2003
@@ -139,6 +139,9 @@
nc = (*ncx) * (*ncy);
GD2_DBG(php_gd_error(Reading %d chunk index entries\n, nc));
sidx = sizeof(t_chunk_info) * nc;
+   if (sidx = 0) {
+   goto fail1;
+   }
cidx = gdCalloc(sidx, 1);
for (i = 0; i  nc; i++) {
if (gdGetInt(cidx[i].offset, in) != 1) {
@@ -272,6 +275,9 @@
 
/* Allocate buffers */
chunkMax = cs * bytesPerPixel * cs;
+   if (chunkMax = 0) {
+   return 0;
+   }
chunkBuf = gdCalloc(chunkMax, 1);
compBuf = gdCalloc(compMax, 1);

@@ -447,6 +453,10 @@
} else {
chunkMax = cs * cs;
}
+   if (chunkMax = 0) {
+   goto fail2;
+   }
+   
chunkBuf = gdCalloc(chunkMax, 1);
compBuf = gdCalloc(compMax, 1);
}
@@ -659,7 +669,11 @@
compMax = (int)(cs * bytesPerPixel * cs * 1.02f) + 12;
 
/* Allocate the buffers.  */
-   chunkData = gdCalloc(cs * bytesPerPixel * cs, 1);
+   chunkData = safe_emalloc(cs * bytesPerPixel, cs, 0);
+   memset(chunkData, 0, cs * bytesPerPixel * cs);
+   if (compMax = 0) {
+   goto fail;  
+   }
compData = gdCalloc(compMax, 1);
 
/* Save the file position of chunk index, and allocate enough space for
@@ -670,7 +684,8 @@
GD2_DBG(php_gd_error(Index size is %d\n, idxSize));
gdSeek(out, idxPos + idxSize);
 
-   chunkIdx = gdCalloc(idxSize * sizeof(t_chunk_info), 1);
+   chunkIdx = safe_emalloc(idxSize, sizeof(t_chunk_info), 0);
+   memset(chunkIdx, 0, idxSize * sizeof(t_chunk_info));
}
 
_gdPutColors (im, out);
@@ -754,7 +769,7 @@
}
gdSeek(out, posSave);
}
-
+fail:
GD2_DBG(php_gd_error(Freeing memory\n));
if (chunkData) {
gdFree(chunkData);
Index: php4/ext/gd/libgd/gd_jpeg.c
diff -u php4/ext/gd/libgd/gd_jpeg.c:1.12 php4/ext/gd/libgd/gd_jpeg.c:1.13
--- php4/ext/gd/libgd/gd_jpeg.c:1.12Tue Apr  8 03:36:58 2003
+++ php4/ext/gd/libgd/gd_jpeg.c Tue Jun  3 19:23:21 2003
@@ -144,7 +144,8 @@
 
jpeg_gdIOCtx_dest (cinfo, outfile);
 
-   row = (JSAMPROW) gdCalloc (1, cinfo.image_width * cinfo.input_components * 
sizeof (JSAMPLE));
+   row = (JSAMPROW) safe_emalloc(cinfo.image_width * cinfo.input_components, 
sizeof(JSAMPLE), 0);
+   memset(row, 0, cinfo.image_width * cinfo.input_components * sizeof(JSAMPLE));
rowptr[0] = row;
 
jpeg_start_compress (cinfo, TRUE);
@@ -310,7 +311,8 @@
goto error;
 #endif /* BITS_IN_JSAMPLE == 12 */
 
-   row = gdCalloc (cinfo.output_width * 3, sizeof (JSAMPLE));
+   row = safe_emalloc(cinfo.output_width * 3, sizeof(JSAMPLE), 0);
+   memset(row, 0, cinfo.output_width * 3 * sizeof(JSAMPLE));
rowptr[0] = row;
 
for (i = 0; i  cinfo.output_height; i++) {



-- 
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/gd/libgd gd_gd2.c gd_jpeg.c

2003-06-04 Thread Ilia Alshanetsky
iliaa   Tue Jun  3 19:23:25 2003 EDT

  Modified files:  (Branch: PHP_4_3)
/php4/ext/gd/libgd  gd_gd2.c gd_jpeg.c 
  Log:
  MFH: Integer overflow checks.
  
  
Index: php4/ext/gd/libgd/gd_gd2.c
diff -u php4/ext/gd/libgd/gd_gd2.c:1.4.2.3 php4/ext/gd/libgd/gd_gd2.c:1.4.2.4
--- php4/ext/gd/libgd/gd_gd2.c:1.4.2.3  Sat Apr  5 12:24:15 2003
+++ php4/ext/gd/libgd/gd_gd2.c  Tue Jun  3 19:23:25 2003
@@ -140,6 +140,9 @@
nc = (*ncx) * (*ncy);
GD2_DBG(php_gd_error(Reading %d chunk index entries\n, nc));
sidx = sizeof(t_chunk_info) * nc;
+   if (sidx = 0) {
+   goto fail1;
+   }
cidx = gdCalloc(sidx, 1);
for (i = 0; i  nc; i++) {
if (gdGetInt(cidx[i].offset, in) != 1) {
@@ -273,6 +276,9 @@
 
/* Allocate buffers */
chunkMax = cs * bytesPerPixel * cs;
+   if (chunkMax = 0) {
+   return 0;
+   }
chunkBuf = gdCalloc(chunkMax, 1);
compBuf = gdCalloc(compMax, 1);

@@ -448,6 +454,10 @@
} else {
chunkMax = cs * cs;
}
+   if (chunkMax = 0) {
+   goto fail2;
+   }
+   
chunkBuf = gdCalloc(chunkMax, 1);
compBuf = gdCalloc(compMax, 1);
}
@@ -660,7 +670,11 @@
compMax = (int)(cs * bytesPerPixel * cs * 1.02f) + 12;
 
/* Allocate the buffers.  */
-   chunkData = gdCalloc(cs * bytesPerPixel * cs, 1);
+   chunkData = safe_emalloc(cs * bytesPerPixel, cs, 0);
+   memset(chunkData, 0, cs * bytesPerPixel * cs);
+   if (compMax = 0) {
+   goto fail;  
+   }
compData = gdCalloc(compMax, 1);
 
/* Save the file position of chunk index, and allocate enough space for
@@ -671,7 +685,8 @@
GD2_DBG(php_gd_error(Index size is %d\n, idxSize));
gdSeek(out, idxPos + idxSize);
 
-   chunkIdx = gdCalloc(idxSize * sizeof(t_chunk_info), 1);
+   chunkIdx = safe_emalloc(idxSize, sizeof(t_chunk_info), 0);
+   memset(chunkIdx, 0, idxSize * sizeof(t_chunk_info));
}
 
_gdPutColors (im, out);
@@ -755,7 +770,7 @@
}
gdSeek(out, posSave);
}
-
+fail:
GD2_DBG(php_gd_error(Freeing memory\n));
if (chunkData) {
gdFree(chunkData);
Index: php4/ext/gd/libgd/gd_jpeg.c
diff -u php4/ext/gd/libgd/gd_jpeg.c:1.4.2.3 php4/ext/gd/libgd/gd_jpeg.c:1.4.2.4
--- php4/ext/gd/libgd/gd_jpeg.c:1.4.2.3 Wed Apr  9 22:11:20 2003
+++ php4/ext/gd/libgd/gd_jpeg.c Tue Jun  3 19:23:25 2003
@@ -144,7 +144,8 @@
 
jpeg_gdIOCtx_dest (cinfo, outfile);
 
-   row = (JSAMPROW) gdCalloc (1, cinfo.image_width * cinfo.input_components * 
sizeof (JSAMPLE));
+   row = (JSAMPROW) safe_emalloc(cinfo.image_width * cinfo.input_components, 
sizeof(JSAMPLE), 0);
+   memset(row, 0, cinfo.image_width * cinfo.input_components * sizeof(JSAMPLE));
rowptr[0] = row;
 
jpeg_start_compress (cinfo, TRUE);
@@ -310,7 +311,8 @@
goto error;
 #endif /* BITS_IN_JSAMPLE == 12 */
 
-   row = gdCalloc (cinfo.output_width * 3, sizeof (JSAMPLE));
+   row = safe_emalloc(cinfo.output_width * 3, sizeof(JSAMPLE), 0);
+   memset(row, 0, cinfo.output_width * 3 * sizeof(JSAMPLE));
rowptr[0] = row;
 
for (i = 0; i  cinfo.output_height; i++) {



-- 
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/gd gd.c /ext/gd/libgd gd.c gdft.c

2003-06-04 Thread Ilia Alshanetsky
iliaa   Tue Jun  3 19:55:15 2003 EDT

  Modified files:  (Branch: PHP_4_3)
/php4/ext/gdgd.c 
/php4/ext/gd/libgd  gd.c gdft.c 
  Log:
  MFH (Syncronize bunbled GD with gd 2.0.14)
  
  
Index: php4/ext/gd/gd.c
diff -u php4/ext/gd/gd.c:1.221.2.27 php4/ext/gd/gd.c:1.221.2.28
--- php4/ext/gd/gd.c:1.221.2.27 Wed May 14 22:25:59 2003
+++ php4/ext/gd/gd.cTue Jun  3 19:55:14 2003
@@ -18,7 +18,7 @@
+--+
  */
 
-/* $Id: gd.c,v 1.221.2.27 2003/05/15 02:25:59 iliaa Exp $ */
+/* $Id: gd.c,v 1.221.2.28 2003/06/03 23:55:14 iliaa Exp $ */
 
 /* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center, 
Cold Spring Harbor Labs. */
@@ -386,7 +386,7 @@
 /* }}} */
 
 #if HAVE_GD_BUNDLED
-#define PHP_GD_VERSION_STRING bundled (2.0.12 compatible)
+#define PHP_GD_VERSION_STRING bundled (2.0.14 compatible)
 #elif HAVE_LIBGD20
 #define PHP_GD_VERSION_STRING 2.0 or higher
 #elif HAVE_GDIMAGECOLORRESOLVE
Index: php4/ext/gd/libgd/gd.c
diff -u php4/ext/gd/libgd/gd.c:1.24.2.9 php4/ext/gd/libgd/gd.c:1.24.2.10
--- php4/ext/gd/libgd/gd.c:1.24.2.9 Thu Apr 24 20:59:03 2003
+++ php4/ext/gd/libgd/gd.c  Tue Jun  3 19:55:15 2003
@@ -873,6 +873,11 @@
float p_dist, p_alpha;
unsigned char opacity;
 
+   /* 2.0.13: bounds check! AA_opacity is just as capable of overflowing as the 
main pixel array. Arne Jorgensen. */
+   if (!gdImageBoundsSafeMacro(im, px, py)) {
+   return;
+   }
+
/* 
 * Find the perpendicular distance from point C (px, py) to the line 
 * segment AB that is being drawn.  (Adapted from an algorithm from the
@@ -2060,12 +2065,8 @@
tox++;
continue;
}
-   /* 
-* If it's the same image, mapping is NOT trivial since we 
-* merge with greyscale target, but if pct is 100, the grey 
-* value is not used, so it becomes trivial. pjw 2.0.12. 
-*/
-   if (dst == src  pct == 100) {
+   /* If it's the same image, mapping is trivial */
+   if (dst == src) {
nc = c;
} else {
dc = gdImageGetPixel(dst, tox, toy);
@@ -2105,8 +2106,12 @@
tox++;
continue;
}
-   /* If it's the same image, mapping is trivial */
-   if (dst == src) {
+   /* 
+* If it's the same image, mapping is NOT trivial since we 
+* merge with greyscale target, but if pct is 100, the grey 
+* value is not used, so it becomes trivial. pjw 2.0.12. 
+*/
+   if (dst == src  pct == 100) {
nc = c;
} else {
dc = gdImageGetPixel(dst, tox, toy);
Index: php4/ext/gd/libgd/gdft.c
diff -u php4/ext/gd/libgd/gdft.c:1.11.2.8 php4/ext/gd/libgd/gdft.c:1.11.2.9
--- php4/ext/gd/libgd/gdft.c:1.11.2.8   Wed Apr 30 12:23:59 2003
+++ php4/ext/gd/libgd/gdft.cTue Jun  3 19:55:15 2003
@@ -790,7 +790,8 @@
char *tmpstr = NULL;
int render = (im  (im-trueColor || (fg = 255  fg = -255)));
FT_BitmapGlyph bm;
-   int render_mode = FT_LOAD_RENDER | FT_LOAD_FORCE_AUTOHINT;
+   /* 2.0.13: Bob Ostermann: don't force autohint, that's just for testing 
freetype and doesn't look as good */
+   int render_mode = FT_LOAD_DEFAULT;
int m, mfound;
/* Now tuneable thanks to Wez Furlong */
double linespace = LINESPACE;
@@ -909,6 +910,8 @@
}
/* newlines */
if (ch == '\n') {
+   /* 2.0.13: reset penf.x. Christopher J. Grayce */
+   penf.x = 0;
  penf.y -= (long)(face-size-metrics.height * linespace);
  penf.y = (penf.y - 32)  -64; /* round to next pixel 
row */
  x1 = (int)(penf.x * cos_a - penf.y * sin_a + 32) / 64;



-- 
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 TODO_SEGFAULTS

2003-06-04 Thread Ilia Alshanetsky
iliaa   Tue Jun  3 19:57:59 2003 EDT

  Modified files:  (Branch: PHP_4_3)
/php4   TODO_SEGFAULTS NEWS 
  Log:
  GD stuff
  
  
Index: php4/TODO_SEGFAULTS
diff -u php4/TODO_SEGFAULTS:1.1.2.32 php4/TODO_SEGFAULTS:1.1.2.33
--- php4/TODO_SEGFAULTS:1.1.2.32Wed Apr 16 15:17:27 2003
+++ php4/TODO_SEGFAULTS Tue Jun  3 19:57:58 2003
@@ -15,6 +15,7 @@
 str_repeat (Ilia)
 imagecopyresized (Ilia)
 mhash_keygen_s2k (Ilia)
+bundled gd (Ilia)
 mb_ereg, mb_ereg_match, mb_eregi, mb_split (Moriyoshi)
 xml_parser_create (Moriyoshi)
 ob_start (Sascha)
@@ -31,9 +32,8 @@
 socket_select   (3)
 php_imagepolygon(4)
 imagesetstyle   (5)
-bundled gd  (6)
-php_base64_encode  (8)
-pack   (9)
+php_base64_encode  (6)
+pack   (7)

 (1) heap corruption, mostly visible in malloc-related calls.  Whether you see 
 this or not might depend on your libc/compiler.  Hard to track down,
@@ -83,26 +83,9 @@
 gdImageSetStyle function called by this php wrapper can die for the
 same reason.  
 
-(6) multiple integer overflows that can occur when trying to allocate a buffer
-for a new image. Affected functions:
-gdImageCreateFromJpegCtx
-readwbmp
-gdImageCreateFromXpm
-gdImageCreateFromPngCtx
-gdImagePngCtx
-gdImageCreateFromJpegCtx
-gdImageJpegCtx
-gdImageCreateFromGd2Ctx
-gdImageCreateFromGd2PartCtx
-_gdImageGd2
-GetDataBlock (gd_gif_in.c)
+(6) integer overflow if the specified string is longer then ~1.1 billion bytes.
 
-(7) few possible integer overflows, once safe_emalloc() or something similar
-is implemented they can all be addressed.
-
-(8) integer overflow if the specified string is longer then ~1.1 billion bytes.
-
-(9) multiple integer overflows, ex. pack(d4294967297, 2);
+(7) multiple integer overflows, ex. pack(d4294967297, 2);
 
 Ammendment 1.
 
Index: php4/NEWS
diff -u php4/NEWS:1.1247.2.235 php4/NEWS:1.1247.2.236
--- php4/NEWS:1.1247.2.235  Tue Jun  3 10:47:03 2003
+++ php4/NEWS   Tue Jun  3 19:57:58 2003
@@ -17,6 +17,8 @@
 - Added long options into CLI  CGI (e.g. --version). (Marcus)
 - Fixed ext/yaz to not log unless yaz.log_file is set. (Adam Dickmeiss)
 - Fixed ext/exif to honor magic_quotes_runtime php.ini option. (Marcus)
+- Synchronized bundled GD library with GD 2.0.14. (Ilia)
+- Added integer overflow checks to bundled GD library. (Ilia)
 - Fixed bug #23913 (make rename() work across partitions on *nix). (Ilia)
 - Fixed bug #23912 (Invalid CSS in phpinfo() output). (Ilia)
 - Fixed bug #23902 (NULL in CGI header output). (Shane)



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



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

2003-06-04 Thread Ilia Alshanetsky
iliaa   Tue Jun  3 20:20:19 2003 EDT

  Modified files:  
/php4/ext/gdgd.c 
/php4/ext/gd/libgd  gd.c 
  Log:
  GD 2.0.15 sync
  
  
Index: php4/ext/gd/gd.c
diff -u php4/ext/gd/gd.c:1.270 php4/ext/gd/gd.c:1.271
--- php4/ext/gd/gd.c:1.270  Tue Jun  3 19:54:55 2003
+++ php4/ext/gd/gd.cTue Jun  3 20:20:19 2003
@@ -18,7 +18,7 @@
+--+
  */
 
-/* $Id: gd.c,v 1.270 2003/06/03 23:54:55 iliaa Exp $ */
+/* $Id: gd.c,v 1.271 2003/06/04 00:20:19 iliaa Exp $ */
 
 /* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center,
Cold Spring Harbor Labs. */
@@ -440,7 +440,7 @@
 /* }}} */
 
 #if HAVE_GD_BUNDLED
-#define PHP_GD_VERSION_STRING bundled (2.0.14 compatible)
+#define PHP_GD_VERSION_STRING bundled (2.0.15 compatible)
 #elif HAVE_LIBGD20
 #define PHP_GD_VERSION_STRING 2.0 or higher
 #elif HAVE_GDIMAGECOLORRESOLVE
Index: php4/ext/gd/libgd/gd.c
diff -u php4/ext/gd/libgd/gd.c:1.51 php4/ext/gd/libgd/gd.c:1.52
--- php4/ext/gd/libgd/gd.c:1.51 Tue Jun  3 19:54:56 2003
+++ php4/ext/gd/libgd/gd.c  Tue Jun  3 20:20:19 2003
@@ -873,11 +873,6 @@
float p_dist, p_alpha;
unsigned char opacity;
 
-   /* 2.0.13: bounds check! AA_opacity is just as capable of overflowing as the 
main pixel array. Arne Jorgensen. */
-   if (!gdImageBoundsSafeMacro(im, px, py)) {
-   return;
-   }
-
/* 
 * Find the perpendicular distance from point C (px, py) to the line 
 * segment AB that is being drawn.  (Adapted from an algorithm from the
@@ -891,6 +886,15 @@
 
int Bx_Cx = im-AAL_x2 - px;
int By_Cy = im-AAL_y2 - py;
+
+   /* 2.0.13: bounds check! AA_opacity is just as capable of
+* overflowing as the main pixel array. Arne Jorgensen. 
+* 2.0.14: typo fixed. 2.0.15: moved down below declarations
+* to satisfy non-C++ compilers.
+*/
+   if (!gdImageBoundsSafeMacro(im, px, py)) {
+   return;
+   }
 
/* Get the squares of the lengths of the segemnts AC and BC. */
LAC_2 = (Ax_Cx * Ax_Cx) + (Ay_Cy * Ay_Cy);



-- 
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 /ext/gd gd.c /ext/gd/libgd gd.c

2003-06-04 Thread Ilia Alshanetsky
iliaa   Tue Jun  3 20:22:31 2003 EDT

  Modified files:  (Branch: PHP_4_3)
/php4   NEWS 
/php4/ext/gdgd.c 
/php4/ext/gd/libgd  gd.c 
  Log:
  MFH
  
  
Index: php4/NEWS
diff -u php4/NEWS:1.1247.2.236 php4/NEWS:1.1247.2.237
--- php4/NEWS:1.1247.2.236  Tue Jun  3 19:57:58 2003
+++ php4/NEWS   Tue Jun  3 20:22:30 2003
@@ -17,7 +17,7 @@
 - Added long options into CLI  CGI (e.g. --version). (Marcus)
 - Fixed ext/yaz to not log unless yaz.log_file is set. (Adam Dickmeiss)
 - Fixed ext/exif to honor magic_quotes_runtime php.ini option. (Marcus)
-- Synchronized bundled GD library with GD 2.0.14. (Ilia)
+- Synchronized bundled GD library with GD 2.0.15. (Ilia)
 - Added integer overflow checks to bundled GD library. (Ilia)
 - Fixed bug #23913 (make rename() work across partitions on *nix). (Ilia)
 - Fixed bug #23912 (Invalid CSS in phpinfo() output). (Ilia)
Index: php4/ext/gd/gd.c
diff -u php4/ext/gd/gd.c:1.221.2.28 php4/ext/gd/gd.c:1.221.2.29
--- php4/ext/gd/gd.c:1.221.2.28 Tue Jun  3 19:55:14 2003
+++ php4/ext/gd/gd.cTue Jun  3 20:22:30 2003
@@ -18,7 +18,7 @@
+--+
  */
 
-/* $Id: gd.c,v 1.221.2.28 2003/06/03 23:55:14 iliaa Exp $ */
+/* $Id: gd.c,v 1.221.2.29 2003/06/04 00:22:30 iliaa Exp $ */
 
 /* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center, 
Cold Spring Harbor Labs. */
@@ -386,7 +386,7 @@
 /* }}} */
 
 #if HAVE_GD_BUNDLED
-#define PHP_GD_VERSION_STRING bundled (2.0.14 compatible)
+#define PHP_GD_VERSION_STRING bundled (2.0.15 compatible)
 #elif HAVE_LIBGD20
 #define PHP_GD_VERSION_STRING 2.0 or higher
 #elif HAVE_GDIMAGECOLORRESOLVE
Index: php4/ext/gd/libgd/gd.c
diff -u php4/ext/gd/libgd/gd.c:1.24.2.10 php4/ext/gd/libgd/gd.c:1.24.2.11
--- php4/ext/gd/libgd/gd.c:1.24.2.10Tue Jun  3 19:55:15 2003
+++ php4/ext/gd/libgd/gd.c  Tue Jun  3 20:22:30 2003
@@ -873,11 +873,6 @@
float p_dist, p_alpha;
unsigned char opacity;
 
-   /* 2.0.13: bounds check! AA_opacity is just as capable of overflowing as the 
main pixel array. Arne Jorgensen. */
-   if (!gdImageBoundsSafeMacro(im, px, py)) {
-   return;
-   }
-
/* 
 * Find the perpendicular distance from point C (px, py) to the line 
 * segment AB that is being drawn.  (Adapted from an algorithm from the
@@ -891,6 +886,15 @@
 
int Bx_Cx = im-AAL_x2 - px;
int By_Cy = im-AAL_y2 - py;
+
+   /* 2.0.13: bounds check! AA_opacity is just as capable of
+* overflowing as the main pixel array. Arne Jorgensen. 
+* 2.0.14: typo fixed. 2.0.15: moved down below declarations
+* to satisfy non-C++ compilers.
+*/
+   if (!gdImageBoundsSafeMacro(im, px, py)) {
+   return;
+   }
 
/* Get the squares of the lengths of the segemnts AC and BC. */
LAC_2 = (Ax_Cx * Ax_Cx) + (Ay_Cy * Ay_Cy);



-- 
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/gd/libgd gd.c

2003-06-05 Thread Ilia Alshanetsky
iliaa   Wed Jun  4 10:58:33 2003 EDT

  Modified files:  (Branch: PHP_4_3)
/php4/ext/gd/libgd  gd.c 
  Log:
  MFH (dupe macro)
  
  
Index: php4/ext/gd/libgd/gd.c
diff -u php4/ext/gd/libgd/gd.c:1.24.2.12 php4/ext/gd/libgd/gd.c:1.24.2.13
--- php4/ext/gd/libgd/gd.c:1.24.2.12Wed Jun  4 01:30:45 2003
+++ php4/ext/gd/libgd/gd.c  Wed Jun  4 10:58:33 2003
@@ -7,9 +7,6 @@
 
 #include php.h
 
-/* 2.0.12: this now checks the clipping rectangle */
-#define gdImageBoundsSafeMacro(im, x, y) (!y)  (im)-cy1) || ((y)  (im)-cy2)) 
|| (((x)  (im)-cx1) || ((x)  (im)-cx2
-
 #ifdef _MSC_VER
 # if _MSC_VER = 1300
 /* in MSVC.NET the these are available but only for __cplusplus and not 
_MSC_EXTENSIONS */
@@ -895,7 +892,7 @@
 * 2.0.14: typo fixed. 2.0.15: moved down below declarations
 * to satisfy non-C++ compilers.
 */
-   if (!gdImageBoundsSafeMacro(im, px, py)) {
+   if (!gdImageBoundsSafe(im, px, py)) {
return;
}
 



-- 
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/openssl openssl.c

2003-06-08 Thread Ilia Alshanetsky
iliaa   Sun Jun  8 19:42:44 2003 EDT

  Modified files:  (Branch: PHP_4_3)
/php4/ext/openssl   openssl.c 
  Log:
  Fixed compile warnings.
  
  
Index: php4/ext/openssl/openssl.c
diff -u php4/ext/openssl/openssl.c:1.52.2.13 php4/ext/openssl/openssl.c:1.52.2.14
--- php4/ext/openssl/openssl.c:1.52.2.13Mon May  5 12:29:57 2003
+++ php4/ext/openssl/openssl.c  Sun Jun  8 19:42:44 2003
@@ -18,7 +18,7 @@
+--+
  */
 
-/* $Id: openssl.c,v 1.52.2.13 2003/05/05 16:29:57 wez Exp $ */
+/* $Id: openssl.c,v 1.52.2.14 2003/06/08 23:42:44 iliaa Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -1913,7 +1913,7 @@
bio_out = BIO_new_file(filename, w);
 
if (passphrase  req.priv_key_encrypt)
-   cipher = EVP_des_ede3_cbc();
+   cipher = (EVP_CIPHER *) EVP_des_ede3_cbc();
else
cipher = NULL;

@@ -1964,7 +1964,7 @@
bio_out = BIO_new(BIO_s_mem());
 
if (passphrase  req.priv_key_encrypt)
-   cipher = EVP_des_ede3_cbc();
+   cipher = (EVP_CIPHER *) EVP_des_ede3_cbc();
else
cipher = NULL;

@@ -2224,7 +2224,7 @@
}
 
/* TODO: allow user to choose a different cipher */
-   cipher = EVP_rc2_40_cbc();
+   cipher = (EVP_CIPHER *) EVP_rc2_40_cbc();
if (cipher == NULL)
goto clean_exit;
 



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



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

2003-06-08 Thread Ilia Alshanetsky
iliaa   Sun Jun  8 19:52:28 2003 EDT

  Modified files:  
/php4/ext/openssl   openssl.c 
  Log:
  MFB
  
  
Index: php4/ext/openssl/openssl.c
diff -u php4/ext/openssl/openssl.c:1.74 php4/ext/openssl/openssl.c:1.75
--- php4/ext/openssl/openssl.c:1.74 Mon Apr 28 18:42:21 2003
+++ php4/ext/openssl/openssl.c  Sun Jun  8 19:52:28 2003
@@ -18,7 +18,7 @@
+--+
  */
 
-/* $Id: openssl.c,v 1.74 2003/04/28 22:42:21 iliaa Exp $ */
+/* $Id: openssl.c,v 1.75 2003/06/08 23:52:28 iliaa Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -1956,7 +1956,7 @@
bio_out = BIO_new_file(filename, w);
 
if (passphrase  req.priv_key_encrypt) {
-   cipher = EVP_des_ede3_cbc();
+   cipher = (EVP_CIPHER *) EVP_des_ede3_cbc();
} else {
cipher = NULL;
}
@@ -2007,7 +2007,7 @@
bio_out = BIO_new(BIO_s_mem());
 
if (passphrase  req.priv_key_encrypt) {
-   cipher = EVP_des_ede3_cbc();
+   cipher = (EVP_CIPHER *) EVP_des_ede3_cbc();
} else {
cipher = NULL;
}
@@ -2823,16 +2823,16 @@
 
switch (signature_algo) {
case OPENSSL_ALGO_SHA1:
-   mdtype = EVP_sha1();
+   mdtype = (EVP_MD *) EVP_sha1();
break;
case OPENSSL_ALGO_MD5:
-   mdtype = EVP_md5();
+   mdtype = (EVP_MD *) EVP_md5();
break;
case OPENSSL_ALGO_MD4:
-   mdtype = EVP_md4();
+   mdtype = (EVP_MD *) EVP_md4();
break;
case OPENSSL_ALGO_MD2:
-   mdtype = EVP_md2();
+   mdtype = (EVP_MD *) EVP_md2();
break;
}




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



[PHP-CVS] cvs: php4 / NEWS /ext/standard string.c /ext/standard/tests/strings bug24098.phpt

2003-06-09 Thread Ilia Alshanetsky
iliaa   Mon Jun  9 14:12:36 2003 EDT

  Added files: 
/php4/ext/standard/tests/stringsbug24098.phpt 

  Modified files:  
/php4   NEWS 
/php4/ext/standard  string.c 
  Log:
  Fixed bug #24098 (Crash in pathinfo() due to double var initialization).
  
  # This is a php5 specific bug, no MFB needed
  
  
Index: php4/NEWS
diff -u php4/NEWS:1.1420 php4/NEWS:1.1421
--- php4/NEWS:1.1420Fri May 30 17:19:56 2003
+++ php4/NEWS   Mon Jun  9 14:12:36 2003
@@ -100,6 +100,7 @@
 
 - Fixed is_executable() to be available also on Windows. (Shane)
 - Fixed dirname() and strip_tags() to be binary-safe. (Moriyoshi)
+- Fixed bug #24098 (crash in pathinfo()). (Ilia)
 - Fixed bug #21985 and #22064 (various mb_send_mail() issues). (Moriyoshi)
 - Fixed bug #21600 (Assign by reference function call changes variable 
   contents). (Zeev)
Index: php4/ext/standard/string.c
diff -u php4/ext/standard/string.c:1.387 php4/ext/standard/string.c:1.388
--- php4/ext/standard/string.c:1.387Mon May 26 20:42:39 2003
+++ php4/ext/standard/string.c  Mon Jun  9 14:12:36 2003
@@ -18,7 +18,7 @@
+--+
  */
 
-/* $Id: string.c,v 1.387 2003/05/27 00:42:39 msopacua Exp $ */
+/* $Id: string.c,v 1.388 2003/06/09 18:12:36 iliaa Exp $ */
 
 /* Synced with php 3.0 revision 1.193 1999-06-16 [ssb] */
 
@@ -1268,7 +1268,6 @@
if ((opt  PHP_PATHINFO_EXTENSION) == PHP_PATHINFO_EXTENSION) {
char *p;
int idx;
-   int ret_len;
int have_basename = ((opt  PHP_PATHINFO_BASENAME) == 
PHP_PATHINFO_BASENAME);
 
/* Have we alrady looked up the basename? */

Index: php4/ext/standard/tests/strings/bug24098.phpt
+++ php4/ext/standard/tests/strings/bug24098.phpt
--TEST--
Bug #24098 (pathinfo() crash)
--FILE--
?php
var_dump(pathinfo(/dsds.asa));
?
--EXPECT--
array(3) {
  [dirname]=
  string(1) /
  [basename]=
  string(8) dsds.asa
  [extension]=
  string(3) asa
}



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



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

2003-06-10 Thread Ilia Alshanetsky
iliaa   Tue Jun 10 22:16:19 2003 EDT

  Modified files:  
/php4/ext/standard  string.c 
  Log:
  fixed proto
  
  
Index: php4/ext/standard/string.c
diff -u php4/ext/standard/string.c:1.389 php4/ext/standard/string.c:1.390
--- php4/ext/standard/string.c:1.389Tue Jun 10 16:03:38 2003
+++ php4/ext/standard/string.c  Tue Jun 10 22:16:19 2003
@@ -18,7 +18,7 @@
+--+
  */
 
-/* $Id: string.c,v 1.389 2003/06/10 20:03:38 imajes Exp $ */
+/* $Id: string.c,v 1.390 2003/06/11 02:16:19 iliaa Exp $ */
 
 /* Synced with php 3.0 revision 1.193 1999-06-16 [ssb] */
 
@@ -4477,7 +4477,7 @@
 }
 /* }}} */
 
-/* {{{ proto void str_word_count(string str, [int format])
+/* {{{ proto mixed str_word_count(string str, [int format])
Counts the number of words inside a string. If format of 1 is specified,
then the function will return an array containing all the words
found inside the string. If format of 2 is specified, then the function



-- 
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/standard string.c

2003-06-10 Thread Ilia Alshanetsky
iliaa   Tue Jun 10 22:16:50 2003 EDT

  Modified files:  (Branch: PHP_4_3)
/php4/ext/standard  string.c 
  Log:
  MFH: proto fix
  
  
Index: php4/ext/standard/string.c
diff -u php4/ext/standard/string.c:1.333.2.29 php4/ext/standard/string.c:1.333.2.30
--- php4/ext/standard/string.c:1.333.2.29   Mon May 26 16:56:01 2003
+++ php4/ext/standard/string.c  Tue Jun 10 22:16:49 2003
@@ -18,7 +18,7 @@
+--+
  */
 
-/* $Id: string.c,v 1.333.2.29 2003/05/26 20:56:01 msopacua Exp $ */
+/* $Id: string.c,v 1.333.2.30 2003/06/11 02:16:49 iliaa Exp $ */
 
 /* Synced with php 3.0 revision 1.193 1999-06-16 [ssb] */
 
@@ -4024,7 +4024,7 @@
 }
 /* }}} */
 
-/* {{{ proto void str_word_count(string str, [int format])
+/* {{{ proto mixed str_word_count(string str, [int format])
Counts the number of words inside a string. If format of 1 is specified,
then the function will return an array containing all the words
found inside the string. If format of 2 is specified, then the function



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



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

2003-06-11 Thread Ilia Alshanetsky
iliaa   Wed Jun 11 21:47:12 2003 EDT

  Modified files:  
/php4/ext/pspellpspell.c 
  Log:
  Added missing safe_mode/open_basedir checks.
  
  
Index: php4/ext/pspell/pspell.c
diff -u php4/ext/pspell/pspell.c:1.33 php4/ext/pspell/pspell.c:1.34
--- php4/ext/pspell/pspell.c:1.33   Tue Jun 10 16:03:35 2003
+++ php4/ext/pspell/pspell.cWed Jun 11 21:47:12 2003
@@ -16,7 +16,7 @@
+--+
 */
 
-/* $Id: pspell.c,v 1.33 2003/06/10 20:03:35 imajes Exp $ */
+/* $Id: pspell.c,v 1.34 2003/06/12 01:47:12 iliaa Exp $ */
 
 #define IS_EXT_MODULE
 
@@ -206,6 +206,15 @@
config = new_pspell_config();
 
convert_to_string_ex(personal);
+
+   if (PG(safe_mode)  (!php_checkuid(Z_STRVAL_PP(personal), NULL, 
CHECKUID_CHECK_FILE_AND_DIR))) {
+   RETURN_FALSE;
+   }
+
+   if (php_check_open_basedir(Z_STRVAL_PP(personal) TSRMLS_CC)) {
+   RETURN_FALSE;
+   }
+
pspell_config_replace(config, personal, Z_STRVAL_PP(personal));
pspell_config_replace(config, save-repl, false);
 
@@ -737,6 +746,15 @@
}
 
convert_to_string_ex(personal);
+
+   if (PG(safe_mode)  (!php_checkuid(Z_STRVAL_PP(personal), NULL, 
CHECKUID_CHECK_FILE_AND_DIR))) {
+   RETURN_FALSE;
+   }
+
+   if (php_check_open_basedir(Z_STRVAL_PP(personal) TSRMLS_CC)) {
+   RETURN_FALSE;
+   }
+
pspell_config_replace(config, personal, Z_STRVAL_PP(personal));
 
RETURN_TRUE;
@@ -768,6 +786,15 @@
pspell_config_replace(config, save-repl, true);
 
convert_to_string_ex(repl);
+
+   if (PG(safe_mode)  (!php_checkuid(Z_STRVAL_PP(repl), NULL, 
CHECKUID_CHECK_FILE_AND_DIR))) {
+   RETURN_FALSE;
+   }
+
+   if (php_check_open_basedir(Z_STRVAL_PP(repl) TSRMLS_CC)) {
+   RETURN_FALSE;
+   }
+
pspell_config_replace(config, repl, Z_STRVAL_PP(repl));
 
RETURN_TRUE;



-- 
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/pspell pspell.c

2003-06-11 Thread Ilia Alshanetsky
iliaa   Wed Jun 11 21:47:29 2003 EDT

  Modified files:  (Branch: PHP_4_3)
/php4/ext/pspellpspell.c 
  Log:
  MFH: Added missing safe_mode/open_basedir checks.
  
  
Index: php4/ext/pspell/pspell.c
diff -u php4/ext/pspell/pspell.c:1.28.8.2 php4/ext/pspell/pspell.c:1.28.8.3
--- php4/ext/pspell/pspell.c:1.28.8.2   Wed May 21 19:08:27 2003
+++ php4/ext/pspell/pspell.cWed Jun 11 21:47:28 2003
@@ -16,7 +16,7 @@
+--+
 */
 
-/* $Id: pspell.c,v 1.28.8.2 2003/05/21 23:08:27 jay Exp $ */
+/* $Id: pspell.c,v 1.28.8.3 2003/06/12 01:47:28 iliaa Exp $ */
 
 #define IS_EXT_MODULE
 
@@ -206,6 +206,15 @@
config = new_pspell_config();
 
convert_to_string_ex(personal);
+
+   if (PG(safe_mode)  (!php_checkuid(Z_STRVAL_PP(personal), NULL, 
CHECKUID_CHECK_FILE_AND_DIR))) {
+   RETURN_FALSE;
+   }
+
+   if (php_check_open_basedir(Z_STRVAL_PP(personal) TSRMLS_CC)) {
+   RETURN_FALSE;
+   }
+
pspell_config_replace(config, personal, Z_STRVAL_PP(personal));
pspell_config_replace(config, save-repl, false);
 
@@ -737,6 +746,15 @@
}
 
convert_to_string_ex(personal);
+
+   if (PG(safe_mode)  (!php_checkuid(Z_STRVAL_PP(personal), NULL, 
CHECKUID_CHECK_FILE_AND_DIR))) {
+   RETURN_FALSE;
+   }
+
+   if (php_check_open_basedir(Z_STRVAL_PP(personal) TSRMLS_CC)) {
+   RETURN_FALSE;
+   }
+
pspell_config_replace(config, personal, Z_STRVAL_PP(personal));
 
RETURN_TRUE;
@@ -768,6 +786,15 @@
pspell_config_replace(config, save-repl, true);
 
convert_to_string_ex(repl);
+
+   if (PG(safe_mode)  (!php_checkuid(Z_STRVAL_PP(repl), NULL, 
CHECKUID_CHECK_FILE_AND_DIR))) {
+   RETURN_FALSE;
+   }
+
+   if (php_check_open_basedir(Z_STRVAL_PP(repl) TSRMLS_CC)) {
+   RETURN_FALSE;
+   }
+
pspell_config_replace(config, repl, Z_STRVAL_PP(repl));
 
RETURN_TRUE;



-- 
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 /ext/gd/libgd gd.c /ext/gd/tests bug24155.phpt

2003-06-12 Thread Ilia Alshanetsky
iliaa   Thu Jun 12 15:33:19 2003 EDT

  Added files: (Branch: PHP_4_3)
/php4/ext/gd/tests  bug24155.phpt 

  Modified files:  
/php4/ext/gd/libgd  gd.c 
/php4   NEWS 
  Log:
  MFH: Fixed bug #24155 (gdImageRotate270 incorrectly use x parameter for y axis)
  
  
Index: php4/ext/gd/libgd/gd.c
diff -u php4/ext/gd/libgd/gd.c:1.24.2.13 php4/ext/gd/libgd/gd.c:1.24.2.14
--- php4/ext/gd/libgd/gd.c:1.24.2.13Wed Jun  4 10:58:33 2003
+++ php4/ext/gd/libgd/gd.c  Thu Jun 12 15:33:19 2003
@@ -2613,7 +2613,7 @@
if (dst != NULL) {
gdImagePaletteCopy (dst, src);

-   for (uY = 0; uYsrc-sx; uY++) {
+   for (uY = 0; uYsrc-sy; uY++) {
for (uX = 0; uXsrc-sx; uX++) {
c = f (src, uX, uY);
gdImageSetPixel(dst, (dst-sx - uY - 1), uX, c);
Index: php4/NEWS
diff -u php4/NEWS:1.1247.2.249 php4/NEWS:1.1247.2.250
--- php4/NEWS:1.1247.2.249  Mon Jun  9 13:04:57 2003
+++ php4/NEWS   Thu Jun 12 15:33:19 2003
@@ -24,6 +24,8 @@
   (Adam Dickmeiss)
 - Fixed a bug in bundled libmysql (mysql bug #564). (Georg)
 - Fixed ext/exif to honor magic_quotes_runtime php.ini option. (Marcus)
+- Fixed bug #24155 (gdImageRotate270 incorrectly use x parameter for y axis).
+  ([EMAIL PROTECTED], Ilia)
 - Fixed bug #24060 (ncurses_del_panel() causes segfault). (Georg)
 - Fixed bug #24054 (Integer overflow failure with GCC/x86 for *=). (Sascha)
 - Fixed bug #23951 (constants in static initializers clobbered by inheritance).

Index: php4/ext/gd/tests/bug24155.phpt
+++ php4/ext/gd/tests/bug24155.phpt
--TEST--
Bug #24155 (gdImageRotate270 rotation problem).
--SKIPIF--
?php 
if (!extension_loaded('gd')) {  
die(skip gd extension not available\n);
}
if (!GD_BUNDLED) {
die('skip external GD libraries may fail');
}
?
--FILE--
?php
$dest = dirname(realpath(__FILE__)) . 'bug24155.png';
@unlink($dest);

$im = imagecreatetruecolor(30, 50);
imagefill($im, 0, 0, (16777215 - 255)); 
$im = imagerotate($im, 270, 255);
imagepng($im, $dest);

echo md5_file($dest) . \n;
@unlink($dest);
?
--EXPECT--
cc867fd65c30883463ce58d0341f0997



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



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

2003-06-12 Thread Ilia Alshanetsky
iliaa   Thu Jun 12 15:46:44 2003 EDT

  Modified files:  
/php4/ext/imap  php_imap.c 
  Log:
  Fixed bug #22505 (Allow imap_sort() and imap_search() to specify a charset)
  
  
Index: php4/ext/imap/php_imap.c
diff -u php4/ext/imap/php_imap.c:1.165 php4/ext/imap/php_imap.c:1.166
--- php4/ext/imap/php_imap.c:1.165  Tue Jun 10 16:03:30 2003
+++ php4/ext/imap/php_imap.cThu Jun 12 15:46:44 2003
@@ -26,7 +26,7 @@
| PHP 4.0 updates:  Zeev Suraski [EMAIL PROTECTED]   |
+--+
  */
-/* $Id: php_imap.c,v 1.165 2003/06/10 20:03:30 imajes Exp $ */
+/* $Id: php_imap.c,v 1.166 2003/06/12 19:46:44 iliaa Exp $ */
 
 #define IMAP41
 
@@ -2393,11 +2393,11 @@
 }
 /* }}} */
 
-/* {{{ proto array imap_sort(resource stream_id, int criteria, int reverse [, int 
options [, string search_criteria]])
+/* {{{ proto array imap_sort(resource stream_id, int criteria, int reverse [, int 
options [, string search_criteria [, string charset]]])
Sort an array of message headers, optionally including only messages that meet 
specified criteria. */
 PHP_FUNCTION(imap_sort)
 {
-   zval **streamind, **pgm, **rev, **flags, **criteria;
+   zval **streamind, **pgm, **rev, **flags, **criteria, **charset;
pils *imap_le_struct;
unsigned long *slst, *sl;
char *search_criteria;
@@ -2405,7 +2405,7 @@
SEARCHPGM *spg=NIL;
int myargc = ZEND_NUM_ARGS();

-   if (myargc  3 || myargc  5 || zend_get_parameters_ex(myargc, streamind, 
pgm, rev, flags, criteria) == FAILURE) {
+   if (myargc  3 || myargc  6 || zend_get_parameters_ex(myargc, streamind, 
pgm, rev, flags, criteria, charset) == FAILURE) {
ZEND_WRONG_PARAM_COUNT();
}
 
@@ -2420,10 +2420,13 @@
if (myargc = 4) {
convert_to_long_ex(flags);
}
-   if (myargc == 5) {
+   if (myargc = 5) {
search_criteria = estrndup(Z_STRVAL_PP(criteria), 
Z_STRLEN_PP(criteria));
spg = mail_criteria(search_criteria);
efree(search_criteria);
+   if (myargc == 6) {
+   convert_to_string_ex(charset);
+   }
} else {
spg = mail_newsearchpgm();
}
@@ -2433,7 +2436,7 @@
mypgm-function = (short) Z_LVAL_PP(pgm);
mypgm-next = NIL;

-   slst = mail_sort(imap_le_struct-imap_stream, NIL, spg, mypgm, myargc = 4 ? 
Z_LVAL_PP(flags) : NIL);
+   slst = mail_sort(imap_le_struct-imap_stream, (myargc == 6 ? 
Z_STRVAL_PP(charset) : NIL), spg, mypgm, (myargc = 4 ? Z_LVAL_PP(flags) : NIL));
 
if (spg) {
mail_free_searchpgm(spg);
@@ -3381,18 +3384,18 @@
 }
 /* }}} */
 
-/* {{{ proto array imap_search(resource stream_id, string criteria [, int options])
+/* {{{ proto array imap_search(resource stream_id, string criteria [, int options [, 
string charset]])
Return a list of messages matching the given criteria */
 PHP_FUNCTION(imap_search)
 {
-   zval **streamind, **criteria, **search_flags;
+   zval **streamind, **criteria, **search_flags, **charset;
pils *imap_le_struct;
long flags;
char *search_criteria;
MESSAGELIST *cur;
int argc = ZEND_NUM_ARGS();
 
-   if (argc  2 || argc  3 || zend_get_parameters_ex(argc, streamind, 
criteria, search_flags) == FAILURE) {
+   if (argc  2 || argc  4 || zend_get_parameters_ex(argc, streamind, 
criteria, search_flags, charset) == FAILURE) {
ZEND_WRONG_PARAM_COUNT();
}
 
@@ -3406,10 +3409,13 @@
} else {
convert_to_long_ex(search_flags);
flags = Z_LVAL_PP(search_flags);
+   if (argc == 4) {
+   convert_to_string_ex(charset);
+   }
}

IMAPG(imap_messages) = IMAPG(imap_messages_tail) = NIL;
-   mail_search_full(imap_le_struct-imap_stream, NIL, 
mail_criteria(search_criteria), flags);
+   mail_search_full(imap_le_struct-imap_stream, (argc == 4 ? 
Z_STRVAL_PP(charset) : NIL), mail_criteria(search_criteria), flags);
if (IMAPG(imap_messages) == NIL) {
efree(search_criteria);
RETURN_FALSE;



-- 
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/imap php_imap.c php_imap.h

2003-06-13 Thread Ilia Alshanetsky
iliaa   Fri Jun 13 10:45:36 2003 EDT

  Modified files:  (Branch: PHP_4_3)
/php4/ext/imap  php_imap.c php_imap.h 
  Log:
  MFH:
Fixed bug #24161 (No timeout value for imap functions)
Fixed bug #22505 (Allow imap_sort() and imap_search() to specify a charset)
  
  
Index: php4/ext/imap/php_imap.c
diff -u php4/ext/imap/php_imap.c:1.142.2.13 php4/ext/imap/php_imap.c:1.142.2.14
--- php4/ext/imap/php_imap.c:1.142.2.13 Tue Apr 15 20:58:53 2003
+++ php4/ext/imap/php_imap.cFri Jun 13 10:45:36 2003
@@ -26,7 +26,7 @@
| PHP 4.0 updates:  Zeev Suraski [EMAIL PROTECTED]   |
+--+
  */
-/* $Id: php_imap.c,v 1.142.2.13 2003/04/16 00:58:53 iliaa Exp $ */
+/* $Id: php_imap.c,v 1.142.2.14 2003/06/13 14:45:36 iliaa Exp $ */
 
 #define IMAP41
 
@@ -38,6 +38,7 @@
 #include php_ini.h
 #include ext/standard/php_string.h
 #include ext/standard/info.h
+#include ext/standard/file.h
 
 #ifdef ERROR
 #undef ERROR
@@ -130,6 +131,7 @@
PHP_FE(imap_utf7_encode,NULL)
PHP_FE(imap_mime_header_decode, NULL)
PHP_FE(imap_thread,
 NULL)
+   PHP_FE(imap_timeout,   
 NULL)
 
 #if defined(HAVE_IMAP2000) || defined(HAVE_IMAP2001)
PHP_FE(imap_get_quota,  NULL)
@@ -336,6 +338,7 @@
  * Called via the mail_parameter function in c-client:src/c-client/mail.c
  * Author DRK
  */
+
 void mail_getquota(MAILSTREAM *stream, char *qroot, QUOTALIST *qlist)
 {
zval *t_map;
@@ -436,6 +439,17 @@
/* lets allow NIL */
REGISTER_LONG_CONSTANT(NIL, NIL, CONST_PERSISTENT | CONST_CS);
 
+   /* set default timeout values */
+   mail_parameters(NIL, SET_OPENTIMEOUT, (void *) FG(default_socket_timeout));
+   mail_parameters(NIL, SET_READTIMEOUT, (void *) FG(default_socket_timeout));
+   mail_parameters(NIL, SET_WRITETIMEOUT, (void *) FG(default_socket_timeout));
+   mail_parameters(NIL, SET_CLOSETIMEOUT, (void *) FG(default_socket_timeout));
+
+   /* timeout constants */
+   REGISTER_LONG_CONSTANT(IMAP_OPENTIMEOUT, 1, CONST_PERSISTENT | CONST_CS);
+   REGISTER_LONG_CONSTANT(IMAP_READTIMEOUT, 2, CONST_PERSISTENT | CONST_CS);
+   REGISTER_LONG_CONSTANT(IMAP_WRITETIMEOUT, 3, CONST_PERSISTENT | CONST_CS);
+   REGISTER_LONG_CONSTANT(IMAP_CLOSETIMEOUT, 4, CONST_PERSISTENT | CONST_CS);
 
/* Open Options */
 
@@ -703,7 +717,7 @@
 
IMAPG(imap_user) = estrndup(Z_STRVAL_PP(user), Z_STRLEN_PP(user));
IMAPG(imap_password) = estrndup(Z_STRVAL_PP(passwd), Z_STRLEN_PP(passwd));
-   
+
imap_stream = mail_open(NIL, Z_STRVAL_PP(mailbox), flags);
 
if (imap_stream == NIL) {
@@ -2359,11 +2373,11 @@
 }
 /* }}} */
 
-/* {{{ proto array imap_sort(resource stream_id, int criteria, int reverse [, int 
options [, string search_criteria]])
+/* {{{ proto array imap_sort(resource stream_id, int criteria, int reverse [, int 
options [, string search_criteria [, string charset]]])
Sort an array of message headers, optionally including only messages that meet 
specified criteria. */
 PHP_FUNCTION(imap_sort)
 {
-   zval **streamind, **pgm, **rev, **flags, **criteria;
+   zval **streamind, **pgm, **rev, **flags, **criteria, **charset;
pils *imap_le_struct;
unsigned long *slst, *sl;
char *search_criteria;
@@ -2371,7 +2385,7 @@
SEARCHPGM *spg=NIL;
int myargc = ZEND_NUM_ARGS();

-   if (myargc  3 || myargc  5 || zend_get_parameters_ex(myargc, streamind, 
pgm, rev, flags, criteria) == FAILURE) {
+   if (myargc  3 || myargc  6 || zend_get_parameters_ex(myargc, streamind, 
pgm, rev, flags, criteria, charset) == FAILURE) {
ZEND_WRONG_PARAM_COUNT();
}
 
@@ -2386,10 +2400,13 @@
if (myargc = 4) {
convert_to_long_ex(flags);
}
-   if (myargc == 5) {
+   if (myargc = 5) {
search_criteria = estrndup(Z_STRVAL_PP(criteria), 
Z_STRLEN_PP(criteria));
spg = mail_criteria(search_criteria);
efree(search_criteria);
+   if (myargc == 6) {
+   convert_to_string_ex(charset);
+   }
} else {
spg = mail_newsearchpgm();
}
@@ -2399,7 +2416,7 @@
mypgm-function = (short) Z_LVAL_PP(pgm);
mypgm-next = NIL;

-   slst = mail_sort(imap_le_struct-imap_stream, NIL, spg, mypgm, myargc = 4 ? 
Z_LVAL_PP(flags) : NIL);
+   slst = mail_sort(imap_le_struct-imap_stream, (myargc == 6 ? 
Z_STRVAL_PP(charset) : NIL), spg, mypgm, (myargc = 4 ? Z_LVAL_PP(flags) : NIL));
 
if (spg) {
mail_free_searchpgm(spg);
@@ -3351,18 

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

2003-06-13 Thread Ilia Alshanetsky
iliaa   Fri Jun 13 10:47:11 2003 EDT

  Modified files:  (Branch: PHP_4_3)
/php4   NEWS 
  Log:
  Bug fixing news.
  
  
Index: php4/NEWS
diff -u php4/NEWS:1.1247.2.250 php4/NEWS:1.1247.2.251
--- php4/NEWS:1.1247.2.250  Thu Jun 12 15:33:19 2003
+++ php4/NEWS   Fri Jun 13 10:47:11 2003
@@ -24,6 +24,7 @@
   (Adam Dickmeiss)
 - Fixed a bug in bundled libmysql (mysql bug #564). (Georg)
 - Fixed ext/exif to honor magic_quotes_runtime php.ini option. (Marcus)
+- Fixed bug #24161 (No timeout value for imap functions). (Ilia)
 - Fixed bug #24155 (gdImageRotate270 incorrectly use x parameter for y axis).
   ([EMAIL PROTECTED], Ilia)
 - Fixed bug #24060 (ncurses_del_panel() causes segfault). (Georg)
@@ -45,6 +46,8 @@
 - Fixed bug #23733 (Coredump on startup with Oracle 9+). (Edin)
 - Fixed bug #23285 (Potential Stack overflow in zendlex). (Wez)
 - Fixed bug #23038, #23574 (aggregate() related leaks and crashes). (Andrei)
+- Fixed bug #22505 (Allow imap_sort() and imap_search() to specify a charset).
+  (Ilia)
 
 29 May 2003, Version 4.3.2
 - Syncronized bundled GD library with GD 2.0.12. (Ilia)



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



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

2003-06-13 Thread Ilia Alshanetsky
iliaa   Fri Jun 13 10:56:07 2003 EDT

  Modified files:  
/php4/ext/imap  php_imap.c 
  Log:
  Added missing function proto
  
  
Index: php4/ext/imap/php_imap.c
diff -u php4/ext/imap/php_imap.c:1.167 php4/ext/imap/php_imap.c:1.168
--- php4/ext/imap/php_imap.c:1.167  Fri Jun 13 10:39:22 2003
+++ php4/ext/imap/php_imap.cFri Jun 13 10:56:07 2003
@@ -26,7 +26,7 @@
| PHP 4.0 updates:  Zeev Suraski [EMAIL PROTECTED]   |
+--+
  */
-/* $Id: php_imap.c,v 1.167 2003/06/13 14:39:22 iliaa Exp $ */
+/* $Id: php_imap.c,v 1.168 2003/06/13 14:56:07 iliaa Exp $ */
 
 #define IMAP41
 
@@ -4023,6 +4023,8 @@
 }
 /* }}} */
 
+/* {{{ proto mixed imap_timeout(int timeout_type [, int timeout])
+   Set or fetch imap timeout */
 PHP_FUNCTION (imap_timeout)
 {
long ttype, timeout=-1;
@@ -4078,6 +4080,7 @@
RETURN_FALSE;
}
 }
+/* }}} */
 
 /* {{{ Interfaces to C-client 
  */



-- 
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/imap php_imap.c

2003-06-13 Thread Ilia Alshanetsky
iliaa   Fri Jun 13 10:56:23 2003 EDT

  Modified files:  (Branch: PHP_4_3)
/php4/ext/imap  php_imap.c 
  Log:
  proto
  
  
Index: php4/ext/imap/php_imap.c
diff -u php4/ext/imap/php_imap.c:1.142.2.14 php4/ext/imap/php_imap.c:1.142.2.15
--- php4/ext/imap/php_imap.c:1.142.2.14 Fri Jun 13 10:45:36 2003
+++ php4/ext/imap/php_imap.cFri Jun 13 10:56:23 2003
@@ -26,7 +26,7 @@
| PHP 4.0 updates:  Zeev Suraski [EMAIL PROTECTED]   |
+--+
  */
-/* $Id: php_imap.c,v 1.142.2.14 2003/06/13 14:45:36 iliaa Exp $ */
+/* $Id: php_imap.c,v 1.142.2.15 2003/06/13 14:56:23 iliaa Exp $ */
 
 #define IMAP41
 
@@ -3998,6 +3998,8 @@
 }
 /* }}} */
 
+/* {{{ proto mixed imap_timeout(int timeout_type [, int timeout])
+   Set or fetch imap timeout */
 PHP_FUNCTION (imap_timeout)
 {
long ttype, timeout=-1;
@@ -4053,6 +4055,7 @@
RETURN_FALSE;
}
 }
+/* }}} */
 
 /* {{{ Interfaces to C-client 
  */



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



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

2003-06-13 Thread Ilia Alshanetsky
iliaa   Fri Jun 13 11:01:18 2003 EDT

  Modified files:  
/php4/ext/imap  php_imap.c 
  Log:
  Busted by the CS police.
  
  
Index: php4/ext/imap/php_imap.c
diff -u php4/ext/imap/php_imap.c:1.168 php4/ext/imap/php_imap.c:1.169
--- php4/ext/imap/php_imap.c:1.168  Fri Jun 13 10:56:07 2003
+++ php4/ext/imap/php_imap.cFri Jun 13 11:01:18 2003
@@ -26,7 +26,7 @@
| PHP 4.0 updates:  Zeev Suraski [EMAIL PROTECTED]   |
+--+
  */
-/* $Id: php_imap.c,v 1.168 2003/06/13 14:56:07 iliaa Exp $ */
+/* $Id: php_imap.c,v 1.169 2003/06/13 15:01:18 iliaa Exp $ */
 
 #define IMAP41
 
@@ -3985,7 +3985,7 @@
 
 /* {{{ proto array imap_thread(resource stream_id [, int options])
Return threaded by REFERENCES tree */
-PHP_FUNCTION (imap_thread)
+PHP_FUNCTION(imap_thread)
 {
zval **streamind, **search_flags;
pils *imap_le_struct;
@@ -4025,7 +4025,7 @@
 
 /* {{{ proto mixed imap_timeout(int timeout_type [, int timeout])
Set or fetch imap timeout */
-PHP_FUNCTION (imap_timeout)
+PHP_FUNCTION(imap_timeout)
 {
long ttype, timeout=-1;
int timeout_type;



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



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

2003-06-14 Thread Ilia Alshanetsky
iliaa   Sat Jun 14 11:08:38 2003 EDT

  Modified files:  (Branch: PHP_4_3)
/php4/main  main.c php_variables.c 
  Log:
  MFH: Fixed bug #24007 (Problem with register_globals  arrays)
  
  
Index: php4/main/main.c
diff -u php4/main/main.c:1.512.2.39 php4/main/main.c:1.512.2.40
--- php4/main/main.c:1.512.2.39 Thu Jun 12 04:33:45 2003
+++ php4/main/main.cSat Jun 14 11:08:37 2003
@@ -18,7 +18,7 @@
+--+
 */
 
-/* $Id: main.c,v 1.512.2.39 2003/06/12 08:33:45 derick Exp $ */
+/* $Id: main.c,v 1.512.2.40 2003/06/14 15:08:37 iliaa Exp $ */
 
 /* {{{ includes
  */
@@ -1495,6 +1495,20 @@
}
}
 
+   if (PG(register_globals)) {
+   HashPosition pos;
+   zval **data;
+   char *string_key;
+   uint string_key_len;
+
+   
zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(form_variables), pos);
+   while 
(zend_hash_get_current_data_ex(Z_ARRVAL_P(form_variables), (void **)data, pos) == 
SUCCESS) {
+   
zend_hash_get_current_key_ex(Z_ARRVAL_P(form_variables), string_key, string_key_len, 
NULL, 0, pos);
+
+   ZEND_SET_SYMBOL_WITH_LENGTH(EG(symbol_table), 
string_key, string_key_len, *data, (*data)-refcount+1, 0);
+   zend_hash_move_forward_ex(Z_ARRVAL_P(form_variables), 
pos);
+   }
+   }
zend_hash_update(EG(symbol_table), _REQUEST, sizeof(_REQUEST), 
form_variables, sizeof(zval *), NULL);
}
 
Index: php4/main/php_variables.c
diff -u php4/main/php_variables.c:1.45.2.3 php4/main/php_variables.c:1.45.2.4
--- php4/main/php_variables.c:1.45.2.3  Tue Dec 31 11:26:23 2002
+++ php4/main/php_variables.c   Sat Jun 14 11:08:37 2003
@@ -16,7 +16,7 @@
|  Zeev Suraski [EMAIL PROTECTED]|
+--+
  */
-/* $Id: php_variables.c,v 1.45.2.3 2002/12/31 16:26:23 sebastian Exp $ */
+/* $Id: php_variables.c,v 1.45.2.4 2003/06/14 15:08:37 iliaa Exp $ */
 
 #include stdio.h
 #include php.h
@@ -63,23 +63,15 @@
char *ip;   /* index pointer */
char *index;
int var_len, index_len;
-   zval *gpc_element, **gpc_element_p, **top_gpc_p=NULL;
+   zval *gpc_element, **gpc_element_p;
zend_bool is_array;
HashTable *symtable1=NULL;
-   HashTable *symtable2=NULL;
 
assert(var != NULL);

if (track_vars_array) {
symtable1 = Z_ARRVAL_P(track_vars_array);
}
-   if (PG(register_globals)) {
-   if (symtable1) {
-   symtable2 = EG(active_symbol_table);
-   } else {
-   symtable1 = EG(active_symbol_table);
-   }   
-   }
if (!symtable1) {
/* Nothing to do */
zval_dtor(val);
@@ -164,9 +156,6 @@
efree(escaped_index);
}
}
-   if (!top_gpc_p) {
-   top_gpc_p = gpc_element_p;
-   }
symtable1 = Z_ARRVAL_PP(gpc_element_p);
/* ip pointed to the '[' character, now obtain the key */
index = index_s;
@@ -189,18 +178,8 @@
} else {
zend_hash_update(symtable1, index, index_len+1, 
gpc_element, sizeof(zval *), (void **) gpc_element_p);
}
-   if (!top_gpc_p) {
-   top_gpc_p = gpc_element_p;
-   }
break;
}
-   }
-
-   if (top_gpc_p) {
-   if (symtable2) {
-   zend_hash_update(symtable2, var, var_len+1, top_gpc_p, 
sizeof(zval *), NULL);
-   (*top_gpc_p)-refcount++;
-   }   
}
 }
 



-- 
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-06-14 Thread Ilia Alshanetsky
iliaa   Sat Jun 14 11:09:26 2003 EDT

  Modified files:  (Branch: PHP_4_3)
/php4   NEWS 
  Log:
  Bug fixing news
  
  
Index: php4/NEWS
diff -u php4/NEWS:1.1247.2.252 php4/NEWS:1.1247.2.253
--- php4/NEWS:1.1247.2.252  Fri Jun 13 10:56:37 2003
+++ php4/NEWS   Sat Jun 14 11:09:26 2003
@@ -32,6 +32,7 @@
   ([EMAIL PROTECTED], Ilia)
 - Fixed bug #24060 (ncurses_del_panel() causes segfault). (Georg)
 - Fixed bug #24054 (Integer overflow failure with GCC/x86 for *=). (Sascha)
+- Fixed bug #24007 (Problem with register_globals  arrays). (Ilia)
 - Fixed bug #23951 (constants in static initializers clobbered by inheritance).
   (Wez, Zend Engine)
 - Fixed bug #23913 (make rename() work across partitions on *nix). (Ilia)



-- 
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/hyperwave hg_comm.c hw.c

2003-06-15 Thread Ilia Alshanetsky
iliaa   Sun Jun 15 23:07:07 2003 EDT

  Modified files:  (Branch: PHP_4_3)
/php4/ext/hyperwave hg_comm.c hw.c 
  Log:
  MFH: compiler warnings
  
  
Index: php4/ext/hyperwave/hg_comm.c
diff -u php4/ext/hyperwave/hg_comm.c:1.52.8.2 php4/ext/hyperwave/hg_comm.c:1.52.8.3
--- php4/ext/hyperwave/hg_comm.c:1.52.8.2   Thu Jun  5 19:48:16 2003
+++ php4/ext/hyperwave/hg_comm.cSun Jun 15 23:07:07 2003
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: hg_comm.c,v 1.52.8.2 2003/06/05 23:48:16 iliaa Exp $ */
+/* $Id: hg_comm.c,v 1.52.8.3 2003/06/16 03:07:07 iliaa Exp $ */
 
 /* #define HW_DEBUG */
 
@@ -654,7 +654,7 @@
scriptname = emalloc(5*sizeof(char *));
if (zend_hash_find(EG(symbol_table), SCRIPT_NAME, 
sizeof(SCRIPT_NAME), (void **) script_name)==FAILURE)
for(i=0; i5; i++)
-   scriptname[i] = emptystring;
+   scriptname[i] = (char *) emptystring;
else {
convert_to_string_ex(script_name);
for(i=0; i5; i++)
@@ -684,7 +684,7 @@
newtext = text;
bgstr[0] = '\0';
 #ifdef newlist
-   zend_llist_sort(pAnchorList, fnCmpAnchors TSRMLS_CC);
+   zend_llist_sort(pAnchorList, (llist_compare_func_t) fnCmpAnchors TSRMLS_CC);
ptr = (ANCHOR **) zend_llist_get_last(pAnchorList);
if(ptr)
cur_ptr = *ptr;
@@ -1513,7 +1513,7 @@
return(comm_msg);
 }
 
-int send_dummy(int sockfd, hw_objectID objectID, int msgid, char **attributes)
+int send_dummy(int sockfd, hw_objectID objectID, int msg_id, char **attributes)
 {
hg_msg msg, *retmsg;
int  length, error;
@@ -1521,7 +1521,7 @@
 
length = HEADER_LENGTH + sizeof(hw_objectID);
 
-   build_msg_header(msg, length, msgid++, msgid);
+   build_msg_header(msg, length, msg_id++, msg_id);
 
if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL )  {
 /* perror(send_command); */
Index: php4/ext/hyperwave/hw.c
diff -u php4/ext/hyperwave/hw.c:1.111.2.3 php4/ext/hyperwave/hw.c:1.111.2.4
--- php4/ext/hyperwave/hw.c:1.111.2.3   Tue Mar  4 14:00:02 2003
+++ php4/ext/hyperwave/hw.c Sun Jun 15 23:07:07 2003
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: hw.c,v 1.111.2.3 2003/03/04 19:00:02 sniper Exp $ */
+/* $Id: hw.c,v 1.111.2.4 2003/06/16 03:07:07 iliaa Exp $ */
 
 #include stdlib.h
 #include errno.h
@@ -1512,7 +1512,7 @@
 PHP_FUNCTION(hw_dummy)
 {
pval **arg1, **arg2, **arg3;
-   int link, id, type, msgid;
+   int link, id, type, msg_id;
hw_connection *ptr;
 
if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, arg1, arg2, arg3) == 
FAILURE) {
@@ -1523,7 +1523,7 @@
convert_to_long_ex(arg3);
link=Z_LVAL_PP(arg1);
id=Z_LVAL_PP(arg2);
-   msgid=Z_LVAL_PP(arg3);
+   msg_id=Z_LVAL_PP(arg3);
ptr = zend_list_find(link, type);
if(!ptr || (type!=le_socketp  type!=le_psocketp)) {
php_error(E_WARNING, %s(): Unable to find file identifier %d, 
get_active_function_name(TSRMLS_C), id);
@@ -1533,7 +1533,7 @@
set_swap(ptr-swap_on);
{
char *object = NULL;
-   if (0 != (ptr-lasterror = send_dummy(ptr-socket, id, msgid, object)))
+   if (0 != (ptr-lasterror = send_dummy(ptr-socket, id, msg_id, object)))
RETURN_FALSE;
 
 php_printf(%s, object);



-- 
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/hyperwave hw.c

2003-06-16 Thread Ilia Alshanetsky
iliaa   Mon Jun 16 08:33:51 2003 EDT

  Modified files:  (Branch: PHP_4_3)
/php4/ext/hyperwave hw.c 
  Log:
  Hopefully fix win32 build
  
  
Index: php4/ext/hyperwave/hw.c
diff -u php4/ext/hyperwave/hw.c:1.111.2.4 php4/ext/hyperwave/hw.c:1.111.2.5
--- php4/ext/hyperwave/hw.c:1.111.2.4   Sun Jun 15 23:07:07 2003
+++ php4/ext/hyperwave/hw.c Mon Jun 16 08:33:51 2003
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: hw.c,v 1.111.2.4 2003/06/16 03:07:07 iliaa Exp $ */
+/* $Id: hw.c,v 1.111.2.5 2003/06/16 12:33:51 iliaa Exp $ */
 
 #include stdlib.h
 #include errno.h
@@ -34,7 +34,7 @@
 #include SAPI.h
 
 #ifdef PHP_WIN32
-#include winsock.h
+#include winsock2.h
 #endif
 
 #if HYPERWAVE



-- 
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 /ext/standard/tests/array bug24198.phpt

2003-06-16 Thread Ilia Alshanetsky
iliaa   Mon Jun 16 13:35:16 2003 EDT

  Added files: 
/php4/ext/standard/tests/array  bug24198.phpt 

  Modified files:  
/php4/ext/standard  array.c 
  Log:
  Fixed bug #24198 (Invalid recursion detection in array_merge_recurcive())
  
  
Index: php4/ext/standard/array.c
diff -u php4/ext/standard/array.c:1.233 php4/ext/standard/array.c:1.234
--- php4/ext/standard/array.c:1.233 Thu Jun 12 11:11:11 2003
+++ php4/ext/standard/array.c   Mon Jun 16 13:35:16 2003
@@ -21,7 +21,7 @@
+--+
 */
 
-/* $Id: array.c,v 1.233 2003/06/12 15:11:11 andrey Exp $ */
+/* $Id: array.c,v 1.234 2003/06/16 17:35:16 iliaa Exp $ */
 
 #include php.h
 #include php_ini.h
@@ -2141,7 +2141,7 @@
case HASH_KEY_IS_STRING:
if (recursive 
zend_hash_find(dest, string_key, 
string_key_len, (void **)dest_entry) == SUCCESS) {
-   if (*src_entry == *dest_entry) {
+   if (*src_entry == *dest_entry  
((*dest_entry)-refcount % 2)) {
php_error_docref(NULL TSRMLS_CC, 
E_WARNING, recursion detected);
return 0;
}

Index: php4/ext/standard/tests/array/bug24198.phpt
+++ php4/ext/standard/tests/array/bug24198.phpt
--TEST--n
Bug #24198 (array_merge_recursive() invalid recursion detection)
--FILE--
?php
$c = array('a' = 'aa','b' = 'bb'); 

var_dump(array_merge_recursive($c, $c)); 
?
--EXPECT--
array(2) {
  [a]=
  array(2) {
[0]=
string(2) aa
[1]=
string(2) aa
  }
  [b]=
  array(2) {
[0]=
string(2) bb
[1]=
string(2) bb
  }
}



-- 
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/imap php_imap.c

2003-06-16 Thread Ilia Alshanetsky
iliaa   Mon Jun 16 13:42:04 2003 EDT

  Modified files:  (Branch: PHP_4_3)
/php4/ext/imap  php_imap.c 
  Log:
  MFH: Fixed bug #24150 (crash in imap_fetch_overview() 
  imap_rfc822_write_address())
  
  
Index: php4/ext/imap/php_imap.c
diff -u php4/ext/imap/php_imap.c:1.142.2.15 php4/ext/imap/php_imap.c:1.142.2.16
--- php4/ext/imap/php_imap.c:1.142.2.15 Fri Jun 13 10:56:23 2003
+++ php4/ext/imap/php_imap.cMon Jun 16 13:42:04 2003
@@ -26,7 +26,7 @@
| PHP 4.0 updates:  Zeev Suraski [EMAIL PROTECTED]   |
+--+
  */
-/* $Id: php_imap.c,v 1.142.2.15 2003/06/13 14:56:23 iliaa Exp $ */
+/* $Id: php_imap.c,v 1.142.2.16 2003/06/16 17:42:04 iliaa Exp $ */
 
 #define IMAP41
 
@@ -1955,6 +1955,10 @@
addr-error=NIL;
addr-adl=NIL;
 
+   if (_php_imap_address_size(addr) = MAILTMPLEN) {
+   RETURN_FALSE;
+   }
+
string[0]='\0';
rfc822_write_address(string, addr);
RETVAL_STRING(string, 1);
@@ -2715,13 +2719,13 @@
if (env-subject) {
add_property_string(myoverview, subject, 
env-subject, 1);
}
-   if (env-from) {
+   if (env-from  _php_imap_address_size(env-from) = 
MAILTMPLEN) {
env-from-next=NULL;
address[0] = '\0';
rfc822_write_address(address, env-from);
add_property_string(myoverview, from, 
address, 1);
}
-   if (env-to) {
+   if (env-to  _php_imap_address_size(env-from) = 
MAILTMPLEN) {
env-to-next = NULL;
address[0] = '\0';
rfc822_write_address(address, env-to);



-- 
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-06-16 Thread Ilia Alshanetsky
iliaa   Mon Jun 16 15:24:56 2003 EDT

  Modified files:  
/php4/main  php_variables.c 
  Log:
  Fixed bug #24208
  
  
Index: php4/main/php_variables.c
diff -u php4/main/php_variables.c:1.63 php4/main/php_variables.c:1.64
--- php4/main/php_variables.c:1.63  Sat Jun 14 11:08:27 2003
+++ php4/main/php_variables.c   Mon Jun 16 15:24:56 2003
@@ -17,7 +17,7 @@
+--+
  */
 
-/* $Id: php_variables.c,v 1.63 2003/06/14 15:08:27 iliaa Exp $ */
+/* $Id: php_variables.c,v 1.64 2003/06/16 19:24:56 iliaa Exp $ */
 
 #include stdio.h
 #include php.h
@@ -75,6 +75,8 @@

if (track_vars_array) {
symtable1 = Z_ARRVAL_P(track_vars_array);
+   } else if (PG(register_globals)) {
+   symtable1 = EG(active_symbol_table);
}
if (!symtable1) {
/* Nothing to do */



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



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

2003-06-16 Thread Ilia Alshanetsky
iliaa   Mon Jun 16 15:25:06 2003 EDT

  Modified files:  (Branch: PHP_4_3)
/php4/main  php_variables.c 
  Log:
  MFH: Fixed bug #24208
  
  
Index: php4/main/php_variables.c
diff -u php4/main/php_variables.c:1.45.2.4 php4/main/php_variables.c:1.45.2.5
--- php4/main/php_variables.c:1.45.2.4  Sat Jun 14 11:08:37 2003
+++ php4/main/php_variables.c   Mon Jun 16 15:25:06 2003
@@ -16,7 +16,7 @@
|  Zeev Suraski [EMAIL PROTECTED]|
+--+
  */
-/* $Id: php_variables.c,v 1.45.2.4 2003/06/14 15:08:37 iliaa Exp $ */
+/* $Id: php_variables.c,v 1.45.2.5 2003/06/16 19:25:06 iliaa Exp $ */
 
 #include stdio.h
 #include php.h
@@ -71,6 +71,8 @@

if (track_vars_array) {
symtable1 = Z_ARRVAL_P(track_vars_array);
+   } else if (PG(register_globals)) {
+   symtable1 = EG(active_symbol_table);
}
if (!symtable1) {
/* Nothing to do */



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



[PHP-CVS] cvs: php4 /ext/standard/tests/array bug24220.phpt

2003-06-17 Thread Ilia Alshanetsky
iliaa   Tue Jun 17 09:19:20 2003 EDT

  Added files: 
/php4/ext/standard/tests/array  bug24220.phpt 
  Log:
  Added a test case for bug #24220
  
  

Index: php4/ext/standard/tests/array/bug24220.phpt
+++ php4/ext/standard/tests/array/bug24220.phpt
--TEST--n
Bug #24220 (range() numeric string handling)
--FILE--
?php
var_dump(range(2003, 2004));
var_dump(range(a, z));
var_dump(range(1, 10));
?
--EXPECT--
array(2) {
  [0]=
  int(2003)
  [1]=
  int(2004)
}
array(26) {
  [0]=
  string(1) a
  [1]=
  string(1) b
  [2]=
  string(1) c
  [3]=
  string(1) d
  [4]=
  string(1) e
  [5]=
  string(1) f
  [6]=
  string(1) g
  [7]=
  string(1) h
  [8]=
  string(1) i
  [9]=
  string(1) j
  [10]=
  string(1) k
  [11]=
  string(1) l
  [12]=
  string(1) m
  [13]=
  string(1) n
  [14]=
  string(1) o
  [15]=
  string(1) p
  [16]=
  string(1) q
  [17]=
  string(1) r
  [18]=
  string(1) s
  [19]=
  string(1) t
  [20]=
  string(1) u
  [21]=
  string(1) v
  [22]=
  string(1) w
  [23]=
  string(1) x
  [24]=
  string(1) y
  [25]=
  string(1) z
}
array(10) {
  [0]=
  int(1)
  [1]=
  int(2)
  [2]=
  int(3)
  [3]=
  int(4)
  [4]=
  int(5)
  [5]=
  int(6)
  [6]=
  int(7)
  [7]=
  int(8)
  [8]=
  int(9)
  [9]=
  int(10)
}



-- 
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/standard array.c /ext/standard/tests/array bug24220.phpt

2003-06-17 Thread Ilia Alshanetsky
iliaa   Tue Jun 17 09:20:18 2003 EDT

  Added files: (Branch: PHP_4_3)
/php4/ext/standard/tests/array  bug24220.phpt 

  Modified files:  
/php4/ext/standard  array.c 
  Log:
  Fixed bug #24220 (range() didn't handle numeric strings correctly)
  
  
Index: php4/ext/standard/array.c
diff -u php4/ext/standard/array.c:1.199.2.20 php4/ext/standard/array.c:1.199.2.21
--- php4/ext/standard/array.c:1.199.2.20Mon Jun 16 13:37:15 2003
+++ php4/ext/standard/array.c   Tue Jun 17 09:20:18 2003
@@ -21,7 +21,7 @@
+--+
 */
 
-/* $Id: array.c,v 1.199.2.20 2003/06/16 17:37:15 iliaa Exp $ */
+/* $Id: array.c,v 1.199.2.21 2003/06/17 13:20:18 iliaa Exp $ */
 
 #include php.h
 #include php_ini.h
@@ -1428,7 +1428,7 @@
/* allocate an array for return */
array_init(return_value);
 
-   if (Z_TYPE_PP(zlow)==IS_STRING  Z_TYPE_PP(zhigh)==IS_STRING) {
+   if (Z_TYPE_PP(zlow) == IS_STRING  Z_TYPE_PP(zhigh) == IS_STRING  
Z_STRLEN_PP(zlow) == 1  Z_STRLEN_PP(zhigh) == 1) {
unsigned char low, high;
low = *((unsigned char *)Z_STRVAL_PP(zlow));
high = *((unsigned char *)Z_STRVAL_PP(zhigh));

Index: php4/ext/standard/tests/array/bug24220.phpt
+++ php4/ext/standard/tests/array/bug24220.phpt
--TEST--n
Bug #24220 (range() numeric string handling)
--FILE--
?php
var_dump(range(2003, 2004));
var_dump(range(a, z));
var_dump(range(1, 10));
?
--EXPECT--
array(2) {
  [0]=
  int(2003)
  [1]=
  int(2004)
}
array(26) {
  [0]=
  string(1) a
  [1]=
  string(1) b
  [2]=
  string(1) c
  [3]=
  string(1) d
  [4]=
  string(1) e
  [5]=
  string(1) f
  [6]=
  string(1) g
  [7]=
  string(1) h
  [8]=
  string(1) i
  [9]=
  string(1) j
  [10]=
  string(1) k
  [11]=
  string(1) l
  [12]=
  string(1) m
  [13]=
  string(1) n
  [14]=
  string(1) o
  [15]=
  string(1) p
  [16]=
  string(1) q
  [17]=
  string(1) r
  [18]=
  string(1) s
  [19]=
  string(1) t
  [20]=
  string(1) u
  [21]=
  string(1) v
  [22]=
  string(1) w
  [23]=
  string(1) x
  [24]=
  string(1) y
  [25]=
  string(1) z
}
array(10) {
  [0]=
  int(1)
  [1]=
  int(2)
  [2]=
  int(3)
  [3]=
  int(4)
  [4]=
  int(5)
  [5]=
  int(6)
  [6]=
  int(7)
  [7]=
  int(8)
  [8]=
  int(9)
  [9]=
  int(10)
}



-- 
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-06-17 Thread Ilia Alshanetsky
iliaa   Tue Jun 17 09:20:54 2003 EDT

  Modified files:  (Branch: PHP_4_3)
/php4   NEWS 
  Log:
  BFN
  
  
Index: php4/NEWS
diff -u php4/NEWS:1.1247.2.257 php4/NEWS:1.1247.2.258
--- php4/NEWS:1.1247.2.257  Mon Jun 16 17:38:07 2003
+++ php4/NEWS   Tue Jun 17 09:20:54 2003
@@ -31,6 +31,7 @@
 - Fixed ext/yaz to not log if yaz.log_file php.ini option is not set. (Adam)
 - Fixed a bug in bundled libmysql (mysql bug #564). (Georg)
 - Fixed ext/exif to honor magic_quotes_runtime php.ini option. (Marcus)
+- Fixed bug #24220 (range() didn't handle numeric strings correctly). (Ilia)
 - Fixed bug #24210 (not detecting assume_default_colors - typo). (Sara)
 - Fixed bug #24198 (Invalid recursion detection in array_merge_recurcive()).
   (Ilia)



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



[PHP-CVS] cvs: php4 /ext/gd/libgd gdft.c

2003-06-17 Thread Ilia Alshanetsky
iliaa   Tue Jun 17 09:37:43 2003 EDT

  Modified files:  
/php4/ext/gd/libgd  gdft.c 
  Log:
  Fixed bug #24223 (missing variable initialization in bundled gd)
  
  
Index: php4/ext/gd/libgd/gdft.c
diff -u php4/ext/gd/libgd/gdft.c:1.23 php4/ext/gd/libgd/gdft.c:1.24
--- php4/ext/gd/libgd/gdft.c:1.23   Tue Jun  3 19:54:56 2003
+++ php4/ext/gd/libgd/gdft.cTue Jun 17 09:37:43 2003
@@ -889,11 +889,16 @@
}
 
 #ifndef JISX0208
-   if (!font-have_char_map_sjis) {
-   next = string;
-   } else
+   if (font-have_char_map_sjis) {
 #endif
tmpstr = (char *) gdMalloc(BUFSIZ);
+   any2eucjp(tmpstr, string, BUFSIZ);
+   next = tmpstr;
+#ifndef JISX0208
+   } else {
+   next = string;
+   }
+#endif
 
while (*next) {
ch = *next;



-- 
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/gd/libgd gdft.c

2003-06-17 Thread Ilia Alshanetsky
iliaa   Tue Jun 17 09:37:57 2003 EDT

  Modified files:  (Branch: PHP_4_3)
/php4/ext/gd/libgd  gdft.c 
  Log:
  MFH: Fixed bug #24223 (missing variable initialization in bundled gd)
  
  
  
Index: php4/ext/gd/libgd/gdft.c
diff -u php4/ext/gd/libgd/gdft.c:1.11.2.9 php4/ext/gd/libgd/gdft.c:1.11.2.10
--- php4/ext/gd/libgd/gdft.c:1.11.2.9   Tue Jun  3 19:55:15 2003
+++ php4/ext/gd/libgd/gdft.cTue Jun 17 09:37:57 2003
@@ -889,11 +889,16 @@
}
 
 #ifndef JISX0208
-   if (!font-have_char_map_sjis) {
-   next = string;
-   } else
+   if (font-have_char_map_sjis) {
 #endif
tmpstr = (char *) gdMalloc(BUFSIZ);
+   any2eucjp(tmpstr, string, BUFSIZ);
+   next = tmpstr;
+#ifndef JISX0208
+   } else {
+   next = string;
+   }
+#endif
 
while (*next) {
ch = *next;



-- 
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-06-17 Thread Ilia Alshanetsky
iliaa   Tue Jun 17 09:38:38 2003 EDT

  Modified files:  (Branch: PHP_4_3)
/php4   NEWS 
  Log:
  MFH
  
  
Index: php4/NEWS
diff -u php4/NEWS:1.1247.2.258 php4/NEWS:1.1247.2.259
--- php4/NEWS:1.1247.2.258  Tue Jun 17 09:20:54 2003
+++ php4/NEWS   Tue Jun 17 09:38:38 2003
@@ -31,6 +31,7 @@
 - Fixed ext/yaz to not log if yaz.log_file php.ini option is not set. (Adam)
 - Fixed a bug in bundled libmysql (mysql bug #564). (Georg)
 - Fixed ext/exif to honor magic_quotes_runtime php.ini option. (Marcus)
+- Fixed bug #24223 (missing variable initialization in bundled gd). (Ilia)
 - Fixed bug #24220 (range() didn't handle numeric strings correctly). (Ilia)
 - Fixed bug #24210 (not detecting assume_default_colors - typo). (Sara)
 - Fixed bug #24198 (Invalid recursion detection in array_merge_recurcive()).



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



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

2003-06-17 Thread Ilia Alshanetsky
iliaa   Tue Jun 17 09:59:44 2003 EDT

  Modified files:  
/php4/ext/imap  php_imap.c 
  Log:
  Fixed a typo in the check
  
  
Index: php4/ext/imap/php_imap.c
diff -u php4/ext/imap/php_imap.c:1.171 php4/ext/imap/php_imap.c:1.172
--- php4/ext/imap/php_imap.c:1.171  Mon Jun 16 13:41:52 2003
+++ php4/ext/imap/php_imap.cTue Jun 17 09:59:44 2003
@@ -26,7 +26,7 @@
| PHP 4.0 updates:  Zeev Suraski [EMAIL PROTECTED]   |
+--+
  */
-/* $Id: php_imap.c,v 1.171 2003/06/16 17:41:52 iliaa Exp $ */
+/* $Id: php_imap.c,v 1.172 2003/06/17 13:59:44 iliaa Exp $ */
 
 #define IMAP41
 
@@ -2749,13 +2749,13 @@
if (env-subject) {
add_property_string(myoverview, subject, 
env-subject, 1);
}
-   if (env-from  _php_imap_address_size(env-from) = 
MAILTMPLEN) {
+   if (env-from  _php_imap_address_size(env-from)  
MAILTMPLEN) {
env-from-next=NULL;
address[0] = '\0';
rfc822_write_address(address, env-from);
add_property_string(myoverview, from, 
address, 1);
}
-   if (env-to  _php_imap_address_size(env-from) = 
MAILTMPLEN) {
+   if (env-to  _php_imap_address_size(env-from)  
MAILTMPLEN) {
env-to-next = NULL;
address[0] = '\0';
rfc822_write_address(address, env-to);



-- 
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/imap php_imap.c

2003-06-17 Thread Ilia Alshanetsky
iliaa   Tue Jun 17 10:13:25 2003 EDT

  Modified files:  (Branch: PHP_4_3)
/php4/ext/imap  php_imap.c 
  Log:
  MFH
  
  
Index: php4/ext/imap/php_imap.c
diff -u php4/ext/imap/php_imap.c:1.142.2.17 php4/ext/imap/php_imap.c:1.142.2.18
--- php4/ext/imap/php_imap.c:1.142.2.17 Tue Jun 17 09:59:56 2003
+++ php4/ext/imap/php_imap.cTue Jun 17 10:13:25 2003
@@ -26,7 +26,7 @@
| PHP 4.0 updates:  Zeev Suraski [EMAIL PROTECTED]   |
+--+
  */
-/* $Id: php_imap.c,v 1.142.2.17 2003/06/17 13:59:56 iliaa Exp $ */
+/* $Id: php_imap.c,v 1.142.2.18 2003/06/17 14:13:25 iliaa Exp $ */
 
 #define IMAP41
 
@@ -2725,7 +2725,7 @@
rfc822_write_address(address, env-from);
add_property_string(myoverview, from, 
address, 1);
}
-   if (env-to  _php_imap_address_size(env-from)  
MAILTMPLEN) {
+   if (env-to  _php_imap_address_size(env-to)  
MAILTMPLEN) {
env-to-next = NULL;
address[0] = '\0';
rfc822_write_address(address, env-to);



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



[PHP-CVS] cvs: php4(PHP_4_3) /main main.c

2003-06-17 Thread Ilia Alshanetsky
iliaa   Tue Jun 17 13:15:16 2003 EDT

  Modified files:  (Branch: PHP_4_3)
/php4/main  main.c 
  Log:
  MFH: Handle numeric keys passed via GPC
  
  
Index: php4/main/main.c
diff -u php4/main/main.c:1.512.2.40 php4/main/main.c:1.512.2.41
--- php4/main/main.c:1.512.2.40 Sat Jun 14 11:08:37 2003
+++ php4/main/main.cTue Jun 17 13:15:16 2003
@@ -18,7 +18,7 @@
+--+
 */
 
-/* $Id: main.c,v 1.512.2.40 2003/06/14 15:08:37 iliaa Exp $ */
+/* $Id: main.c,v 1.512.2.41 2003/06/17 17:15:16 iliaa Exp $ */
 
 /* {{{ includes
  */
@@ -1500,12 +1500,14 @@
zval **data;
char *string_key;
uint string_key_len;
+   ulong num_key;
 

zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(form_variables), pos);
while 
(zend_hash_get_current_data_ex(Z_ARRVAL_P(form_variables), (void **)data, pos) == 
SUCCESS) {
-   
zend_hash_get_current_key_ex(Z_ARRVAL_P(form_variables), string_key, string_key_len, 
NULL, 0, pos);
-
-   ZEND_SET_SYMBOL_WITH_LENGTH(EG(symbol_table), 
string_key, string_key_len, *data, (*data)-refcount+1, 0);
+   /* we only register string keys, since we cannot have 
$1234 */
+   if 
(zend_hash_get_current_key_ex(Z_ARRVAL_P(form_variables), string_key, 
string_key_len, num_key, 0, pos) == HASH_KEY_IS_STRING) {
+   ZEND_SET_SYMBOL_WITH_LENGTH(EG(symbol_table), 
string_key, string_key_len, *data, (*data)-refcount+1, 0);
+   }
zend_hash_move_forward_ex(Z_ARRVAL_P(form_variables), 
pos);
}
}



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



[PHP-CVS] cvs: php4 / php.ini-dist php.ini-recommended /ext/mysql php_mysql.c

2003-06-18 Thread Ilia Alshanetsky
iliaa   Wed Jun 18 11:19:16 2003 EDT

  Modified files:  
/php4   php.ini-dist php.ini-recommended 
/php4/ext/mysql php_mysql.c 
  Log:
  Make the default mysql connection timeout 60 seconds rather then unlimited.
   
  
Index: php4/php.ini-dist
diff -u php4/php.ini-dist:1.193 php4/php.ini-dist:1.194
--- php4/php.ini-dist:1.193 Tue Jun  3 06:06:45 2003
+++ php4/php.ini-dist   Wed Jun 18 11:19:16 2003
@@ -670,7 +670,7 @@
 mysql.default_password =
 
 ; Maximum time (in secondes) for connect timeout. -1 means no limimt
-mysql.connect_timeout = -1
+mysql.connect_timeout = 60
 
 ; Trace mode. When trace_mode is active (=On), warnings for table/index scans and
 ; SQL-Erros will be displayed.
Index: php4/php.ini-recommended
diff -u php4/php.ini-recommended:1.138 php4/php.ini-recommended:1.139
--- php4/php.ini-recommended:1.138  Tue Jun  3 06:06:45 2003
+++ php4/php.ini-recommendedWed Jun 18 11:19:16 2003
@@ -685,7 +685,7 @@
 mysql.default_password =
 
 ; Maximum time (in secondes) for connect timeout. -1 means no limimt
-mysql.connect_timeout = -1
+mysql.connect_timeout = 60
 
 ; Trace mode. When trace_mode is active (=On), warnings for table/index scans and
 ; SQL-Erros will be displayed.
Index: php4/ext/mysql/php_mysql.c
diff -u php4/ext/mysql/php_mysql.c:1.194 php4/ext/mysql/php_mysql.c:1.195
--- php4/ext/mysql/php_mysql.c:1.194Tue Jun 10 16:03:33 2003
+++ php4/ext/mysql/php_mysql.c  Wed Jun 18 11:19:16 2003
@@ -18,7 +18,7 @@
+--+
 */
  
-/* $Id: php_mysql.c,v 1.194 2003/06/10 20:03:33 imajes Exp $ */
+/* $Id: php_mysql.c,v 1.195 2003/06/18 15:19:16 iliaa Exp $ */
 
 /* TODO:
  *
@@ -303,7 +303,7 @@
STD_PHP_INI_ENTRY(mysql.default_password, NULL,   PHP_INI_ALL,   
 OnUpdateString, default_password,   zend_mysql_globals,   
  mysql_globals)
PHP_INI_ENTRY(mysql.default_port, NULL,   
PHP_INI_ALL,OnMySQLPort)
STD_PHP_INI_ENTRY(mysql.default_socket,   NULL,   PHP_INI_ALL,   
 OnUpdateStringUnempty,  default_socket, zend_mysql_globals, 
mysql_globals)
-   STD_PHP_INI_ENTRY(mysql.connect_timeout,  -1,   PHP_INI_ALL,   
 OnUpdateLong,   connect_timeout,zend_mysql_globals,   
  mysql_globals)
+   STD_PHP_INI_ENTRY(mysql.connect_timeout,  60,   PHP_INI_ALL,   
 OnUpdateLong,   connect_timeout,zend_mysql_globals,   
  mysql_globals)
STD_PHP_INI_BOOLEAN(mysql.trace_mode, 0,PHP_INI_ALL,   
 OnUpdateLong,   trace_mode, zend_mysql_globals,   
  mysql_globals)
 PHP_INI_END()
 /* }}} */



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



[PHP-CVS] cvs: php4(PHP_4_3) / php.ini-dist php.ini-recommended /ext/mysql php_mysql.c

2003-06-18 Thread Ilia Alshanetsky
iliaa   Wed Jun 18 11:19:29 2003 EDT

  Modified files:  (Branch: PHP_4_3)
/php4   php.ini-dist php.ini-recommended 
/php4/ext/mysql php_mysql.c 
  Log:
  MFH
  
  
Index: php4/php.ini-dist
diff -u php4/php.ini-dist:1.171.2.14 php4/php.ini-dist:1.171.2.15
--- php4/php.ini-dist:1.171.2.14Tue Jun  3 06:08:17 2003
+++ php4/php.ini-dist   Wed Jun 18 11:19:28 2003
@@ -666,7 +666,7 @@
 mysql.default_password =
 
 ; Maximum time (in secondes) for connect timeout. -1 means no limimt
-mysql.connect_timeout = -1
+mysql.connect_timeout = 60
 
 ; Trace mode. When trace_mode is active (=On), warnings for table/index scans and
 ; SQL-Erros will be displayed.
Index: php4/php.ini-recommended
diff -u php4/php.ini-recommended:1.119.2.12 php4/php.ini-recommended:1.119.2.13
--- php4/php.ini-recommended:1.119.2.12 Tue Jun  3 06:08:17 2003
+++ php4/php.ini-recommendedWed Jun 18 11:19:28 2003
@@ -681,7 +681,7 @@
 mysql.default_password =
 
 ; Maximum time (in secondes) for connect timeout. -1 means no limimt
-mysql.connect_timeout = -1
+mysql.connect_timeout = 60
 
 ; Trace mode. When trace_mode is active (=On), warnings for table/index scans and
 ; SQL-Erros will be displayed.
Index: php4/ext/mysql/php_mysql.c
diff -u php4/ext/mysql/php_mysql.c:1.174.2.18 php4/ext/mysql/php_mysql.c:1.174.2.19
--- php4/ext/mysql/php_mysql.c:1.174.2.18   Tue Jun 10 10:46:00 2003
+++ php4/ext/mysql/php_mysql.c  Wed Jun 18 11:19:28 2003
@@ -18,7 +18,7 @@
+--+
 */
  
-/* $Id: php_mysql.c,v 1.174.2.18 2003/06/10 14:46:00 andrey Exp $ */
+/* $Id: php_mysql.c,v 1.174.2.19 2003/06/18 15:19:28 iliaa Exp $ */
 
 /* TODO:
  *
@@ -315,7 +315,7 @@
STD_PHP_INI_ENTRY(mysql.default_password, NULL,   PHP_INI_ALL,   
 OnUpdateString, default_password,   zend_mysql_globals,   
  mysql_globals)
PHP_INI_ENTRY(mysql.default_port, NULL,   
PHP_INI_ALL,OnMySQLPort)
STD_PHP_INI_ENTRY(mysql.default_socket,   NULL,   PHP_INI_ALL,   
 OnUpdateStringUnempty,  default_socket, zend_mysql_globals, 
mysql_globals)
-   STD_PHP_INI_ENTRY(mysql.connect_timeout,  -1,   PHP_INI_ALL,   
 OnUpdateInt,connect_timeout,zend_mysql_globals,   
  mysql_globals)
+   STD_PHP_INI_ENTRY(mysql.connect_timeout,  60,   PHP_INI_ALL,   
 OnUpdateInt,connect_timeout,zend_mysql_globals,   
  mysql_globals)
STD_PHP_INI_BOOLEAN(mysql.trace_mode, 0,PHP_INI_ALL,   
 OnUpdateInt,trace_mode, zend_mysql_globals,   
  mysql_globals)
 PHP_INI_END()
 /* }}} */



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



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

2003-06-19 Thread Ilia Alshanetsky
iliaa   Thu Jun 19 11:47:46 2003 EDT

  Modified files:  
/php4/ext/gdgd.c 
  Log:
  Fixed a crash inside php_imagettftext_common();
  
  
Index: php4/ext/gd/gd.c
diff -u php4/ext/gd/gd.c:1.274 php4/ext/gd/gd.c:1.275
--- php4/ext/gd/gd.c:1.274  Sun Jun 15 16:00:08 2003
+++ php4/ext/gd/gd.cThu Jun 19 11:47:46 2003
@@ -18,7 +18,7 @@
+--+
  */
 
-/* $Id: gd.c,v 1.274 2003/06/15 20:00:08 helly Exp $ */
+/* $Id: gd.c,v 1.275 2003/06/19 15:47:46 iliaa Exp $ */
 
 /* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center,
Cold Spring Harbor Labs. */
@@ -3107,8 +3107,9 @@
do {
zval ** item;
char * key;
+   ulong num_key;
 
-   if (zend_hash_get_current_key_ex(HASH_OF(*EXT), key, 
NULL, NULL, 0, pos) == FAILURE) {
+   if (zend_hash_get_current_key_ex(HASH_OF(*EXT), key, 
NULL, num_key, 0, pos) != HASH_KEY_IS_STRING) {
continue;
}
 



-- 
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/gd gd.c

2003-06-19 Thread Ilia Alshanetsky
iliaa   Thu Jun 19 11:48:08 2003 EDT

  Modified files:  (Branch: PHP_4_3)
/php4/ext/gdgd.c 
  Log:
  MFH: Fixed a crash inside php_imagettftext_common();
  
  
Index: php4/ext/gd/gd.c
diff -u php4/ext/gd/gd.c:1.221.2.29 php4/ext/gd/gd.c:1.221.2.30
--- php4/ext/gd/gd.c:1.221.2.29 Tue Jun  3 20:22:30 2003
+++ php4/ext/gd/gd.cThu Jun 19 11:48:07 2003
@@ -18,7 +18,7 @@
+--+
  */
 
-/* $Id: gd.c,v 1.221.2.29 2003/06/04 00:22:30 iliaa Exp $ */
+/* $Id: gd.c,v 1.221.2.30 2003/06/19 15:48:07 iliaa Exp $ */
 
 /* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center, 
Cold Spring Harbor Labs. */
@@ -3012,8 +3012,9 @@
do {
  zval ** item;
  char * key;
+ ulong num_key;
 
- if (zend_hash_get_current_key_ex(HASH_OF(*EXT), key, NULL, 
NULL, 0, pos) == FAILURE)
+ if (zend_hash_get_current_key_ex(HASH_OF(*EXT), key, NULL, 
num_key, 0, pos) != HASH_KEY_IS_STRING)
  continue;
 
  if (zend_hash_get_current_data_ex(HASH_OF(*EXT), 
(void**)item, pos) == FAILURE)



-- 
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/standard file.c

2003-06-19 Thread Ilia Alshanetsky
iliaa   Thu Jun 19 12:10:37 2003 EDT

  Modified files:  (Branch: PHP_4_3)
/php4/ext/standard  file.c 
  Log:
  Fixed a possible crash in parse_context_options()
  
  
Index: php4/ext/standard/file.c
diff -u php4/ext/standard/file.c:1.279.2.25 php4/ext/standard/file.c:1.279.2.26
--- php4/ext/standard/file.c:1.279.2.25 Fri Jun  6 04:11:38 2003
+++ php4/ext/standard/file.cThu Jun 19 12:10:37 2003
@@ -21,7 +21,7 @@
+--+
  */
 
-/* $Id: file.c,v 1.279.2.25 2003/06/06 08:11:38 sniper Exp $ */
+/* $Id: file.c,v 1.279.2.26 2003/06/19 16:10:37 iliaa Exp $ */
 
 /* Synced with php 3.0 revision 1.218 1999-06-16 [ssb] */
 
@@ -877,16 +877,17 @@
char *wkey, *okey;
int wkey_len, okey_len;
int ret = SUCCESS;
+   ulong num_key;

zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(options), pos);
while (SUCCESS == zend_hash_get_current_data_ex(Z_ARRVAL_P(options), 
(void**)wval, pos)) {
-   if (HASH_KEY_IS_STRING == 
zend_hash_get_current_key_ex(Z_ARRVAL_P(options), wkey, wkey_len, NULL, 0, pos)
+   if (HASH_KEY_IS_STRING == 
zend_hash_get_current_key_ex(Z_ARRVAL_P(options), wkey, wkey_len, num_key, 0, pos)
 Z_TYPE_PP(wval) == IS_ARRAY) {
 
zend_hash_internal_pointer_reset_ex(Z_ARRVAL_PP(wval), opos);
while (SUCCESS == 
zend_hash_get_current_data_ex(Z_ARRVAL_PP(wval), (void**)oval, opos)) {
 
-   if (HASH_KEY_IS_STRING == 
zend_hash_get_current_key_ex(Z_ARRVAL_PP(wval), okey, okey_len, NULL, 0, opos)) {
+   if (HASH_KEY_IS_STRING == 
zend_hash_get_current_key_ex(Z_ARRVAL_PP(wval), okey, okey_len, num_key, 0, opos)) 
{
ZVAL_ADDREF(*oval);
php_stream_context_set_option(context, wkey, 
okey, *oval);
}



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



[PHP-CVS] cvs: php4 /ext/standard info.c streamsfuncs.c user_filters.c

2003-06-19 Thread Ilia Alshanetsky
iliaa   Thu Jun 19 12:10:54 2003 EDT

  Modified files:  
/php4/ext/standard  user_filters.c streamsfuncs.c info.c 
  Log:
  Fixed possible crashes in streams code
  
  
Index: php4/ext/standard/user_filters.c
diff -u php4/ext/standard/user_filters.c:1.18 php4/ext/standard/user_filters.c:1.19
--- php4/ext/standard/user_filters.c:1.18   Fri Jun 13 18:25:29 2003
+++ php4/ext/standard/user_filters.cThu Jun 19 12:10:54 2003
@@ -18,7 +18,7 @@
+--+
 */
 
-/* $Id: user_filters.c,v 1.18 2003/06/13 22:25:29 pollita Exp $ */
+/* $Id: user_filters.c,v 1.19 2003/06/19 16:10:54 iliaa Exp $ */
 
 #include php.h
 #include php_globals.h
@@ -427,6 +427,7 @@
char *filter_name;
int key_flags, filter_name_len = 0;
HashTable *filters_hash;
+   ulong num_key;
 
if (ZEND_NUM_ARGS() != 0) {
WRONG_PARAM_COUNT;
@@ -438,7 +439,7 @@
 
if (filters_hash) {
for(zend_hash_internal_pointer_reset(filters_hash);
-   (key_flags = zend_hash_get_current_key_ex(filters_hash, 
filter_name, filter_name_len, NULL, 0, NULL)) != HASH_KEY_NON_EXISTANT;
+   (key_flags = zend_hash_get_current_key_ex(filters_hash, 
filter_name, filter_name_len, num_key, 0, NULL)) != HASH_KEY_NON_EXISTANT;
zend_hash_move_forward(filters_hash))
if (key_flags == HASH_KEY_IS_STRING)
add_next_index_stringl(return_value, 
filter_name, filter_name_len, 1);
Index: php4/ext/standard/streamsfuncs.c
diff -u php4/ext/standard/streamsfuncs.c:1.18 php4/ext/standard/streamsfuncs.c:1.19
--- php4/ext/standard/streamsfuncs.c:1.18   Tue Jun 17 14:38:56 2003
+++ php4/ext/standard/streamsfuncs.cThu Jun 19 12:10:54 2003
@@ -17,7 +17,7 @@
   +--+
 */
 
-/* $Id: streamsfuncs.c,v 1.18 2003/06/17 18:38:56 pollita Exp $ */
+/* $Id: streamsfuncs.c,v 1.19 2003/06/19 16:10:54 iliaa Exp $ */
 
 #include php.h
 #include php_globals.h
@@ -353,6 +353,7 @@
HashTable *stream_xport_hash;
char *stream_xport;
int stream_xport_len;
+   ulong num_key;
 
if (ZEND_NUM_ARGS() != 0) {
WRONG_PARAM_COUNT;
@@ -363,7 +364,7 @@
zend_hash_internal_pointer_reset(stream_xport_hash);
while (zend_hash_get_current_key_ex(stream_xport_hash,
stream_xport, stream_xport_len,
-   NULL, 0, NULL) == HASH_KEY_IS_STRING) {
+   num_key, 0, NULL) == HASH_KEY_IS_STRING) {
add_next_index_stringl(return_value, stream_xport, 
stream_xport_len, 1);
zend_hash_move_forward(stream_xport_hash);
}
@@ -380,6 +381,7 @@
HashTable *url_stream_wrappers_hash;
char *stream_protocol;
int key_flags, stream_protocol_len = 0;
+   ulong num_key;
 
if (ZEND_NUM_ARGS() != 0) {
WRONG_PARAM_COUNT;
@@ -388,7 +390,7 @@
if ((url_stream_wrappers_hash = php_stream_get_url_stream_wrappers_hash())) {
array_init(return_value);
for(zend_hash_internal_pointer_reset(url_stream_wrappers_hash);
-   (key_flags = 
zend_hash_get_current_key_ex(url_stream_wrappers_hash, stream_protocol, 
stream_protocol_len, NULL, 0, NULL)) != HASH_KEY_NON_EXISTANT;
+   (key_flags = 
zend_hash_get_current_key_ex(url_stream_wrappers_hash, stream_protocol, 
stream_protocol_len, num_key, 0, NULL)) != HASH_KEY_NON_EXISTANT;
zend_hash_move_forward(url_stream_wrappers_hash)) {
if (key_flags == HASH_KEY_IS_STRING) {
add_next_index_stringl(return_value, 
stream_protocol, stream_protocol_len, 1);
@@ -640,16 +642,17 @@
char *wkey, *okey;
int wkey_len, okey_len;
int ret = SUCCESS;
+   ulong num_key;

zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(options), pos);
while (SUCCESS == zend_hash_get_current_data_ex(Z_ARRVAL_P(options), 
(void**)wval, pos)) {
-   if (HASH_KEY_IS_STRING == 
zend_hash_get_current_key_ex(Z_ARRVAL_P(options), wkey, wkey_len, NULL, 0, pos)
+   if (HASH_KEY_IS_STRING == 
zend_hash_get_current_key_ex(Z_ARRVAL_P(options), wkey, wkey_len, num_key, 0, pos)
 Z_TYPE_PP(wval) == IS_ARRAY) {
 
zend_hash_internal_pointer_reset_ex(Z_ARRVAL_PP(wval), opos);
while (SUCCESS == 
zend_hash_get_current_data_ex(Z_ARRVAL_PP(wval), (void**)oval, opos)) {
 
-   if (HASH_KEY_IS_STRING == 
zend_hash_get_current_key_ex(Z_ARRVAL_PP(wval), okey, okey_len, NULL, 0, 

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

2003-06-19 Thread Ilia Alshanetsky
iliaa   Thu Jun 19 12:35:17 2003 EDT

  Modified files:  
/php4/ext/standard  streamsfuncs.c 
  Log:
  Fixed memory leak, when invalid context is specified.
  
  
Index: php4/ext/standard/streamsfuncs.c
diff -u php4/ext/standard/streamsfuncs.c:1.19 php4/ext/standard/streamsfuncs.c:1.20
--- php4/ext/standard/streamsfuncs.c:1.19   Thu Jun 19 12:10:54 2003
+++ php4/ext/standard/streamsfuncs.cThu Jun 19 12:35:17 2003
@@ -17,7 +17,7 @@
   +--+
 */
 
-/* $Id: streamsfuncs.c,v 1.19 2003/06/19 16:10:54 iliaa Exp $ */
+/* $Id: streamsfuncs.c,v 1.20 2003/06/19 16:35:17 iliaa Exp $ */
 
 #include php.h
 #include php_globals.h
@@ -669,10 +669,10 @@
 
 static int parse_context_params(php_stream_context *context, zval *params)
 {
-   int ret = SUCCESS;
+   int ret = FAILURE;
zval **tmp;
 
-   if (SUCCESS == zend_hash_find(Z_ARRVAL_P(params), notification, 
sizeof(notification), (void**)tmp)) {
+   if ((ret = zend_hash_find(Z_ARRVAL_P(params), notification, 
sizeof(notification), (void**)tmp)) == SUCCESS) {

if (context-notifier) {
php_stream_notification_free(context-notifier);
@@ -684,10 +684,14 @@
context-notifier-ptr = *tmp;
ZVAL_ADDREF(*tmp);
}
-   if (SUCCESS == zend_hash_find(Z_ARRVAL_P(params), options, 
sizeof(options), (void**)tmp)) {
+   if ((ret = zend_hash_find(Z_ARRVAL_P(params), options, sizeof(options), 
(void**)tmp)) == SUCCESS) {
parse_context_options(context, *tmp);
}
-   
+
+   if (ret != SUCCESS) {
+   php_stream_context_free(context);
+   }
+
return ret;
 }
 



-- 
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/standard file.c

2003-06-19 Thread Ilia Alshanetsky
iliaa   Thu Jun 19 12:35:29 2003 EDT

  Modified files:  (Branch: PHP_4_3)
/php4/ext/standard  file.c 
  Log:
  MFH: Fixed memory leak, when invalid context is specified.
  
  
Index: php4/ext/standard/file.c
diff -u php4/ext/standard/file.c:1.279.2.26 php4/ext/standard/file.c:1.279.2.27
--- php4/ext/standard/file.c:1.279.2.26 Thu Jun 19 12:10:37 2003
+++ php4/ext/standard/file.cThu Jun 19 12:35:29 2003
@@ -21,7 +21,7 @@
+--+
  */
 
-/* $Id: file.c,v 1.279.2.26 2003/06/19 16:10:37 iliaa Exp $ */
+/* $Id: file.c,v 1.279.2.27 2003/06/19 16:35:29 iliaa Exp $ */
 
 /* Synced with php 3.0 revision 1.218 1999-06-16 [ssb] */
 
@@ -905,10 +905,10 @@
 
 static int parse_context_params(php_stream_context *context, zval *params)
 {
-   int ret = SUCCESS;
+   int ret = FAILURE;
zval **tmp;
 
-   if (SUCCESS == zend_hash_find(Z_ARRVAL_P(params), notification, 
sizeof(notification), (void**)tmp)) {
+   if ((ret = zend_hash_find(Z_ARRVAL_P(params), notification, 
sizeof(notification), (void**)tmp)) == SUCCESS) {

if (context-notifier) {
php_stream_notification_free(context-notifier);
@@ -920,10 +920,14 @@
context-notifier-ptr = *tmp;
ZVAL_ADDREF(*tmp);
}
-   if (SUCCESS == zend_hash_find(Z_ARRVAL_P(params), options, 
sizeof(options), (void**)tmp)) {
+   if ((ret = zend_hash_find(Z_ARRVAL_P(params), options, sizeof(options), 
(void**)tmp)) == SUCCESS) {
parse_context_options(context, *tmp);
}
-   
+
+   if (ret != SUCCESS) {
+   php_stream_context_free(context);
+   }
+
return ret;
 }
 



-- 
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/standard info.c

2003-06-19 Thread Ilia Alshanetsky
iliaa   Thu Jun 19 12:43:41 2003 EDT

  Modified files:  (Branch: PHP_4_3)
/php4/ext/standard  info.c 
  Log:
  MFH (possible streams crash)
  
  
Index: php4/ext/standard/info.c
diff -u php4/ext/standard/info.c:1.218.2.12 php4/ext/standard/info.c:1.218.2.13
--- php4/ext/standard/info.c:1.218.2.12 Sun Apr 27 12:35:53 2003
+++ php4/ext/standard/info.cThu Jun 19 12:43:41 2003
@@ -18,7 +18,7 @@
+--+
 */
 
-/* $Id: info.c,v 1.218.2.12 2003/04/27 16:35:53 zeev Exp $ */
+/* $Id: info.c,v 1.218.2.13 2003/06/19 16:43:41 iliaa Exp $ */
 
 #include php.h
 #include php_ini.h
@@ -473,10 +473,11 @@
HashTable *url_stream_wrappers_hash;
char *stream_protocol, *stream_protocols_buf = NULL;
int stream_protocol_len, stream_protocols_buf_len = 0;
+   ulong num_key;
 
if ((url_stream_wrappers_hash = 
php_stream_get_url_stream_wrappers_hash())) {
for 
(zend_hash_internal_pointer_reset(url_stream_wrappers_hash);
-   
zend_hash_get_current_key_ex(url_stream_wrappers_hash, stream_protocol, 
stream_protocol_len, NULL, 0, NULL) == HASH_KEY_IS_STRING;
+   
zend_hash_get_current_key_ex(url_stream_wrappers_hash, stream_protocol, 
stream_protocol_len, num_key, 0, NULL) == HASH_KEY_IS_STRING;

zend_hash_move_forward(url_stream_wrappers_hash)) {
if (NULL == (stream_protocols_buf = 
erealloc(stream_protocols_buf,

stream_protocols_buf_len + stream_protocol_len + 2 /* ,  */ + 1 /* 0 byte at end 
*/))) {



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



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

2003-06-19 Thread Ilia Alshanetsky
iliaa   Thu Jun 19 17:04:43 2003 EDT

  Modified files:  
/php4/ext/standard  streamsfuncs.c 
  Log:
  Reverting previous patch (not necessary, thanks Pollita ;) )
  
  
Index: php4/ext/standard/streamsfuncs.c
diff -u php4/ext/standard/streamsfuncs.c:1.20 php4/ext/standard/streamsfuncs.c:1.21
--- php4/ext/standard/streamsfuncs.c:1.20   Thu Jun 19 12:35:17 2003
+++ php4/ext/standard/streamsfuncs.cThu Jun 19 17:04:43 2003
@@ -17,7 +17,7 @@
   +--+
 */
 
-/* $Id: streamsfuncs.c,v 1.20 2003/06/19 16:35:17 iliaa Exp $ */
+/* $Id: streamsfuncs.c,v 1.21 2003/06/19 21:04:43 iliaa Exp $ */
 
 #include php.h
 #include php_globals.h
@@ -669,10 +669,10 @@
 
 static int parse_context_params(php_stream_context *context, zval *params)
 {
-   int ret = FAILURE;
+   int ret = SUCCESS;
zval **tmp;
 
-   if ((ret = zend_hash_find(Z_ARRVAL_P(params), notification, 
sizeof(notification), (void**)tmp)) == SUCCESS) {
+   if (SUCCESS == zend_hash_find(Z_ARRVAL_P(params), notification, 
sizeof(notification), (void**)tmp)) {

if (context-notifier) {
php_stream_notification_free(context-notifier);
@@ -684,14 +684,10 @@
context-notifier-ptr = *tmp;
ZVAL_ADDREF(*tmp);
}
-   if ((ret = zend_hash_find(Z_ARRVAL_P(params), options, sizeof(options), 
(void**)tmp)) == SUCCESS) {
+   if (SUCCESS == zend_hash_find(Z_ARRVAL_P(params), options, 
sizeof(options), (void**)tmp)) {
parse_context_options(context, *tmp);
}
-
-   if (ret != SUCCESS) {
-   php_stream_context_free(context);
-   }
-
+   
return ret;
 }
 



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



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

2003-06-19 Thread Ilia Alshanetsky
iliaa   Thu Jun 19 18:12:21 2003 EDT

  Modified files:  
/php4/ext/curl  interface.c 
  Log:
  Added missing safe_mode checks.
  Added support for additional libcurl options.
  Set CURLOPT_NOSIGNAL by default for ZTS, for signal free operation.
  
  
Index: php4/ext/curl/interface.c
diff -u php4/ext/curl/interface.c:1.21 php4/ext/curl/interface.c:1.22
--- php4/ext/curl/interface.c:1.21  Wed Jun 18 17:02:02 2003
+++ php4/ext/curl/interface.c   Thu Jun 19 18:12:21 2003
@@ -16,7 +16,7 @@
+--+
 */
 
-/* $Id: interface.c,v 1.21 2003/06/18 21:02:02 sterling Exp $ */
+/* $Id: interface.c,v 1.22 2003/06/19 22:12:21 iliaa Exp $ */
 
 #define ZEND_INCLUDE_FULL_WINDOWS_HEADERS
 
@@ -201,8 +201,26 @@
REGISTER_CURL_CONSTANT(CURLOPT_SSLKEYPASSWD);
REGISTER_CURL_CONSTANT(CURLOPT_SSLENGINE);
REGISTER_CURL_CONSTANT(CURLOPT_SSLENGINE_DEFAULT);
+   REGISTER_CURL_CONSTANT(CURLOPT_SSLCERTTYPE);
REGISTER_CURL_CONSTANT(CURLOPT_CRLF);
REGISTER_CURL_CONSTANT(CURLOPT_ENCODING);
+   REGISTER_CURL_CONSTANT(CURLOPT_PROXYPORT);
+   REGISTER_CURL_CONSTANT(CURLPROXY_HTTP);
+   REGISTER_CURL_CONSTANT(CURLPROXY_SOCKS5);
+   REGISTER_CURL_CONSTANT(CURLOPT_UNRESTRICTED_AUTH);
+   REGISTER_CURL_CONSTANT(CURLOPT_FTP_USE_EPRT);
+   REGISTER_CURL_CONSTANT(CURLOPT_HTTP200ALIASES);
+
+#ifdef CURLOPT_HTTPAUTH /* only in curl 7.10.6 */
+   REGISTER_CURL_CONSTANT(CURLOPT_HTTPAUTH);
+   /* http authentication options */
+   REGISTER_CURL_CONSTANT(CURLHTTP_BASIC);
+   REGISTER_CURL_CONSTANT(CURLHTTP_DIGEST);
+   REGISTER_CURL_CONSTANT(CURLHTTP_GSSNEGOTIATE);
+   REGISTER_CURL_CONSTANT(CURLHTTP_NTLM);
+   REGISTER_CURL_CONSTANT(CURLHTTP_ANY);
+   REGISTER_CURL_CONSTANT(CURLHTTP_ANYSAFE);
+#endif

/* Constants effecting the way CURLOPT_CLOSEPOLICY works */
REGISTER_CURL_CONSTANT(CURLCLOSEPOLICY_LEAST_RECENTLY_USED);
@@ -699,6 +717,9 @@
curl_easy_setopt(ch-cp, CURLOPT_WRITEHEADER,   (void *) ch);
curl_easy_setopt(ch-cp, CURLOPT_DNS_USE_GLOBAL_CACHE, 1);
curl_easy_setopt(ch-cp, CURLOPT_DNS_CACHE_TIMEOUT, 120);
+#if defined(ZTS)
+   curl_easy_setopt(ch-cp, CURLOPT_NOSIGNAL, 1);
+#endif
 
if (argc  0) {
char *urlcopy;
@@ -773,6 +794,13 @@
case CURLOPT_HTTPGET:
case CURLOPT_HTTP_VERSION:
case CURLOPT_CRLF:
+   case CURLOPT_DNS_CACHE_TIMEOUT:
+   case CURLOPT_PROXYPORT:
+   case CURLOPT_FTP_USE_EPRT:
+#ifdef CURLOPT_HTTPAUTH /* only in curl 7.10.6 */
+   case CURLOPT_HTTPAUTH:
+#endif
+   case CURLOPT_UNRESTRICTED_AUTH:
case CURLOPT_PORT:
convert_to_long_ex(zvalue);
error = curl_easy_setopt(ch-cp, option, Z_LVAL_PP(zvalue));
@@ -786,22 +814,19 @@
case CURLOPT_USERAGENT:
case CURLOPT_FTPPORT:
case CURLOPT_COOKIE:
-   case CURLOPT_COOKIEFILE:
case CURLOPT_REFERER:
case CURLOPT_INTERFACE:
case CURLOPT_KRB4LEVEL: 
-   case CURLOPT_RANDOM_FILE:
case CURLOPT_EGDSOCKET:
case CURLOPT_CAINFO: 
case CURLOPT_CAPATH:
-   case CURLOPT_COOKIEJAR:
case CURLOPT_SSL_CIPHER_LIST: 
case CURLOPT_SSLKEY:
-   case CURLOPT_SSLCERT:
case CURLOPT_SSLKEYTYPE: 
case CURLOPT_SSLKEYPASSWD: 
case CURLOPT_SSLENGINE: 
case CURLOPT_SSLENGINE_DEFAULT:
+   case CURLOPT_SSLCERTTYPE:
case CURLOPT_ENCODING: {
char *copystr = NULL;

@@ -969,6 +994,7 @@
break;
case CURLOPT_HTTPHEADER: 
case CURLOPT_QUOTE:
+   case CURLOPT_HTTP200ALIASES:
case CURLOPT_POSTQUOTE: {
zval  **current;
HashTable  *ph;
@@ -976,7 +1002,7 @@
 
ph = HASH_OF(*zvalue);
if (!ph) {
-   php_error_docref(NULL TSRMLS_CC, E_WARNING, You must 
pass either an object or an array with the CURLOPT_HTTPHEADER, CURLOPT_QUOTE and 
CURLOPT_POSTQUOTE arguments);
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, You must 
pass either an object or an array with the CURLOPT_HTTPHEADER, CURLOPT_QUOTE, 
CURLOPT_HTTP200ALIASES and CURLOPT_POSTQUOTE arguments);
RETURN_FALSE;
}
 
@@ -1001,6 +1027,28 @@
zend_llist_add_element(ch-to_free.slist, slist);
 
error = curl_easy_setopt(ch-cp, option, slist);
+
+

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

2003-06-19 Thread Ilia Alshanetsky
iliaa   Thu Jun 19 18:18:58 2003 EDT

  Modified files:  (Branch: PHP_4_3)
/php4/ext/curl  curl.c 
  Log:
  Added missing safe_mode checks
  
  
Index: php4/ext/curl/curl.c
diff -u php4/ext/curl/curl.c:1.124.2.11 php4/ext/curl/curl.c:1.124.2.12
--- php4/ext/curl/curl.c:1.124.2.11 Thu Jun 12 08:28:30 2003
+++ php4/ext/curl/curl.cThu Jun 19 18:18:58 2003
@@ -16,7 +16,7 @@
+--+
 */
 
-/* $Id: curl.c,v 1.124.2.11 2003/06/12 12:28:30 andrey Exp $ */
+/* $Id: curl.c,v 1.124.2.12 2003/06/19 22:18:58 iliaa Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -729,20 +729,16 @@
case CURLOPT_USERAGENT:
case CURLOPT_FTPPORT:
case CURLOPT_COOKIE:
-   case CURLOPT_COOKIEFILE:
case CURLOPT_REFERER:
case CURLOPT_INTERFACE:
case CURLOPT_KRB4LEVEL: 
-   case CURLOPT_RANDOM_FILE:
case CURLOPT_EGDSOCKET:
case CURLOPT_CAINFO: 
case CURLOPT_CAPATH:
-   case CURLOPT_COOKIEJAR:
case CURLOPT_SSL_CIPHER_LIST: 
case CURLOPT_SSLKEY:
-   case CURLOPT_SSLCERT:
case CURLOPT_SSLKEYTYPE: 
-   case CURLOPT_SSLKEYPASSWD: 
+   case CURLOPT_SSLKEYPASSWD:
case CURLOPT_SSLENGINE: 
 #ifdef CURLOPT_ENCODING
case CURLOPT_ENCODING: 
@@ -953,6 +949,28 @@
zend_llist_add_element(ch-to_free.slist, slist);
 
error = curl_easy_setopt(ch-cp, option, slist);
+
+   break;
+   }
+   /* the following options deal with files, therefor safe_mode  
open_basedir checks
+* are required.
+*/
+   case CURLOPT_COOKIEJAR:
+   case CURLOPT_SSLCERT:
+   case CURLOPT_RANDOM_FILE:
+   case CURLOPT_COOKIEFILE: {
+   char *copystr = NULL;
+
+   convert_to_string_ex(zvalue);
+
+   if (php_check_open_basedir(Z_STRVAL_PP(zvalue) TSRMLS_CC) || 
(PG(safe_mode)  !php_checkuid(Z_STRVAL_PP(zvalue), rb+, 
CHECKUID_CHECK_MODE_PARAM))) {
+   RETURN_FALSE;   
+   }
+
+   copystr = estrndup(Z_STRVAL_PP(zvalue), Z_STRLEN_PP(zvalue));
+
+   error = curl_easy_setopt(ch-cp, option, copystr);
+   zend_llist_add_element(ch-to_free.str, copystr);
 
break;
}



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



[PHP-CVS] cvs: php4(PHP_4_3) /main main.c

2003-06-20 Thread Ilia Alshanetsky
iliaa   Fri Jun 20 13:00:16 2003 EDT

  Modified files:  (Branch: PHP_4_3)
/php4/main  main.c 
  Log:
  Fixed bug #24253 (missing variables when register_globals is on)
  Fixed a memory leak when more then 1 E|S flag is passed to gpc_order.
  Fixed a memory leak when variables_order is not set and gpc_order has S|s
  flag.
  Optimized out duplicate parsing of the variables order string.
  
  
Index: php4/main/main.c
diff -u php4/main/main.c:1.512.2.41 php4/main/main.c:1.512.2.42
--- php4/main/main.c:1.512.2.41 Tue Jun 17 13:15:16 2003
+++ php4/main/main.cFri Jun 20 13:00:16 2003
@@ -18,7 +18,7 @@
+--+
 */
 
-/* $Id: main.c,v 1.512.2.41 2003/06/17 17:15:16 iliaa Exp $ */
+/* $Id: main.c,v 1.512.2.42 2003/06/20 17:00:16 iliaa Exp $ */
 
 /* {{{ includes
  */
@@ -134,7 +134,6 @@
 
 #define NUM_TRACK_VARS (sizeof(short_track_vars_names_length)/sizeof(int))
 
-
 #define SAFE_FILENAME(f) ((f)?(f):-)
 
 /* {{{ PHP_INI_MH
@@ -1362,7 +1361,7 @@
 static int php_hash_environment(TSRMLS_D)
 {
char *p;
-   unsigned char _gpc_flags[3] = {0, 0, 0};
+   int _gpc_flags[5] = {0, 0, 0, 0, 0};
zend_bool have_variables_order;
zval *dummy_track_vars_array = NULL;
zend_bool initialized_dummy_track_vars_array=0;
@@ -1409,42 +1408,48 @@
case 'P':
if (!_gpc_flags[0]  !SG(headers_sent)  
SG(request_info).request_method  !strcmp(SG(request_info).request_method, POST)) {
sapi_module.treat_data(PARSE_POST, NULL, NULL 
TSRMLS_CC);   /* POST Data */
-   _gpc_flags[0]=1;
+   _gpc_flags[0]=TRACK_VARS_POST + 1;
}
break;
case 'c':
case 'C':
if (!_gpc_flags[1]) {
sapi_module.treat_data(PARSE_COOKIE, NULL, 
NULL TSRMLS_CC); /* Cookie Data */
-   _gpc_flags[1]=1;
+   _gpc_flags[1]=TRACK_VARS_COOKIE + 1;
}
break;
case 'g':
case 'G':
if (!_gpc_flags[2]) {
sapi_module.treat_data(PARSE_GET, NULL, NULL 
TSRMLS_CC);/* GET Data */
-   _gpc_flags[2]=1;
+   _gpc_flags[2]=TRACK_VARS_GET + 1;
}
break;
case 'e':
case 'E':
-   if (have_variables_order) {
-   ALLOC_ZVAL(PG(http_globals)[TRACK_VARS_ENV]);
-   array_init(PG(http_globals)[TRACK_VARS_ENV]);
-   INIT_PZVAL(PG(http_globals)[TRACK_VARS_ENV]);
-   
php_import_environment_variables(PG(http_globals)[TRACK_VARS_ENV] TSRMLS_CC);
-   } else {
-   php_error_docref(NULL TSRMLS_CC, E_WARNING, 
Unsupported 'e' element (environment) used in gpc_order - use variables_order 
instead);
+   if (!_gpc_flags[3]) {
+   if (have_variables_order) {
+   
ALLOC_ZVAL(PG(http_globals)[TRACK_VARS_ENV]);
+   
array_init(PG(http_globals)[TRACK_VARS_ENV]);
+   
INIT_PZVAL(PG(http_globals)[TRACK_VARS_ENV]);
+   
php_import_environment_variables(PG(http_globals)[TRACK_VARS_ENV] TSRMLS_CC);
+   } else {
+   php_error_docref(NULL TSRMLS_CC, 
E_WARNING, Unsupported 'e' element (environment) used in gpc_order - use 
variables_order instead);
+   }
+   _gpc_flags[3]=TRACK_VARS_ENV + 1;
}
break;
case 's':
case 'S':
-   php_register_server_variables(TSRMLS_C);
+   if (!_gpc_flags[4]) {
+   php_register_server_variables(TSRMLS_C);
+   _gpc_flags[4]=TRACK_VARS_SERVER + 1;
+   }
break;
}
}
 
-   if (!have_variables_order) {
+   if (!have_variables_order  

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

2003-06-22 Thread Ilia Alshanetsky
iliaa   Sun Jun 22 12:46:24 2003 EDT

  Modified files:  
/php4/ext/pgsql pgsql.c 
  Log:
  Fixed bug #24284 (Fixed memory leak inside pg_ping())
  
  
Index: php4/ext/pgsql/pgsql.c
diff -u php4/ext/pgsql/pgsql.c:1.276 php4/ext/pgsql/pgsql.c:1.277
--- php4/ext/pgsql/pgsql.c:1.276Tue Jun 10 16:03:34 2003
+++ php4/ext/pgsql/pgsql.c  Sun Jun 22 12:46:24 2003
@@ -19,7 +19,7 @@
+--+
  */
  
-/* $Id: pgsql.c,v 1.276 2003/06/10 20:03:34 imajes Exp $ */
+/* $Id: pgsql.c,v 1.277 2003/06/22 16:46:24 iliaa Exp $ */
 
 #include stdlib.h
 
@@ -865,6 +865,7 @@
zval *pgsql_link = NULL;
int id = -1;
PGconn *pgsql;
+   PGresult *res;
 
if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() 
TSRMLS_CC, r,
 pgsql_link) == 
FAILURE) {
@@ -874,7 +875,8 @@
ZEND_FETCH_RESOURCE2(pgsql, PGconn *, pgsql_link, id, PostgreSQL link, 
le_link, le_plink);
 
/* ping connection */
-   PQexec(pgsql, SELECT 1;);
+   res = PQexec(pgsql, SELECT 1;);
+   PQclear(res);
 
/* check status. */
if (PQstatus(pgsql) == CONNECTION_OK)



-- 
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 /ext/pgsql pgsql.c

2003-06-22 Thread Ilia Alshanetsky
iliaa   Sun Jun 22 12:48:17 2003 EDT

  Modified files:  (Branch: PHP_4_3)
/php4   NEWS 
/php4/ext/pgsql pgsql.c 
  Log:
  MFH: Fixed bug #24284 (Fixed memory leak inside pg_ping())
  
  
Index: php4/NEWS
diff -u php4/NEWS:1.1247.2.262 php4/NEWS:1.1247.2.263
--- php4/NEWS:1.1247.2.262  Wed Jun 18 19:24:13 2003
+++ php4/NEWS   Sun Jun 22 12:48:16 2003
@@ -1,7 +1,7 @@
 PHP 4  NEWS
 |||
 26 Jun 2003, Version 4.3.3RC2
-- dummy (remove when first entry is added)
+- Fixed bug #24284 (Fixed memory leak inside pg_ping()). (Ilia)
 
 19 Jun 2003, Version 4.3.3RC1
 - Synchronized bundled GD library with GD 2.0.15. (Ilia)
Index: php4/ext/pgsql/pgsql.c
diff -u php4/ext/pgsql/pgsql.c:1.244.2.18 php4/ext/pgsql/pgsql.c:1.244.2.19
--- php4/ext/pgsql/pgsql.c:1.244.2.18   Sat May 31 08:59:19 2003
+++ php4/ext/pgsql/pgsql.c  Sun Jun 22 12:48:16 2003
@@ -19,7 +19,7 @@
+--+
  */
  
-/* $Id: pgsql.c,v 1.244.2.18 2003/05/31 12:59:19 helly Exp $ */
+/* $Id: pgsql.c,v 1.244.2.19 2003/06/22 16:48:16 iliaa Exp $ */
 
 #include stdlib.h
 
@@ -865,6 +865,7 @@
zval *pgsql_link = NULL;
int id = -1;
PGconn *pgsql;
+   PGresult *res;
 
if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() 
TSRMLS_CC, r,
 pgsql_link) == 
FAILURE) {
@@ -874,7 +875,8 @@
ZEND_FETCH_RESOURCE2(pgsql, PGconn *, pgsql_link, id, PostgreSQL link, 
le_link, le_plink);
 
/* ping connection */
-   PQexec(pgsql, SELECT 1;);
+   res = PQexec(pgsql, SELECT 1;);
+   PQclear(res);
 
/* check status. */
if (PQstatus(pgsql) == CONNECTION_OK)



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



[PHP-CVS] cvs: php-src(PHP_5) /ext/standard filestat.c /ext/standard/tests/file bug24313.phpt /main fopen_wrappers.c fopen_wrappers.h

2003-06-24 Thread Ilia Alshanetsky
iliaa   Tue Jun 24 09:42:45 2003 EDT

  Added files: (Branch: PHP_5)
/php-src/ext/standard/tests/filebug24313.phpt 

  Modified files:  
/php-src/main   fopen_wrappers.h fopen_wrappers.c 
/php-src/ext/standard   filestat.c 
  Log:
  Fixed bug #24313 (file_exist() warning on non-existent files when 
  open_basedir is used).
  
  
Index: php-src/main/fopen_wrappers.h
diff -u php-src/main/fopen_wrappers.h:1.41 php-src/main/fopen_wrappers.h:1.41.2.1
--- php-src/main/fopen_wrappers.h:1.41  Tue Jun 10 16:03:41 2003
+++ php-src/main/fopen_wrappers.h   Tue Jun 24 09:42:45 2003
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: fopen_wrappers.h,v 1.41 2003/06/10 20:03:41 imajes Exp $ */
+/* $Id: fopen_wrappers.h,v 1.41.2.1 2003/06/24 13:42:45 iliaa Exp $ */
 
 #ifndef FOPEN_WRAPPERS_H
 #define FOPEN_WRAPPERS_H
@@ -28,6 +28,7 @@
 PHPAPI char *expand_filepath(const char *filepath, char *real_path TSRMLS_DC);
 
 PHPAPI int php_check_open_basedir(const char *path TSRMLS_DC);
+PHPAPI int php_check_open_basedir_ex(const char *path, int warn TSRMLS_DC);
 PHPAPI int php_check_specific_open_basedir(const char *basedir, const char *path 
TSRMLS_DC);
 
 PHPAPI int php_check_safe_mode_include_dir(char *path TSRMLS_DC);
Index: php-src/main/fopen_wrappers.c
diff -u php-src/main/fopen_wrappers.c:1.162 php-src/main/fopen_wrappers.c:1.162.2.1
--- php-src/main/fopen_wrappers.c:1.162 Tue Jun 10 16:03:41 2003
+++ php-src/main/fopen_wrappers.c   Tue Jun 24 09:42:45 2003
@@ -17,7 +17,7 @@
+--+
  */
 
-/* $Id: fopen_wrappers.c,v 1.162 2003/06/10 20:03:41 imajes Exp $ */
+/* $Id: fopen_wrappers.c,v 1.162.2.1 2003/06/24 13:42:45 iliaa Exp $ */
 
 /* {{{ includes
  */
@@ -162,9 +162,14 @@
 }
 /* }}} */
 
+PHPAPI int php_check_open_basedir(const char *path TSRMLS_DC)
+{
+   return php_check_open_basedir_ex(path, 1 TSRMLS_DC);
+}
+
 /* {{{ php_check_open_basedir
  */
-PHPAPI int php_check_open_basedir(const char *path TSRMLS_DC)
+PHPAPI int php_check_open_basedir_ex(const char *path, int warn TSRMLS_DC)
 {
/* Only check when open_basedir is available */
if (PG(open_basedir)  *PG(open_basedir)) {
@@ -190,8 +195,10 @@
 
ptr = end;
}
-   php_error_docref(NULL TSRMLS_CC, E_WARNING, 
-   open_basedir restriction in effect. File(%s) is not within 
the allowed path(s): (%s), path, PG(open_basedir));
+   if (warn) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, 
+   open_basedir restriction in effect. File(%s) is not 
within the allowed path(s): (%s), path, PG(open_basedir));
+   }
efree(pathbuf);
errno = EPERM; /* we deny permission to open it */
return -1;
Index: php-src/ext/standard/filestat.c
diff -u php-src/ext/standard/filestat.c:1.122 php-src/ext/standard/filestat.c:1.122.2.1
--- php-src/ext/standard/filestat.c:1.122   Tue Jun 10 16:03:37 2003
+++ php-src/ext/standard/filestat.c Tue Jun 24 09:42:45 2003
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: filestat.c,v 1.122 2003/06/10 20:03:37 imajes Exp $ */
+/* $Id: filestat.c,v 1.122.2.1 2003/06/24 13:42:45 iliaa Exp $ */
 
 #include php.h
 #include safe_mode.h
@@ -572,7 +572,7 @@
RETURN_FALSE;
}
 
-   if (php_check_open_basedir(filename TSRMLS_CC)) {
+   if (php_check_open_basedir_ex(filename, IS_EXISTS_CHECK(type) ? 0 : 1 
TSRMLS_CC)) {
RETURN_FALSE;
}
 

Index: php-src/ext/standard/tests/file/bug24313.phpt
+++ php-src/ext/standard/tests/file/bug24313.phpt



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



[PHP-CVS] cvs: php-src(PHP_4_3) / NEWS /ext/standard filestat.c /ext/standard/tests/file bug24313.phpt /main fopen_wrappers.c fopen_wrappers.h

2003-06-24 Thread Ilia Alshanetsky
iliaa   Tue Jun 24 09:44:57 2003 EDT

  Added files: (Branch: PHP_4_3)
/php-src/ext/standard/tests/filebug24313.phpt 

  Modified files:  
/php-src/main   fopen_wrappers.h fopen_wrappers.c 
/php-src/ext/standard   filestat.c 
/php-srcNEWS 
  Log:
  MFH: Fixed bug #24313 (file_exist() warning on non-existent files when 
  open_basedir is used).
  
  
Index: php-src/main/fopen_wrappers.h
diff -u php-src/main/fopen_wrappers.h:1.38.4.1 php-src/main/fopen_wrappers.h:1.38.4.2
--- php-src/main/fopen_wrappers.h:1.38.4.1  Tue Dec 31 11:25:14 2002
+++ php-src/main/fopen_wrappers.h   Tue Jun 24 09:44:56 2003
@@ -15,7 +15,7 @@
| Author: Jim Winstead [EMAIL PROTECTED]  |
+--+
  */
-/* $Id: fopen_wrappers.h,v 1.38.4.1 2002/12/31 16:25:14 sebastian Exp $ */
+/* $Id: fopen_wrappers.h,v 1.38.4.2 2003/06/24 13:44:56 iliaa Exp $ */
 
 #ifndef FOPEN_WRAPPERS_H
 #define FOPEN_WRAPPERS_H
@@ -27,6 +27,7 @@
 PHPAPI char *expand_filepath(const char *filepath, char *real_path TSRMLS_DC);
 
 PHPAPI int php_check_open_basedir(const char *path TSRMLS_DC);
+PHPAPI int php_check_open_basedir_ex(const char *path, int warn TSRMLS_DC);
 PHPAPI int php_check_specific_open_basedir(const char *basedir, const char *path 
TSRMLS_DC);
 
 PHPAPI int php_check_safe_mode_include_dir(char *path TSRMLS_DC);
Index: php-src/main/fopen_wrappers.c
diff -u php-src/main/fopen_wrappers.c:1.153.2.3 php-src/main/fopen_wrappers.c:1.153.2.4
--- php-src/main/fopen_wrappers.c:1.153.2.3 Sun Feb 23 17:03:54 2003
+++ php-src/main/fopen_wrappers.c   Tue Jun 24 09:44:56 2003
@@ -16,7 +16,7 @@
|  Jim Winstead [EMAIL PROTECTED] |
+--+
  */
-/* $Id: fopen_wrappers.c,v 1.153.2.3 2003/02/23 22:03:54 rasmus Exp $ */
+/* $Id: fopen_wrappers.c,v 1.153.2.4 2003/06/24 13:44:56 iliaa Exp $ */
 
 /* {{{ includes
  */
@@ -163,9 +163,14 @@
 }
 /* }}} */
 
+PHPAPI int php_check_open_basedir(const char *path TSRMLS_DC)
+{
+   return php_check_open_basedir_ex(path, 1 TSRMLS_DC);
+}
+
 /* {{{ php_check_open_basedir
  */
-PHPAPI int php_check_open_basedir(const char *path TSRMLS_DC)
+PHPAPI int php_check_open_basedir_ex(const char *path, int warn TSRMLS_DC)
 {
/* Only check when open_basedir is available */
if (PG(open_basedir)  *PG(open_basedir)) {
@@ -191,8 +196,10 @@
 
ptr = end;
}
-   php_error_docref(NULL TSRMLS_CC, E_WARNING, 
-   open_basedir restriction in effect. File(%s) is not within 
the allowed path(s): (%s), path, PG(open_basedir));
+   if (warn) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, 
+   open_basedir restriction in effect. File(%s) is not 
within the allowed path(s): (%s), path, PG(open_basedir));
+   }
efree(pathbuf);
errno = EPERM; /* we deny permission to open it */
return -1;
Index: php-src/ext/standard/filestat.c
diff -u php-src/ext/standard/filestat.c:1.112.2.6 
php-src/ext/standard/filestat.c:1.112.2.7
--- php-src/ext/standard/filestat.c:1.112.2.6   Tue Apr 22 22:37:29 2003
+++ php-src/ext/standard/filestat.c Tue Jun 24 09:44:57 2003
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: filestat.c,v 1.112.2.6 2003/04/23 02:37:29 iliaa Exp $ */
+/* $Id: filestat.c,v 1.112.2.7 2003/06/24 13:44:57 iliaa Exp $ */
 
 #include php.h
 #include safe_mode.h
@@ -572,7 +572,7 @@
RETURN_FALSE;
}
 
-   if (php_check_open_basedir(filename TSRMLS_CC)) {
+   if (php_check_open_basedir_ex(filename, IS_EXISTS_CHECK(type) ? 0 : 1 
TSRMLS_CC)) {
RETURN_FALSE;
}
 
Index: php-src/NEWS
diff -u php-src/NEWS:1.1247.2.264 php-src/NEWS:1.1247.2.265
--- php-src/NEWS:1.1247.2.264   Mon Jun 23 21:03:07 2003
+++ php-src/NEWSTue Jun 24 09:44:57 2003
@@ -2,6 +2,8 @@
 |||
 
 26 Jun 2003, Version 4.3.3RC2
+- Fixed bug #24313 (file_exist() warning on non-existent files
+  when open_basedir is used). (Ilia)
 - Fixed bug #24284 (Fixed memory leak inside pg_ping()). (Ilia)
 
 19 Jun 2003, Version 4.3.3RC1

Index: php-src/ext/standard/tests/file/bug24313.phpt
+++ php-src/ext/standard/tests/file/bug24313.phpt



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



[PHP-CVS] cvs: php-src /ext/standard filestat.c /ext/standard/tests/file bug24313.phpt /main fopen_wrappers.c fopen_wrappers.h

2003-06-24 Thread Ilia Alshanetsky
iliaa   Tue Jun 24 09:56:25 2003 EDT

  Modified files:  
/php-src/main   fopen_wrappers.h fopen_wrappers.c 
/php-src/ext/standard   filestat.c 
/php-src/ext/standard/tests/filebug24313.phpt 
  Log:
  Fix for bug #24313 (port from dead PHP_5 branch)
  
  
Index: php-src/main/fopen_wrappers.h
diff -u php-src/main/fopen_wrappers.h:1.41 php-src/main/fopen_wrappers.h:1.42
--- php-src/main/fopen_wrappers.h:1.41  Tue Jun 10 16:03:41 2003
+++ php-src/main/fopen_wrappers.h   Tue Jun 24 09:56:25 2003
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: fopen_wrappers.h,v 1.41 2003/06/10 20:03:41 imajes Exp $ */
+/* $Id: fopen_wrappers.h,v 1.42 2003/06/24 13:56:25 iliaa Exp $ */
 
 #ifndef FOPEN_WRAPPERS_H
 #define FOPEN_WRAPPERS_H
@@ -28,6 +28,7 @@
 PHPAPI char *expand_filepath(const char *filepath, char *real_path TSRMLS_DC);
 
 PHPAPI int php_check_open_basedir(const char *path TSRMLS_DC);
+PHPAPI int php_check_open_basedir_ex(const char *path, int warn TSRMLS_DC);
 PHPAPI int php_check_specific_open_basedir(const char *basedir, const char *path 
TSRMLS_DC);
 
 PHPAPI int php_check_safe_mode_include_dir(char *path TSRMLS_DC);
Index: php-src/main/fopen_wrappers.c
diff -u php-src/main/fopen_wrappers.c:1.162 php-src/main/fopen_wrappers.c:1.163
--- php-src/main/fopen_wrappers.c:1.162 Tue Jun 10 16:03:41 2003
+++ php-src/main/fopen_wrappers.c   Tue Jun 24 09:56:25 2003
@@ -17,7 +17,7 @@
+--+
  */
 
-/* $Id: fopen_wrappers.c,v 1.162 2003/06/10 20:03:41 imajes Exp $ */
+/* $Id: fopen_wrappers.c,v 1.163 2003/06/24 13:56:25 iliaa Exp $ */
 
 /* {{{ includes
  */
@@ -162,9 +162,14 @@
 }
 /* }}} */
 
+PHPAPI int php_check_open_basedir(const char *path TSRMLS_DC)
+{
+   return php_check_open_basedir_ex(path, 1 TSRMLS_DC);
+}
+
 /* {{{ php_check_open_basedir
  */
-PHPAPI int php_check_open_basedir(const char *path TSRMLS_DC)
+PHPAPI int php_check_open_basedir_ex(const char *path, int warn TSRMLS_DC)
 {
/* Only check when open_basedir is available */
if (PG(open_basedir)  *PG(open_basedir)) {
@@ -190,8 +195,10 @@
 
ptr = end;
}
-   php_error_docref(NULL TSRMLS_CC, E_WARNING, 
-   open_basedir restriction in effect. File(%s) is not within 
the allowed path(s): (%s), path, PG(open_basedir));
+   if (warn) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, 
+   open_basedir restriction in effect. File(%s) is not 
within the allowed path(s): (%s), path, PG(open_basedir));
+   }
efree(pathbuf);
errno = EPERM; /* we deny permission to open it */
return -1;
Index: php-src/ext/standard/filestat.c
diff -u php-src/ext/standard/filestat.c:1.122 php-src/ext/standard/filestat.c:1.123
--- php-src/ext/standard/filestat.c:1.122   Tue Jun 10 16:03:37 2003
+++ php-src/ext/standard/filestat.c Tue Jun 24 09:56:25 2003
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: filestat.c,v 1.122 2003/06/10 20:03:37 imajes Exp $ */
+/* $Id: filestat.c,v 1.123 2003/06/24 13:56:25 iliaa Exp $ */
 
 #include php.h
 #include safe_mode.h
@@ -572,7 +572,7 @@
RETURN_FALSE;
}
 
-   if (php_check_open_basedir(filename TSRMLS_CC)) {
+   if (php_check_open_basedir_ex(filename, IS_EXISTS_CHECK(type) ? 0 : 1 
TSRMLS_CC)) {
RETURN_FALSE;
}
 
Index: php-src/ext/standard/tests/file/bug24313.phpt
diff -u /dev/null php-src/ext/standard/tests/file/bug24313.phpt:1.2
--- /dev/null   Tue Jun 24 09:56:25 2003
+++ php-src/ext/standard/tests/file/bug24313.phpt   Tue Jun 24 09:56:25 2003
@@ -0,0 +1,10 @@
+--TEST--
+Bug #24313: file_exists() warning on non-existant files when is open_basedir enabled
+--INI--
+open_basedir=/tmp
+--FILE--
+?php
+   var_dump(file_exists(./foobar));
+?
+--EXPECT--
+bool(false)



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



[PHP-CVS] cvs: php-src /main fopen_wrappers.c

2003-06-24 Thread Ilia Alshanetsky
iliaa   Tue Jun 24 10:36:01 2003 EDT

  Modified files:  
/php-src/main   fopen_wrappers.c 
  Log:
  Fixed typo.
  
  
Index: php-src/main/fopen_wrappers.c
diff -u php-src/main/fopen_wrappers.c:1.163 php-src/main/fopen_wrappers.c:1.164
--- php-src/main/fopen_wrappers.c:1.163 Tue Jun 24 09:56:25 2003
+++ php-src/main/fopen_wrappers.c   Tue Jun 24 10:36:01 2003
@@ -17,7 +17,7 @@
+--+
  */
 
-/* $Id: fopen_wrappers.c,v 1.163 2003/06/24 13:56:25 iliaa Exp $ */
+/* $Id: fopen_wrappers.c,v 1.164 2003/06/24 14:36:01 iliaa Exp $ */
 
 /* {{{ includes
  */
@@ -164,7 +164,7 @@
 
 PHPAPI int php_check_open_basedir(const char *path TSRMLS_DC)
 {
-   return php_check_open_basedir_ex(path, 1 TSRMLS_DC);
+   return php_check_open_basedir_ex(path, 1 TSRMLS_CC);
 }
 
 /* {{{ php_check_open_basedir



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



[PHP-CVS] cvs: php-src(PHP_4_3) /main fopen_wrappers.c

2003-06-24 Thread Ilia Alshanetsky
iliaa   Tue Jun 24 10:36:18 2003 EDT

  Modified files:  (Branch: PHP_4_3)
/php-src/main   fopen_wrappers.c 
  Log:
  MFH: typo fix.
  
  
Index: php-src/main/fopen_wrappers.c
diff -u php-src/main/fopen_wrappers.c:1.153.2.4 php-src/main/fopen_wrappers.c:1.153.2.5
--- php-src/main/fopen_wrappers.c:1.153.2.4 Tue Jun 24 09:44:56 2003
+++ php-src/main/fopen_wrappers.c   Tue Jun 24 10:36:18 2003
@@ -16,7 +16,7 @@
|  Jim Winstead [EMAIL PROTECTED] |
+--+
  */
-/* $Id: fopen_wrappers.c,v 1.153.2.4 2003/06/24 13:44:56 iliaa Exp $ */
+/* $Id: fopen_wrappers.c,v 1.153.2.5 2003/06/24 14:36:18 iliaa Exp $ */
 
 /* {{{ includes
  */
@@ -165,7 +165,7 @@
 
 PHPAPI int php_check_open_basedir(const char *path TSRMLS_DC)
 {
-   return php_check_open_basedir_ex(path, 1 TSRMLS_DC);
+   return php_check_open_basedir_ex(path, 1 TSRMLS_CC);
 }
 
 /* {{{ php_check_open_basedir



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



[PHP-CVS] cvs: php-src /ext/standard base64.c /ext/standard/tests/strings bug24312.phpt

2003-06-24 Thread Ilia Alshanetsky
iliaa   Tue Jun 24 11:23:17 2003 EDT

  Added files: 
/php-src/ext/standard/tests/strings bug24312.phpt 

  Modified files:  
/php-src/ext/standard   base64.c 
  Log:
  Fixed bug #24312 (base64_decode() does not skip 0xF0-0xFF characters)
  Patch by: gereon.steffens[at]onvista.de
  
  
Index: php-src/ext/standard/base64.c
diff -u php-src/ext/standard/base64.c:1.39 php-src/ext/standard/base64.c:1.40
--- php-src/ext/standard/base64.c:1.39  Tue Jun 10 16:03:37 2003
+++ php-src/ext/standard/base64.c   Tue Jun 24 11:23:17 2003
@@ -15,7 +15,7 @@
| Author: Jim Winstead [EMAIL PROTECTED]  |
+--+
  */
-/* $Id: base64.c,v 1.39 2003/06/10 20:03:37 imajes Exp $ */
+/* $Id: base64.c,v 1.40 2003/06/24 15:23:17 iliaa Exp $ */
 
 #include string.h
 
@@ -42,6 +42,7 @@
15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1,
-1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, -1, -1, -1, -1,
+   -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,

Index: php-src/ext/standard/tests/strings/bug24312.phpt
+++ php-src/ext/standard/tests/strings/bug24312.phpt
--TEST--
Bug #24208 (base64_decode() not skipping 0xF0 - 0xFF)
--FILE--
?php
$data = str_repeat(a, 100);
for ($i = 0xF0; $i  0xFF + 1; $i++) {
$enc = chunk_split(base64_encode($data), 10, chr($i));
var_dump(base64_decode($enc));
}
?
--EXPECT--
string(100) 

string(100) 

string(100) 

string(100) 

string(100) 

string(100) 

string(100) 

string(100) 

string(100) 

string(100) 

string(100) 

string(100) 

string(100) 

string(100) 

string(100) 

string(100) 




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



[PHP-CVS] cvs: php-src(PHP_4_3) / NEWS /ext/standard base64.c /ext/standard/tests/strings bug24312.phpt

2003-06-24 Thread Ilia Alshanetsky
iliaa   Tue Jun 24 11:26:10 2003 EDT

  Added files: (Branch: PHP_4_3)
/php-src/ext/standard/tests/strings bug24312.phpt 

  Modified files:  
/php-src/ext/standard   base64.c 
/php-srcNEWS 
  Log:
  MFH: Fixed bug #24312 (base64_decode() does not skip 0xF0-0xFF characters)
  
  
Index: php-src/ext/standard/base64.c
diff -u php-src/ext/standard/base64.c:1.33.4.3 php-src/ext/standard/base64.c:1.33.4.4
--- php-src/ext/standard/base64.c:1.33.4.3  Wed Jun  4 10:42:04 2003
+++ php-src/ext/standard/base64.c   Tue Jun 24 11:26:10 2003
@@ -15,7 +15,7 @@
| Author: Jim Winstead [EMAIL PROTECTED]  |
+--+
  */
-/* $Id: base64.c,v 1.33.4.3 2003/06/04 14:42:04 moriyoshi Exp $ */
+/* $Id: base64.c,v 1.33.4.4 2003/06/24 15:26:10 iliaa Exp $ */
 
 #include string.h
 
@@ -42,6 +42,7 @@
15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1,
-1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, -1, -1, -1, -1,
+   -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
Index: php-src/NEWS
diff -u php-src/NEWS:1.1247.2.265 php-src/NEWS:1.1247.2.266
--- php-src/NEWS:1.1247.2.265   Tue Jun 24 09:44:57 2003
+++ php-src/NEWSTue Jun 24 11:26:10 2003
@@ -2,6 +2,8 @@
 |||
 
 26 Jun 2003, Version 4.3.3RC2
+- Fixed bug #24312 (base64_decode() does not skip 0xF0-0xFF characters).
+  (gereon.steffens[at]onvista.de, Ilia)
 - Fixed bug #24313 (file_exist() warning on non-existent files
   when open_basedir is used). (Ilia)
 - Fixed bug #24284 (Fixed memory leak inside pg_ping()). (Ilia)

Index: php-src/ext/standard/tests/strings/bug24312.phpt
+++ php-src/ext/standard/tests/strings/bug24312.phpt
--TEST--
Bug #24208 (base64_decode() not skipping 0xF0 - 0xFF)
--FILE--
?php
$data = str_repeat(a, 100);
for ($i = 0xF0; $i  0xFF + 1; $i++) {
$enc = chunk_split(base64_encode($data), 10, chr($i));
var_dump(base64_decode($enc));
}
?
--EXPECT--
string(100) 

string(100) 

string(100) 

string(100) 

string(100) 

string(100) 

string(100) 

string(100) 

string(100) 

string(100) 

string(100) 

string(100) 

string(100) 

string(100) 

string(100) 

string(100) 




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



[PHP-CVS] cvs: php-src /ext/wddx wddx.c /ext/wddx/tests .cvsignore 001.phpt wddx.xml

2003-06-28 Thread Ilia Alshanetsky
iliaa   Sat Jun 28 02:55:47 2003 EDT

  Added files: 
/php-src/ext/wddx/tests .cvsignore 001.phpt wddx.xml 

  Modified files:  
/php-src/ext/wddx   wddx.c 
  Log:
  Added missing handling of dateTime
  Fixed compiler warning involving streams
  Added a test case for wddx_deserialize()
  
  
Index: php-src/ext/wddx/wddx.c
diff -u php-src/ext/wddx/wddx.c:1.105 php-src/ext/wddx/wddx.c:1.106
--- php-src/ext/wddx/wddx.c:1.105   Tue Jun 10 16:03:40 2003
+++ php-src/ext/wddx/wddx.c Sat Jun 28 02:55:46 2003
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: wddx.c,v 1.105 2003/06/10 20:03:40 imajes Exp $ */
+/* $Id: wddx.c,v 1.106 2003/06/28 06:55:46 iliaa Exp $ */
 
 #include php.h
 
@@ -34,6 +34,7 @@
 #include ext/standard/php_smart_str.h
 #include ext/standard/html.h
 #include ext/standard/php_string.h
+#include ext/standard/php_parsedate.h
 
 #define WDDX_BUF_LEN   256
 #define PHP_CLASS_NAME_VAR php_class_name
@@ -54,6 +55,7 @@
 #define EL_VERSION version
 #define EL_RECORDSET   recordset
 #define EL_FIELD   field
+#define EL_DATETIMEdateTime
 
 #define php_wddx_deserialize(a,b) \
php_wddx_deserialize_ex((a)-value.str.val, (a)-value.str.len, (b))
@@ -79,7 +81,8 @@
ST_BINARY,
ST_STRUCT,
ST_RECORDSET,
-   ST_FIELD
+   ST_FIELD,
+   ST_DATETIME
} type;
char *varname;
 } st_entry;
@@ -861,6 +864,14 @@
}
 
wddx_stack_push((wddx_stack *)stack, ent, sizeof(st_entry));
+   } else if (!strcmp(name, EL_DATETIME)) {
+   ent.type = ST_DATETIME;
+   SET_STACK_VARNAME;
+   
+   ALLOC_ZVAL(ent.data);
+   INIT_PZVAL(ent.data);
+   Z_TYPE_P(ent.data) = IS_LONG;
+   wddx_stack_push((wddx_stack *)stack, ent, sizeof(st_entry));
}
 }
 /* }}} */
@@ -884,7 +895,8 @@
if (!strcmp(name, EL_STRING) || !strcmp(name, EL_NUMBER) ||
!strcmp(name, EL_BOOLEAN) || !strcmp(name, EL_NULL) ||
!strcmp(name, EL_ARRAY) || !strcmp(name, EL_STRUCT) ||
-   !strcmp(name, EL_RECORDSET) || !strcmp(name, EL_BINARY)) {
+   !strcmp(name, EL_RECORDSET) || !strcmp(name, EL_BINARY) ||
+   !strcmp(name, EL_DATETIME)) {
wddx_stack_top(stack, (void**)ent1);
 
if (!strcmp(name, EL_BINARY)) {
@@ -1048,6 +1060,24 @@
}
break;
 
+   case ST_DATETIME: {
+   char *tmp;
+
+   tmp = do_alloca(len + 1);
+   memcpy(tmp, s, len);
+   tmp[len] = '\0';
+
+   Z_LVAL_P(ent-data) = php_parse_date(tmp, NULL);
+   /* date out of range  1969 or  2038 */
+   if (Z_LVAL_P(ent-data) == -1) {
+   Z_TYPE_P(ent-data) = IS_STRING;
+   Z_STRLEN_P(ent-data) = len;
+   Z_STRVAL_P(ent-data) = estrndup(s, len);
+   }
+   free_alloca(tmp);
+   }
+   break;
+
default:
break;
}
@@ -1280,7 +1310,7 @@
payload_len = Z_STRLEN_P(packet);
}
else if (Z_TYPE_P(packet) == IS_RESOURCE) {
-   stream = php_stream_from_zval(stream, packet);
+   php_stream_from_zval(stream, packet);
if (stream) {
payload_len = php_stream_copy_to_mem(stream, payload, 
PHP_STREAM_COPY_ALL, 0);
}

Index: php-src/ext/wddx/tests/.cvsignore
+++ php-src/ext/wddx/tests/.cvsignore
phpt.*
*.diff
*.log
*.exp
*.out
*.php

Index: php-src/ext/wddx/tests/001.phpt
+++ php-src/ext/wddx/tests/001.phpt
--TEST--
wddz deserialization test
--FILE--
?php
$path = dirname(__FILE__);
var_dump(wddx_deserialize(file_get_contents({$path}/wddx.xml)));
?
--EXPECT--
array(11) {
  [aNull]=
  NULL
  [aString]=
  string(8) a string
  [aNumber]=
  float(-12.456)
  [aDateTime]=
  int(897600732)
  [aDateTime2]=
  string(19) 1930-06-12T04:32:12
  [aDateTime3]=
  string(19) 2040-06-12T04:32:12
  [aBoolean]=
  bool(true)
  [anArray]=
  array(2) {
[0]=
int(10)
[1]=
string(14) second element
  }
  [aBinary]=
  string(11) binary data
  [anObject]=
  array(2) {
[s]=
string(8) a string
[n]=
float(-12.456)
  }
  [aRecordset]=
  array(2) {
[NAME]=
array(2) {
  [0]=
  

[PHP-CVS] cvs: php-src(PHP_4_3) /ext/wddx wddx.c /ext/wddx/tests .cvsignore 001.phpt wddx.xml

2003-06-28 Thread Ilia Alshanetsky
iliaa   Sat Jun 28 02:59:31 2003 EDT

  Added files: (Branch: PHP_4_3)
/php-src/ext/wddx/tests .cvsignore 001.phpt wddx.xml 

  Modified files:  
/php-src/ext/wddx   wddx.c 
  Log:
  MFH: Added missing handling of dateTime
  
  
Index: php-src/ext/wddx/wddx.c
diff -u php-src/ext/wddx/wddx.c:1.96.2.3 php-src/ext/wddx/wddx.c:1.96.2.4
--- php-src/ext/wddx/wddx.c:1.96.2.3Sat Jan  4 14:51:46 2003
+++ php-src/ext/wddx/wddx.c Sat Jun 28 02:59:31 2003
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: wddx.c,v 1.96.2.3 2003/01/04 19:51:46 helly Exp $ */
+/* $Id: wddx.c,v 1.96.2.4 2003/06/28 06:59:31 iliaa Exp $ */
 
 #include php.h
 #include php_wddx.h
@@ -32,6 +32,7 @@
 #include ext/standard/php_smart_str.h
 #include ext/standard/html.h
 #include ext/standard/php_string.h
+#include ext/standard/php_parsedate.h
 
 #define WDDX_BUF_LEN   256
 #define PHP_CLASS_NAME_VAR php_class_name
@@ -52,6 +53,7 @@
 #define EL_VERSION version
 #define EL_RECORDSET   recordset
 #define EL_FIELD   field
+#define EL_DATETIMEdateTime
 
 #define php_wddx_deserialize(a,b) \
php_wddx_deserialize_ex((a)-value.str.val, (a)-value.str.len, (b))
@@ -77,7 +79,8 @@
ST_BINARY,
ST_STRUCT,
ST_RECORDSET,
-   ST_FIELD
+   ST_FIELD,
+   ST_DATETIME
} type;
char *varname;
 } st_entry;
@@ -867,6 +870,14 @@
}
 
wddx_stack_push((wddx_stack *)stack, ent, sizeof(st_entry));
+   } else if (!strcmp(name, EL_DATETIME)) {
+   ent.type = ST_DATETIME;
+   SET_STACK_VARNAME;
+   
+   ALLOC_ZVAL(ent.data);
+   INIT_PZVAL(ent.data);
+   Z_TYPE_P(ent.data) = IS_LONG;
+   wddx_stack_push((wddx_stack *)stack, ent, sizeof(st_entry));
}
 }
 /* }}} */
@@ -890,7 +901,8 @@
if (!strcmp(name, EL_STRING) || !strcmp(name, EL_NUMBER) ||
!strcmp(name, EL_BOOLEAN) || !strcmp(name, EL_NULL) ||
!strcmp(name, EL_ARRAY) || !strcmp(name, EL_STRUCT) ||
-   !strcmp(name, EL_RECORDSET) || !strcmp(name, EL_BINARY)) {
+   !strcmp(name, EL_RECORDSET) || !strcmp(name, EL_BINARY) ||
+   !strcmp(name, EL_DATETIME)) {
wddx_stack_top(stack, (void**)ent1);
 
if (!strcmp(name, EL_BINARY)) {
@@ -1054,6 +1066,22 @@
}
break;
 
+   case ST_DATETIME: {
+   char *tmp;
+
+   tmp = do_alloca(len + 1);
+   memcpy(tmp, s, len);
+   tmp[len] = '\0';
+
+   Z_LVAL_P(ent-data) = php_parse_date(tmp, NULL);
+   /* date out of range  1969 or  2038 */
+   if (Z_LVAL_P(ent-data) == -1) {
+   Z_TYPE_P(ent-data) = IS_STRING;
+   Z_STRLEN_P(ent-data) = len;
+   Z_STRVAL_P(ent-data) = estrndup(s, len);
+   }
+   free_alloca(tmp);
+   }
default:
break;
}

Index: php-src/ext/wddx/tests/.cvsignore
+++ php-src/ext/wddx/tests/.cvsignore
phpt.*
*.diff
*.log
*.exp
*.out
*.php

Index: php-src/ext/wddx/tests/001.phpt
+++ php-src/ext/wddx/tests/001.phpt
--TEST--
wddz deserialization test
--FILE--
?php
$path = dirname(__FILE__);
var_dump(wddx_deserialize(file_get_contents({$path}/wddx.xml)));
?
--EXPECT--
array(11) {
  [aNull]=
  NULL
  [aString]=
  string(8) a string
  [aNumber]=
  float(-12.456)
  [aDateTime]=
  int(897600732)
  [aDateTime2]=
  string(19) 1930-06-12T04:32:12
  [aDateTime3]=
  string(19) 2040-06-12T04:32:12
  [aBoolean]=
  bool(true)
  [anArray]=
  array(2) {
[0]=
int(10)
[1]=
string(14) second element
  }
  [aBinary]=
  string(11) binary data
  [anObject]=
  array(2) {
[s]=
string(8) a string
[n]=
float(-12.456)
  }
  [aRecordset]=
  array(2) {
[NAME]=
array(2) {
  [0]=
  string(8) John Doe
  [1]=
  string(8) Jane Doe
}
[AGE]=
array(2) {
  [0]=
  int(34)
  [1]=
  int(31)
}
  }
}

Index: php-src/ext/wddx/tests/wddx.xml
+++ php-src/ext/wddx/tests/wddx.xml
?xml version='1.0'?
!DOCTYPE wddxPacket SYSTEM 'wddx_0100.dtd'
wddxPacket version='1.0'
header/
data
struct
 var name='aNull'
 null/
 /var
 var 

[PHP-CVS] cvs: php-src /ext/standard/tests/general_functions sunfuncts.phpt

2003-06-28 Thread Ilia Alshanetsky
iliaa   Sat Jun 28 13:36:47 2003 EDT

  Modified files:  
/php-src/ext/standard/tests/general_functions   sunfuncts.phpt 
  Log:
  Fixed test failure on systems with short_tags (?) off.
  
  
Index: php-src/ext/standard/tests/general_functions/sunfuncts.phpt
diff -u php-src/ext/standard/tests/general_functions/sunfuncts.phpt:1.3 
php-src/ext/standard/tests/general_functions/sunfuncts.phpt:1.4
--- php-src/ext/standard/tests/general_functions/sunfuncts.phpt:1.3 Mon Feb 17 
00:51:03 2003
+++ php-src/ext/standard/tests/general_functions/sunfuncts.phpt Sat Jun 28 13:36:46 
2003
@@ -3,7 +3,7 @@
 --INI--
 precision = 14
 --FILE--
-?
+?php
 
 putenv (TZ=Asia/Jerusalem);
 



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



[PHP-CVS] cvs: php-src /ext/standard file.c /ext/standard/tests/file 004.phpt

2003-06-28 Thread Ilia Alshanetsky
iliaa   Sat Jun 28 16:06:13 2003 EDT

  Added files: 
/php-src/ext/standard/tests/file004.phpt 

  Modified files:  
/php-src/ext/standard   file.c 
  Log:
  Added array handling to file_put_contents()
  More verbose error reporting mechanism.
  Test case for file_put_contents().
  
  
  
Index: php-src/ext/standard/file.c
diff -u php-src/ext/standard/file.c:1.350 php-src/ext/standard/file.c:1.351
--- php-src/ext/standard/file.c:1.350   Sat Jun 28 04:21:02 2003
+++ php-src/ext/standard/file.c Sat Jun 28 16:06:13 2003
@@ -21,7 +21,7 @@
+--+
  */
 
-/* $Id: file.c,v 1.350 2003/06/28 08:21:02 derick Exp $ */
+/* $Id: file.c,v 1.351 2003/06/28 20:06:13 iliaa Exp $ */
 
 /* Synced with php 3.0 revision 1.218 1999-06-16 [ssb] */
 
@@ -474,19 +474,20 @@
 }
 /* }}} */
 
-/* {{{ proto int file_put_contents(string file, string data[, int flags[, resource 
context]])
-   Write/Create a file with contents data and returns the number */
+/* {{{ proto int file_put_contents(string file, mixed data [, int flags [, resource 
context]])
+   Write/Create a file with contents data and return the number of bytes written */
 PHP_FUNCTION(file_put_contents)
 {
php_stream *stream;
-   char *filename, *data;
-   size_t filename_len, data_len;
-   int numbytes, flags = 0;
+   char *filename;
+   size_t filename_len;
+   zval *data;
+   int numbytes = 0, flags = 0;
zval *zcontext = NULL;
php_stream_context *context = NULL;

-   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, ss|lr!, filename, 
filename_len, 
-   data, data_len, flags, zcontext) == FAILURE) {
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, sz/|lr!, filename, 
filename_len, 
+   data, flags, zcontext) == FAILURE) {
return;
}
 
@@ -497,15 +498,66 @@
if (stream == NULL) {
RETURN_FALSE;
}
+   switch (Z_TYPE_P(data)) {
+   case IS_NULL:
+   case IS_LONG:
+   case IS_DOUBLE:
+   case IS_BOOL:
+   case IS_CONSTANT:
+   convert_to_string_ex(data);
+
+   case IS_STRING:
+   if (Z_STRLEN_P(data)) {
+   numbytes = php_stream_write(stream, Z_STRVAL_P(data), 
Z_STRLEN_P(data));
+   if (numbytes != Z_STRLEN_P(data)) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, 
Only %d of %d bytes written, possibly out of free disk space., numbytes, 
Z_STRLEN_P(data));
+   numbytes = -1;
+   }
+   }
+   break;
 
-   if (data_len) {
-   numbytes = php_stream_write(stream, data, data_len);
-   if (numbytes  0) {
-   RETURN_FALSE;
-   }
+   case IS_ARRAY:
+   if (zend_hash_num_elements(Z_ARRVAL_P(data))) {
+   int bytes_written;
+   zval **tmp;
+   HashPosition pos;
+
+   zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(data), 
pos);
+   while (zend_hash_get_current_data_ex(Z_ARRVAL_P(data), 
(void **) tmp, pos) == SUCCESS) {
+   if ((*tmp)-type != IS_STRING) {
+   SEPARATE_ZVAL(tmp);
+   convert_to_string(*tmp);
+   }
+   if (Z_STRLEN_PP(tmp)) {
+   numbytes += Z_STRLEN_PP(tmp);
+   bytes_written = 
php_stream_write(stream, Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp));
+   if (bytes_written  0 || bytes_written 
!= Z_STRLEN_PP(tmp)) {
+   if (bytes_written  0) {
+   php_error_docref(NULL 
TSRMLS_CC, E_WARNING, Failed to write %d bytes to %s.,  Z_STRLEN_PP(tmp), filename);
+   } else {
+   php_error_docref(NULL 
TSRMLS_CC, E_WARNING, Only %d of %d bytes written, possibly out of free disk space., 
 bytes_written, Z_STRLEN_PP(tmp));
+   }
+   numbytes = -1;
+   break;
+   }
+   }
+  

[PHP-CVS] cvs: php-src(PHP_4_3) /ext/standard string.c

2003-06-29 Thread Ilia Alshanetsky
iliaa   Sun Jun 29 11:36:11 2003 EDT

  Modified files:  (Branch: PHP_4_3)
/php-src/ext/standard   string.c 
  Log:
  Fixed bug #24340 (basename failure win32 with containing both \ and /)
  
  
Index: php-src/ext/standard/string.c
diff -u php-src/ext/standard/string.c:1.333.2.31 
php-src/ext/standard/string.c:1.333.2.32
--- php-src/ext/standard/string.c:1.333.2.31Fri Jun 20 11:44:48 2003
+++ php-src/ext/standard/string.c   Sun Jun 29 11:36:10 2003
@@ -18,7 +18,7 @@
+--+
  */
 
-/* $Id: string.c,v 1.333.2.31 2003/06/20 15:44:48 pollita Exp $ */
+/* $Id: string.c,v 1.333.2.32 2003/06/29 15:36:10 iliaa Exp $ */
 
 /* Synced with php 3.0 revision 1.193 1999-06-16 [ssb] */
 
@@ -1102,11 +1102,17 @@
p = c + 1;   /* Save pointer to overwritten char */
}
 
-   if ((c = strrchr(s, '/'))
 #ifdef PHP_WIN32
-   || ((c = strrchr(s, '\\'))  !IsDBCSLeadByte(*(c-1)))
+   if ((c = strrchr(s, '/')) || ((c = strrchr(s, '\\'))  
!IsDBCSLeadByte(*(c-1 {
+   if (*c == '/') {
+   char *c2 = strrchr(s, '\\');
+   if (c2  !IsDBCSLeadByte(*(c2-1))  c2  c) {
+   c = c2;
+   }
+   }
+#else 
+   if ((c = strrchr(s, '/'))) {
 #endif
-   ) {
ret = estrdup(c + 1);
} else {
ret = estrdup(s);



-- 
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/serialize 003.phpt bug24063.phpt /main snprintf.c

2003-06-29 Thread Ilia Alshanetsky
iliaa   Sun Jun 29 21:03:21 2003 EDT

  Added files: 
/php-src/ext/standard/tests/serialize   bug24063.phpt 

  Modified files:  
/php-src/main   snprintf.c 
/php-src/ext/standard/tests/serialize   003.phpt 
  Log:
  Fixed bug #24063 (*printf() did not handle scientific notation correctly)
  
  
Index: php-src/main/snprintf.c
diff -u php-src/main/snprintf.c:1.23 php-src/main/snprintf.c:1.24
--- php-src/main/snprintf.c:1.23Tue Jun 10 16:03:42 2003
+++ php-src/main/snprintf.c Sun Jun 29 21:03:21 2003
@@ -16,7 +16,7 @@
   +--+
 */
 
-/* $Id: snprintf.c,v 1.23 2003/06/10 20:03:42 imajes Exp $ */
+/* $Id: snprintf.c,v 1.24 2003/06/30 01:03:21 iliaa Exp $ */
 
 /* 
  * Copyright (c) 1995-1998 The Apache Group.  All rights reserved.
@@ -404,6 +404,9 @@
*p2++ = '.';
for (i = 1; i  ndigit; i++)
*p2++ = *p1++;
+   if (*(p2 - 1) == '.') {
+   *p2++ = '0';
+   }   
*p2++ = 'e';
if (decpt  0) {
decpt = -decpt;
Index: php-src/ext/standard/tests/serialize/003.phpt
diff -u php-src/ext/standard/tests/serialize/003.phpt:1.6 
php-src/ext/standard/tests/serialize/003.phpt:1.7
--- php-src/ext/standard/tests/serialize/003.phpt:1.6   Wed May 21 03:23:45 2003
+++ php-src/ext/standard/tests/serialize/003.phpt   Sun Jun 29 21:03:21 2003
@@ -22,4 +22,4 @@
 float\(8\.529E-22\)
 
 d:9\.[0-9]*E-9;
-float\(9\.E-9\)
+float\(9\.0E-9\)

Index: php-src/ext/standard/tests/serialize/bug24063.phpt
+++ php-src/ext/standard/tests/serialize/bug24063.phpt
--TEST--
Bug #24063 (serialize() missing 0 after the . on scientific notation)
--INI--
serialize_precision=100
precision=12
--FILE--
?php 
$f = 1.0e-6;
$s = serialize($f);
var_dump($s, unserialize($s));
?
--EXPECT--
string(9) d:1.0E-6;
float(1.0E-6)



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



[PHP-CVS] cvs: php-src(PHP_4_3) / NEWS /ext/standard/tests/serialize 003.phpt bug24063.phpt /main snprintf.c

2003-06-29 Thread Ilia Alshanetsky
iliaa   Sun Jun 29 21:05:03 2003 EDT

  Added files: (Branch: PHP_4_3)
/php-src/ext/standard/tests/serialize   bug24063.phpt 

  Modified files:  
/php-src/main   snprintf.c 
/php-src/ext/standard/tests/serialize   003.phpt 
/php-srcNEWS 
  Log:
  MFH: fix for bug #24063
  
  
Index: php-src/main/snprintf.c
diff -u php-src/main/snprintf.c:1.17.4.4 php-src/main/snprintf.c:1.17.4.5
--- php-src/main/snprintf.c:1.17.4.4Mon May  5 15:54:41 2003
+++ php-src/main/snprintf.c Sun Jun 29 21:05:02 2003
@@ -384,6 +384,9 @@
*p2++ = '.';
for (i = 1; i  ndigit; i++)
*p2++ = *p1++;
+   if (*(p2 - 1) == '.') {
+   *p2++ = '0';
+   }   
*p2++ = 'e';
if (decpt  0) {
decpt = -decpt;
Index: php-src/ext/standard/tests/serialize/003.phpt
diff -u php-src/ext/standard/tests/serialize/003.phpt:1.1.4.5 
php-src/ext/standard/tests/serialize/003.phpt:1.1.4.6
--- php-src/ext/standard/tests/serialize/003.phpt:1.1.4.5   Wed May 21 03:24:28 
2003
+++ php-src/ext/standard/tests/serialize/003.phpt   Sun Jun 29 21:05:02 2003
@@ -22,4 +22,4 @@
 float\(8\.529E-22\)
 
 d:9\.[0-9]*E-9;
-float\(9\.E-9\)
+float\(9\.0E-9\)
Index: php-src/NEWS
diff -u php-src/NEWS:1.1247.2.271 php-src/NEWS:1.1247.2.272
--- php-src/NEWS:1.1247.2.271   Sun Jun 29 19:02:33 2003
+++ php-src/NEWSSun Jun 29 21:05:02 2003
@@ -5,11 +5,13 @@
 - Fixed FastCGI IIS document root problem. (Shane)
 - Fixed corruption of multibyte character including 0x5c as second
   byte in multipart/form-data. (Rui)
-- Fixed bug #24312 (base64_decode() does not skip 0xF0-0xFF characters).
-  (gereon.steffens[at]onvista.de, Ilia)
 - Fixed bug #24313 (file_exist() warning on non-existent files
   when open_basedir is used). (Ilia)
+- Fixed bug #24312 (base64_decode() does not skip 0xF0-0xFF characters).
+  (gereon.steffens[at]onvista.de, Ilia)
 - Fixed bug #24284 (Fixed memory leak inside pg_ping()). (Ilia)
+- Fixed bug #24063 (*printf() did not handle scientific notation correctly).
+  (Ilia)
 - Fixed bug #24028 (Reading raw post message by php://input failed). (Jani)
 - Fixed bug #24009 FastCGI handling of file not found. (Shane)
 - Fixed bug #23664 FastCGI socket listenting. (Shane)

Index: php-src/ext/standard/tests/serialize/bug24063.phpt
+++ php-src/ext/standard/tests/serialize/bug24063.phpt
--TEST--
Bug #24063 (serialize() missing 0 after the . on scientific notation)
--INI--
serialize_precision=100
precision=12
--FILE--
?php 
$f = 1.0e-6;
$s = serialize($f);
var_dump($s, unserialize($s));
?
--EXPECT--
string(9) d:1.0E-6;
float(1.0E-6)



-- 
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 bug24281.phpt

2003-06-30 Thread Ilia Alshanetsky
iliaa   Mon Jun 30 23:11:09 2003 EDT

  Modified files:  
/php-src/ext/standard/tests/strings bug24281.phpt 
  Log:
  Fix up test
  
  
Index: php-src/ext/standard/tests/strings/bug24281.phpt
diff -u php-src/ext/standard/tests/strings/bug24281.phpt:1.1 
php-src/ext/standard/tests/strings/bug24281.phpt:1.2
--- php-src/ext/standard/tests/strings/bug24281.phpt:1.1Mon Jun 23 10:18:33 
2003
+++ php-src/ext/standard/tests/strings/bug24281.phptMon Jun 30 23:11:09 2003
@@ -1,5 +1,5 @@
 --TEST--
-Bug #24281:str_replace count not returned if variable wasn't initialized 
+Bug #24281 (str_replace count not returned if variable wasn't initialized)
 --SKIPIF--
 ?php 
 if (version_compare(zend_version(), '2.0.0-dev', '')) die('SKIP PHP5 
functionality'); 



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



<    1   2   3   4   5   6   7   8   9   10   >