[PHP-CVS-DAILY] cvs: php-src / ChangeLog

2003-11-28 Thread changelog
changelog   Fri Nov 28 20:32:17 2003 EDT

  Modified files:  
/php-srcChangeLog 
  Log:
  ChangeLog update
  
Index: php-src/ChangeLog
diff -u php-src/ChangeLog:1.1461 php-src/ChangeLog:1.1462
--- php-src/ChangeLog:1.1461Thu Nov 27 20:31:56 2003
+++ php-src/ChangeLog   Fri Nov 28 20:32:15 2003
@@ -1,3 +1,109 @@
+2003-11-28  Sara Golemon  [EMAIL PROTECTED]
+
+* NEWS
+  ext/standard/basic_functions.h
+  ext/standard/filestat.c
+  ext/standard/ftp_fopen_wrapper.c
+  main/php_streams.h
+  main/streams/plain_wrapper.c
+  main/streams/streams.c:
+  Route php_stat() via streams/url_stat API (php_stream_stat_path).
+  This enables fopen-wrappers support on stat() and related family calls.
+
+2003-11-28  Wez Furlong  [EMAIL PROTECTED]
+
+* ext/openssl/xp_ssl.c
+  main/streams/streams.c
+  main/streams/xp_socket.c:
+  (sort of) MFB, feof fix for sockets.
+
+* (PHP_4_3)
+  main/streams.c:
+  Probable fix for #25575; STDIN/STDOUT/STDERR streams not registered
+  as network sockets when PHP run from x?inetd.
+
+* (PHP_4_3)
+  main/network.c
+  main/streams.c:
+  Fix for bug #25939; feof not working correctly for sockets.
+  Possibly also fixes #23220; warnings issued by fgets on ssl sockets.
+
+2003-11-28  Christian Stocker  [EMAIL PROTECTED]
+
+* ext/xsl/php_xsl.c
+  ext/xsl/php_xsl.h:
+  - Added possibility to call php functions as XSLT-functions
+eg: xsl:value-of select=php:function('date','r')/
+Namespace is http://php.net/functions
+
+* ext/dom/element.c
+  ext/dom/php_dom.c
+  ext/dom/php_dom.h
+  ext/dom/xml_common.h:
+  changing dom_object_get_data to php_dom_object_get_data and PHP_DOM_EXPORT
+  it
+  (by Rob Richards)
+
+2003-11-28  Greg Beaver  [EMAIL PROTECTED]
+
+* (PHP_4_3)
+  pear/PEAR.php:
+  odd merge conflict fixed
+
+2003-11-28  Ilia Alshanetsky  [EMAIL PROTECTED]
+
+* (PHP_4_3)
+  NEWS
+  ext/standard/http_fopen_wrapper.c:
+  Fixed bug #26440 (MFH missing context options).
+
+* (PHP_4_3)
+  ext/standard/file.c:
+  MFH: More memory leak fixes for stream contexts.
+
+* ext/standard/streamsfuncs.c:
+  More memory leak fixes for stream contexts.
+
+* NEWS
+  NEWS:
+  Bug fixing news.
+
+2003-11-28  Rob Richards  [EMAIL PROTECTED]
+
+* (PHP_4_3)
+  ext/domxml/php_domxml.c:
+  Fix for bug #26446: domxml_open_file() returns an empty error-Array
+
+2003-11-28  Wez Furlong  [EMAIL PROTECTED]
+
+* (PHP_4_3)
+  ext/com/COM.c:
+  MFH: Fix for Bug #25664; calling ITypeInfo::Invoke with bogus params.
+
+* ext/com_dotnet/com_com.c:
+  Fix #25664 - COM crashes when calling a Delphi implementations of
+  ITypeInfo.
+  Problem was that our extension assumes that the first param to
+  ITypeInfo::Invoke was a reference to the COM object; this is not
+  necessarily true and caused a crash in this instance.
+  Problem solved by removing the ITypeInfo::Invoke call, as it doesn't buy
+  us anything anyway.
+
+* ext/standard/var.c:
+  fix #26001; serialize crashes when accessing an overloaded
+  object that has no properties (NULL hashtable).
+
+* ext/com_dotnet/com_handlers.c:
+  fix memleak
+
+2003-11-28  Ilia Alshanetsky  [EMAIL PROTECTED]
+
+* ZendEngine2/zend_API.c:
+  Add removed lcname, it is still needed.
+
+* main/streams/streams.c:
+  Fixed a memory leak.
+
 2003-11-27  Jani Taskinen  [EMAIL PROTECTED]
 
 * (PHP_4_3)


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

2003-11-28 Thread Rasmus Lerdorf
Is there a bug # that goes along with this one?

On Fri, 28 Nov 2003, Ilia Alshanetsky wrote:

 iliaa Thu Nov 27 19:00:35 2003 EDT

   Modified files:  (Branch: PHP_4_3)
 /php-src/main streams.c
   Log:
   MFH: Fixed a memory leak.


 Index: php-src/main/streams.c
 diff -u php-src/main/streams.c:1.125.2.82 php-src/main/streams.c:1.125.2.83
 --- php-src/main/streams.c:1.125.2.82 Wed Oct  8 06:58:28 2003
 +++ php-src/main/streams.cThu Nov 27 19:00:34 2003
 @@ -20,7 +20,7 @@
 +--+
   */

 -/* $Id: streams.c,v 1.125.2.82 2003/10/08 10:58:28 wez Exp $ */
 +/* $Id: streams.c,v 1.125.2.83 2003/11/28 00:00:34 iliaa Exp $ */

  #define _GNU_SOURCE
  #include php.h
 @@ -2882,9 +2882,9 @@
   ALLOC_INIT_ZVAL(copied_val);
   *copied_val = *optionvalue;
   zval_copy_ctor(copied_val);
 -
 + INIT_PZVAL(copied_val);
 +
   if (FAILURE == zend_hash_find(Z_ARRVAL_P(context-options), 
 (char*)wrappername, strlen(wrappername)+1, (void**)wrapperhash)) {
 -
   MAKE_STD_ZVAL(category);
   array_init(category);


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


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



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

2003-11-28 Thread Ilia Alshanetsky
On November 28, 2003 03:47 am, Rasmus Lerdorf wrote:
 Is there a bug # that goes along with this one?

The leak can be replicated with test script in bug #26440.

Ilia

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



[PHP-CVS] cvs: php-src /ext/com_dotnet com_handlers.c

2003-11-28 Thread Wez Furlong
wez Fri Nov 28 10:41:46 2003 EDT

  Modified files:  
/php-src/ext/com_dotnet com_handlers.c 
  Log:
  fix memleak
  
Index: php-src/ext/com_dotnet/com_handlers.c
diff -u php-src/ext/com_dotnet/com_handlers.c:1.6 
php-src/ext/com_dotnet/com_handlers.c:1.7
--- php-src/ext/com_dotnet/com_handlers.c:1.6   Thu Nov 27 12:58:58 2003
+++ php-src/ext/com_dotnet/com_handlers.c   Fri Nov 28 10:41:45 2003
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: com_handlers.c,v 1.6 2003/11/27 17:58:58 wez Exp $ */
+/* $Id: com_handlers.c,v 1.7 2003/11/28 15:41:45 wez Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -275,7 +275,7 @@
}
 
f = emalloc(sizeof(zend_internal_function));
-   f-type = ZEND_OVERLOADED_FUNCTION;
+   f-type = ZEND_OVERLOADED_FUNCTION_TEMPORARY;
f-num_args = 0;
f-arg_info = NULL;
f-scope = obj-ce;

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



[PHP-CVS] cvs: php-src /ext/standard var.c

2003-11-28 Thread Wez Furlong
wez Fri Nov 28 10:42:59 2003 EDT

  Modified files:  
/php-src/ext/standard   var.c 
  Log:
  fix #26001; serialize crashes when accessing an overloaded
  object that has no properties (NULL hashtable).
  
Index: php-src/ext/standard/var.c
diff -u php-src/ext/standard/var.c:1.175 php-src/ext/standard/var.c:1.176
--- php-src/ext/standard/var.c:1.175Tue Nov  4 11:08:10 2003
+++ php-src/ext/standard/var.c  Fri Nov 28 10:42:58 2003
@@ -18,7 +18,7 @@
+--+
 */
 
-/* $Id: var.c,v 1.175 2003/11/04 16:08:10 moriyoshi Exp $ */
+/* $Id: var.c,v 1.176 2003/11/28 15:42:58 wez Exp $ */
 
 
 /* {{{ includes 
@@ -585,15 +585,16 @@
/* fall-through */
}
case IS_ARRAY:
-   myht = HASH_OF(*struc);
if (Z_TYPE_PP(struc) == IS_ARRAY) {
smart_str_appendl(buf, a:, 2);
+   myht = HASH_OF(*struc);
} else {
php_var_serialize_class_name(buf, struc TSRMLS_CC);
+   myht = Z_OBJPROP_PP(struc);
}
/* count after serializing name, since 
php_var_serialize_class_name
   changes the count if the variable is incomplete class */
-   i = zend_hash_num_elements(myht);
+   i = myht ? zend_hash_num_elements(myht) : 0;
smart_str_append_long(buf, i);
smart_str_appendl(buf, :{, 2);
if (i  0) {

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



[PHP-CVS] cvs: php-src /ext/com_dotnet com_com.c

2003-11-28 Thread Wez Furlong
wez Fri Nov 28 12:11:16 2003 EDT

  Modified files:  
/php-src/ext/com_dotnet com_com.c 
  Log:
  Fix #25664 - COM crashes when calling a Delphi implementations of ITypeInfo.
  Problem was that our extension assumes that the first param to ITypeInfo::Invoke was 
a reference to the COM object; this is not necessarily true and caused a crash in this 
instance.
  Problem solved by removing the ITypeInfo::Invoke call, as it doesn't buy us anything 
anyway.
  
Index: php-src/ext/com_dotnet/com_com.c
diff -u php-src/ext/com_dotnet/com_com.c:1.4 php-src/ext/com_dotnet/com_com.c:1.5
--- php-src/ext/com_dotnet/com_com.c:1.4Tue Oct  7 14:50:07 2003
+++ php-src/ext/com_dotnet/com_com.cFri Nov 28 12:11:16 2003
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: com_com.c,v 1.4 2003/10/07 18:50:07 wez Exp $ */
+/* $Id: com_com.c,v 1.5 2003/11/28 17:11:16 wez Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -290,21 +290,8 @@
unsigned int arg_err;
EXCEPINFO e;
 
-   if (obj-typeinfo) {
-   hr = ITypeInfo_Invoke(obj-typeinfo, V_DISPATCH(obj-v), id_member, 
flags, disp_params, v, e, arg_err);
-   if (FAILED(hr)  (hr != DISP_E_EXCEPTION)) {
-   hr = IDispatch_Invoke(V_DISPATCH(obj-v), id_member,
-   IID_NULL, LOCALE_SYSTEM_DEFAULT, flags, disp_params, 
v, e, arg_err);
-   if (SUCCEEDED(hr)) {
-   /* fall back on using IDispatch directly */
-   ITypeInfo_Release(obj-typeinfo);
-   obj-typeinfo = NULL;
-   }
-   }
-   } else {
-   hr = IDispatch_Invoke(V_DISPATCH(obj-v), id_member,
-   IID_NULL, LOCALE_SYSTEM_DEFAULT, flags, disp_params, v, e, 
arg_err);
-   }
+   hr = IDispatch_Invoke(V_DISPATCH(obj-v), id_member,
+   IID_NULL, LOCALE_SYSTEM_DEFAULT, flags, disp_params, v, e, arg_err);
 
if (FAILED(hr)) {
char *source = NULL, *desc = NULL, *msg = NULL;

-- 
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) /ext/com COM.c

2003-11-28 Thread Wez Furlong
wez Fri Nov 28 12:14:13 2003 EDT

  Modified files:  (Branch: PHP_4_3)
/php-src/ext/comCOM.c 
  Log:
  MFH: Fix for Bug #25664; calling ITypeInfo::Invoke with bogus params.
  
  
Index: php-src/ext/com/COM.c
diff -u php-src/ext/com/COM.c:1.90.2.8 php-src/ext/com/COM.c:1.90.2.9
--- php-src/ext/com/COM.c:1.90.2.8  Tue Jul  8 05:10:42 2003
+++ php-src/ext/com/COM.c   Fri Nov 28 12:14:12 2003
@@ -18,7 +18,7 @@
| Wez Furlong  [EMAIL PROTECTED]  |
+--+
  */
-/* $Id: COM.c,v 1.90.2.8 2003/07/08 09:10:42 wez Exp $ */
+/* $Id: COM.c,v 1.90.2.9 2003/11/28 17:14:12 wez Exp $ */
 /*
  * This module implements support for COM components that support the IDispatch
  * interface.  Both local (COM) and remote (DCOM) components can be accessed.
@@ -122,24 +122,7 @@
*ErrString = NULL;
/* @todo use DispInvoke here ? */
if (C_ISREFD(obj)) {
-   if (C_HASTLIB(obj)) {
-   hr = C_TYPEINFO_VT(obj)-Invoke(C_TYPEINFO(obj), 
C_DISPATCH(obj), dispIdMember, wFlags, pDispParams, pVarResult, ExceptInfo, ArgErr);
-   if (FAILED(hr)  (hr != DISP_E_EXCEPTION)) {
-   hr = C_DISPATCH_VT(obj)-Invoke(C_DISPATCH(obj), 
dispIdMember, IID_NULL, LOCALE_SYSTEM_DEFAULT, wFlags, pDispParams, pVarResult, 
ExceptInfo, ArgErr);
-   if (SUCCEEDED(hr)) {
-   /*
-* ITypLib doesn't work
-* Release ITypeLib and fall back to IDispatch
-*/
-
-   C_TYPEINFO_VT(obj)-Release(C_TYPEINFO(obj));
-   C_HASTLIB(obj) = FALSE;
-   C_TYPEINFO(obj) = NULL;
-   }
-   }
-   } else {
-   hr = C_DISPATCH_VT(obj)-Invoke(C_DISPATCH(obj), dispIdMember, 
IID_NULL, LOCALE_SYSTEM_DEFAULT, wFlags, pDispParams, pVarResult, ExceptInfo, 
ArgErr);
-   }
+   hr = C_DISPATCH_VT(obj)-Invoke(C_DISPATCH(obj), dispIdMember, 
IID_NULL, LOCALE_SYSTEM_DEFAULT, wFlags, pDispParams, pVarResult, ExceptInfo, 
ArgErr);
 
if (FAILED(hr)) {
switch (hr) {

-- 
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) /ext/domxml php_domxml.c

2003-11-28 Thread Rob Richards
rrichards   Fri Nov 28 12:39:26 2003 EDT

  Modified files:  (Branch: PHP_4_3)
/php-src/ext/domxml php_domxml.c 
  Log:
  Fix for bug #26446: domxml_open_file() returns an empty error-Array
  
Index: php-src/ext/domxml/php_domxml.c
diff -u php-src/ext/domxml/php_domxml.c:1.218.2.37 
php-src/ext/domxml/php_domxml.c:1.218.2.38
--- php-src/ext/domxml/php_domxml.c:1.218.2.37  Tue Nov 25 11:05:18 2003
+++ php-src/ext/domxml/php_domxml.c Fri Nov 28 12:39:25 2003
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: php_domxml.c,v 1.218.2.37 2003/11/25 16:05:18 iliaa Exp $ */
+/* $Id: php_domxml.c,v 1.218.2.38 2003/11/28 17:39:25 rrichards Exp $ */
 
 /* TODO
  * - Support Notation Nodes
@@ -4015,6 +4015,7 @@
ctxt-replaceEntities = substitute_ent;
 
if (data != NULL) {
+   ctxt-_private = data;
errorCtxt.valid = ctxt-vctxt;
errorCtxt.errors = data;
errorCtxt.parser = ctxt;   

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

2003-11-28 Thread Ilia Alshanetsky
iliaa   Fri Nov 28 13:15:25 2003 EDT

  Modified files:  (Branch: PHP_4_3)
/php-srcNEWS 
  Log:
  Bug fixing news.
  
  
Index: php-src/NEWS
diff -u php-src/NEWS:1.1247.2.480 php-src/NEWS:1.1247.2.481
--- php-src/NEWS:1.1247.2.480   Thu Nov 27 18:18:13 2003
+++ php-src/NEWSFri Nov 28 13:15:23 2003
@@ -3,6 +3,7 @@
 ?? ??? 2003, Version 4.3.5
 - Fixed header handler in NSAPI SAPI module (header-replace was ignored,
   send_default_content_type now sends value from php.ini). (Uwe Schindler)
+- Fixed bug #26446 (domxml_open_file() returns an empty error-Array). (Rob)
 - Fixed bug #26438 (error in thttpd SAPI installation). (Jani)
 - Fixed bug #25963 (PostgreSQL error message include \n characters).
   (Marcus, Ilia)
@@ -43,6 +44,7 @@
   (Marcus)
 - Fixed Bug #25694 (round() and number_format() give inconsistent results).
   (Ilia)
+- Fixed bug #25664 (calling ITypeInfo::Invoke with bogus params). (Wez)
 - Fixed bug #25581 (getimagesize () return incorrect values on bitmap
   (os2) files). (Marcus)
 

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



[PHP-CVS] cvs: php-src / NEWS

2003-11-28 Thread Ilia Alshanetsky
iliaa   Fri Nov 28 13:17:13 2003 EDT

  Modified files:  
/php-srcNEWS 
  Log:
  Bug fixing news.
  
  
Index: php-src/NEWS
diff -u php-src/NEWS:1.1504 php-src/NEWS:1.1505
--- php-src/NEWS:1.1504 Thu Nov 27 17:03:35 2003
+++ php-src/NEWSFri Nov 28 13:17:13 2003
@@ -11,6 +11,10 @@
 - Fixed __autoload() to preserve case of the passed class name. (Andi)
 - Fixed bug #26072 (--disable-libxml does not work). (Jani)
 - Fixed bug #26083 (Non-working write support in ext/dom). (Ilia)
+- Fixed bug #26001 (serialize crashes when accessing an overloaded object that 
+  has no properties (NULL hashtable)). (Wez)
+- Fixed bug #25664 (COM crashes when calling a Delphi implementations of 
+  ITypeInfo). (Wez)
 - Fixed bug #24394 (Serializing cross-referenced objects causes segfault).
   (Moriyoshi)
 - Fixed bug #26156 (REPLACE_ZVAL_VALUE works on uninit stack-based zvals).

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



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

2003-11-28 Thread Ilia Alshanetsky
iliaa   Fri Nov 28 13:33:14 2003 EDT

  Modified files:  
/php-src/ext/standard   streamsfuncs.c 
  Log:
  More memory leak fixes for stream contexts.
  
  
Index: php-src/ext/standard/streamsfuncs.c
diff -u php-src/ext/standard/streamsfuncs.c:1.28 
php-src/ext/standard/streamsfuncs.c:1.29
--- php-src/ext/standard/streamsfuncs.c:1.28Thu Nov 27 12:37:35 2003
+++ php-src/ext/standard/streamsfuncs.c Fri Nov 28 13:33:14 2003
@@ -17,7 +17,7 @@
   +--+
 */
 
-/* $Id: streamsfuncs.c,v 1.28 2003/11/27 17:37:35 wez Exp $ */
+/* $Id: streamsfuncs.c,v 1.29 2003/11/28 18:33:14 iliaa Exp $ */
 
 #include php.h
 #include php_globals.h
@@ -336,6 +336,7 @@
MAKE_STD_ZVAL(newval);
*newval = *(stream-wrapperdata);
zval_copy_ctor(newval);
+   INIT_PZVAL(newval);
 
add_assoc_zval(return_value, wrapper_data, newval);
}
@@ -784,7 +785,7 @@
 
*return_value = *context-options;
zval_copy_ctor(return_value);
-   
+   INIT_PZVAL(return_value);
 }
 /* }}} */
 

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

2003-11-28 Thread Ilia Alshanetsky
iliaa   Fri Nov 28 13:51:16 2003 EDT

  Modified files:  (Branch: PHP_4_3)
/php-src/ext/standard   http_fopen_wrapper.c 
/php-srcNEWS 
  Log:
  Fixed bug #26440 (MFH missing context options).
  
  
Index: php-src/ext/standard/http_fopen_wrapper.c
diff -u php-src/ext/standard/http_fopen_wrapper.c:1.53.2.13 
php-src/ext/standard/http_fopen_wrapper.c:1.53.2.14
--- php-src/ext/standard/http_fopen_wrapper.c:1.53.2.13 Fri Jun 27 12:42:51 2003
+++ php-src/ext/standard/http_fopen_wrapper.c   Fri Nov 28 13:51:14 2003
@@ -18,7 +18,7 @@
|  Wez Furlong [EMAIL PROTECTED]  |
+--+
  */
-/* $Id: http_fopen_wrapper.c,v 1.53.2.13 2003/06/27 16:42:51 sniper Exp $ */ 
+/* $Id: http_fopen_wrapper.c,v 1.53.2.14 2003/11/28 18:51:14 iliaa Exp $ */ 
 
 #include php.h
 #include php_globals.h
@@ -83,7 +83,10 @@
 
 #define HTTP_HEADER_BLOCK_SIZE 1024
 #define PHP_URL_REDIRECT_MAX   20
-
+#define HTTP_HEADER_USER_AGENT 1
+#define HTTP_HEADER_HOST   2
+#define HTTP_HEADER_AUTH   4
+#define HTTP_HEADER_FROM   8
 
 php_stream *php_stream_url_wrap_http_ex(php_stream_wrapper *wrapper, char *path, char 
*mode, int options, char **opened_path, php_stream_context *context, int redirect_max, 
int header_init STREAMS_DC TSRMLS_DC)
 {
@@ -93,7 +96,7 @@
char *scratch = NULL;
char *tmp = NULL;
char *ua_str = NULL;
-   zval **ua_zval = NULL;
+   zval **ua_zval = NULL, **tmpzval = NULL;
int scratch_len = 0;
int body = 0;
char location[HTTP_HEADER_BLOCK_SIZE];
@@ -102,7 +105,7 @@
char *http_header_line = NULL;
char tmp_line[128];
size_t chunk_size = 0, file_size = 0;
-   int eol_detect;
+   int eol_detect, have_header = 0;
 
if (redirect_max  1) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, Circular redirect, 
aborting.);
@@ -133,8 +136,10 @@
resource-port = 80;
 
stream = php_stream_sock_open_host(resource-host, resource-port, 
SOCK_STREAM, NULL, 0);
-   if (stream == NULL) 
+   if (stream == NULL) {
+   eol_detect = 0;
goto out;
+   }
 
/* avoid problems with auto-detecting when reading the headers - the headers
 * are always in canonical \r\n format */
@@ -168,10 +173,20 @@
}
 #endif
 
-   scratch_len = strlen(path) + 32;
-   scratch = emalloc(scratch_len);
+   if (context  php_stream_context_get_option(context, http, method, 
tmpzval) == SUCCESS) {
+   if (Z_TYPE_PP(tmpzval) == IS_STRING  Z_STRLEN_PP(tmpzval)  0) {
+   scratch_len = strlen(path) + 29 + Z_STRLEN_PP(tmpzval);
+   scratch = emalloc(scratch_len);
+   strlcpy(scratch, Z_STRVAL_PP(tmpzval), Z_STRLEN_PP(tmpzval) + 
1);
+   strcat(scratch,  );
+   }
+   }
 
-   strcpy(scratch, GET );
+   if (!scratch) {
+   scratch_len = strlen(path) + 32;
+   scratch = emalloc(scratch_len);
+   strcpy(scratch, GET );
+   }
 
/* file */
if (resource-path  *resource-path)
@@ -190,9 +205,35 @@
 
/* send it */
php_stream_write(stream, scratch, strlen(scratch));
+   
+   if (context  php_stream_context_get_option(context, http, header, 
tmpzval) == SUCCESS  Z_STRLEN_PP(tmpzval)) {
+   /* Remove newlines and spaces from start and end, php_trim will 
estrndup() */
+   tmp = php_trim(Z_STRVAL_PP(tmpzval), Z_STRLEN_PP(tmpzval), NULL, 0, 
NULL, 3 TSRMLS_CC);
+   if (strlen(tmp)  0) {
+   /* Output trimmed headers with \r\n at the end */
+   php_stream_write(stream, tmp, strlen(tmp));
+   php_stream_write(stream, \r\n, sizeof(\r\n) - 1);
+
+   /* Make lowercase for easy comparison against 'standard' 
headers */
+   php_strtolower(tmp, strlen(tmp));
+   if (strstr(tmp, user-agent:)) {
+have_header |= HTTP_HEADER_USER_AGENT;
+   }
+   if (strstr(tmp, host:)) {
+have_header |= HTTP_HEADER_HOST;
+   }
+   if (strstr(tmp, from:)) {
+have_header |= HTTP_HEADER_FROM;
+   }
+   if (strstr(tmp, authorization:)) {
+have_header |= HTTP_HEADER_AUTH;
+   }
+   }
+   efree(tmp);
+   }
 
/* auth header if it was specified */
-   if (resource-user  resource-pass)   {
+   if (((have_header  HTTP_HEADER_AUTH) == 0)  resource-user  
resource-pass) {

[PHP-CVS] cvs: php-src /ext/dom element.c php_dom.c php_dom.h xml_common.h

2003-11-28 Thread Christian Stocker
chregu  Fri Nov 28 16:56:00 2003 EDT

  Modified files:  
/php-src/ext/domelement.c php_dom.c php_dom.h xml_common.h 
  Log:
  changing dom_object_get_data to php_dom_object_get_data and PHP_DOM_EXPORT it
  (by Rob Richards)
  
  
Index: php-src/ext/dom/element.c
diff -u php-src/ext/dom/element.c:1.19 php-src/ext/dom/element.c:1.20
--- php-src/ext/dom/element.c:1.19  Sun Oct 26 10:57:01 2003
+++ php-src/ext/dom/element.c   Fri Nov 28 16:55:59 2003
@@ -17,7 +17,7 @@
+--+
 */
 
-/* $Id: element.c,v 1.19 2003/10/26 15:57:01 rrichards Exp $ */
+/* $Id: element.c,v 1.20 2003/11/28 21:55:59 chregu Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -247,7 +247,7 @@
}
 
/*  TODO: DTD defined attributes are handled special */
-   if (dom_object_get_data((xmlNodePtr) attrp) == NULL) {
+   if (php_dom_object_get_data((xmlNodePtr) attrp) == NULL) {
node_list_unlink(attrp-children TSRMLS_CC);
xmlUnlinkNode((xmlNodePtr) attrp);
xmlFreeProp(attrp);
@@ -321,7 +321,7 @@
 
existattrp = xmlHasProp(nodep, attrp-name);
if (existattrp != NULL) {
-   if ((oldobj = dom_object_get_data((xmlNodePtr) existattrp)) != NULL  
+   if ((oldobj = php_dom_object_get_data((xmlNodePtr) existattrp)) != 
NULL  
((php_libxml_node_ptr *)oldobj-ptr)-node == (xmlNodePtr) 
attrp)
{
RETURN_NULL();
@@ -588,7 +588,7 @@
}
 
if (attrp) {
-   if (dom_object_get_data((xmlNodePtr) attrp) == NULL) {
+   if (php_dom_object_get_data((xmlNodePtr) attrp) == NULL) {
node_list_unlink(attrp-children TSRMLS_CC);
xmlUnlinkNode((xmlNodePtr) attrp);
xmlFreeProp(attrp);
@@ -672,7 +672,7 @@
 }
 
if (existattrp != NULL) {
-   if ((oldobj = dom_object_get_data((xmlNodePtr) existattrp)) != NULL  
+   if ((oldobj = php_dom_object_get_data((xmlNodePtr) existattrp)) != 
NULL  
((php_libxml_node_ptr *)oldobj-ptr)-node == (xmlNodePtr) 
attrp)
{
RETURN_NULL();
Index: php-src/ext/dom/php_dom.c
diff -u php-src/ext/dom/php_dom.c:1.39 php-src/ext/dom/php_dom.c:1.40
--- php-src/ext/dom/php_dom.c:1.39  Sun Oct 26 10:57:02 2003
+++ php-src/ext/dom/php_dom.c   Fri Nov 28 16:55:59 2003
@@ -18,7 +18,7 @@
+--+
 */
 
-/* $Id: php_dom.c,v 1.39 2003/10/26 15:57:02 rrichards Exp $ */
+/* $Id: php_dom.c,v 1.40 2003/11/28 21:55:59 chregu Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -160,8 +160,8 @@
 }
 /* }}} end dom_object_get_node */
 
-/* {{{ dom_object *dom_object_get_data(xmlNodePtr obj) */
-dom_object *dom_object_get_data(xmlNodePtr obj)
+/* {{{ dom_object *php_dom_object_get_data(xmlNodePtr obj) */
+dom_object *php_dom_object_get_data(xmlNodePtr obj)
 {
if (obj-_private != NULL) {
return (dom_object *) ((php_libxml_node_ptr *) 
obj-_private)-_private;
@@ -169,7 +169,7 @@
return NULL;
}
 }
-/* }}} end dom_object_get_data */
+/* }}} end php_dom_object_get_data */
 
 /* {{{ dom_read_na */
 static int dom_read_na(dom_object *obj, zval **retval TSRMLS_DC)
@@ -697,7 +697,7 @@
 
while (node != NULL) {
 
-   wrapper = dom_object_get_data(node);
+   wrapper = php_dom_object_get_data(node);
 
if (wrapper != NULL ) {
xmlUnlinkNode(node);
@@ -852,7 +852,7 @@
return wrapper;
}
 
-   if ((intern = (dom_object *) dom_object_get_data((void *) obj))) {
+   if ((intern = (dom_object *) php_dom_object_get_data((void *) obj))) {
return_value-type = IS_OBJECT;
return_value-is_ref = 1;
return_value-value.obj.handle = intern-handle;
Index: php-src/ext/dom/php_dom.h
diff -u php-src/ext/dom/php_dom.h:1.17 php-src/ext/dom/php_dom.h:1.18
--- php-src/ext/dom/php_dom.h:1.17  Sun Oct 26 10:57:02 2003
+++ php-src/ext/dom/php_dom.h   Fri Nov 28 16:55:59 2003
@@ -18,7 +18,7 @@
+--+
 */
 
-/* $Id: php_dom.h,v 1.17 2003/10/26 15:57:02 rrichards Exp $ */
+/* $Id: php_dom.h,v 1.18 2003/11/28 21:55:59 chregu Exp $ */
 
 #ifndef PHP_DOM_H
 #define PHP_DOM_H
@@ -36,6 +36,7 @@
 #include libxml/uri.h
 #include libxml/xmlerror.h
 #include libxml/xinclude.h
+#include libxml/hash.h
 #if defined(LIBXML_HTML_ENABLED)
 #include libxml/HTMLparser.h
 #include libxml/HTMLtree.h
Index: php-src/ext/dom/xml_common.h
diff -u php-src/ext/dom/xml_common.h:1.15 php-src/ext/dom/xml_common.h:1.16
--- php-src/ext/dom/xml_common.h:1.15   Sun Oct 26 10:57:02 2003
+++ php-src/ext/dom/xml_common.h

[PHP-CVS] cvs: php-src /ext/xsl php_xsl.c php_xsl.h /ext/xsl/tests xslt011.phpt xslt011.xml xslt011.xsl

2003-11-28 Thread Christian Stocker
chregu  Fri Nov 28 17:08:17 2003 EDT

  Added files: 
/php-src/ext/xsl/tests  xslt011.phpt xslt011.xml xslt011.xsl 

  Modified files:  
/php-src/ext/xslphp_xsl.c php_xsl.h 
  Log:
  @- Added possibility to call php functions as XSLT-functions (chregu)
  - Added possibility to call php functions as XSLT-functions
eg: xsl:value-of select=php:function('date','r')/ 
Namespace is http://php.net/functions
  
  
Index: php-src/ext/xsl/php_xsl.c
diff -u php-src/ext/xsl/php_xsl.c:1.9 php-src/ext/xsl/php_xsl.c:1.10
--- php-src/ext/xsl/php_xsl.c:1.9   Wed Nov 19 07:07:59 2003
+++ php-src/ext/xsl/php_xsl.c   Fri Nov 28 17:08:13 2003
@@ -16,7 +16,7 @@
   +--+
 */
 
-/* $Id: php_xsl.c,v 1.9 2003/11/19 12:07:59 chregu Exp $ */
+/* $Id: php_xsl.c,v 1.10 2003/11/28 22:08:13 chregu Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -27,6 +27,9 @@
 #include ext/standard/info.h
 #include php_xsl.h
 
+static void xsl_ext_function_string_php(xmlXPathParserContextPtr ctxt, int nargs);
+static void xsl_ext_function_object_php(xmlXPathParserContextPtr ctxt, int nargs);
+
 /* If you declare any globals in php_xsl.h uncomment this:
 ZEND_DECLARE_MODULE_GLOBALS(xsl)
 */
@@ -136,11 +139,150 @@
 #if HAVE_XSL_EXSLT
exsltRegisterAll();
 #endif
+   xsltRegisterExtModuleFunction ((const xmlChar *) functionString,
+  (const xmlChar *) http://php.net/xsl;,
+  xsl_ext_function_string_php);
+   xsltRegisterExtModuleFunction ((const xmlChar *) function,
+  (const xmlChar *) http://php.net/xsl;,
+  xsl_ext_function_object_php);
 
return SUCCESS;
 }
 /* }}} */
 
+
+static void xsl_ext_function_php(xmlXPathParserContextPtr ctxt, int nargs, int type)
+{
+   xsltTransformContextPtr tctxt;
+   zval **args;
+   zval *retval;
+   int result, i, ret;
+   zend_fcall_info fci;
+   zval handler;
+   xmlXPathObjectPtr obj;
+   char *str;
+
+   TSRMLS_FETCH();
+
+   tctxt = xsltXPathGetTransformContext(ctxt);
+   if (tctxt == NULL) {
+   xsltGenericError(xsltGenericErrorContext,
+   xsltExtFunctionTest: failed to get the transformation context\n);
+   return;
+   }
+
+   args = safe_emalloc(sizeof(zval **), nargs - 1, 0);
+   for (i = 0; i  nargs - 1; i++) {
+   obj = valuePop(ctxt);
+   MAKE_STD_ZVAL(args[i]);
+   switch (obj-type) {
+   case XPATH_STRING:
+   ZVAL_STRING(args[i],  obj-stringval, 1);
+   break;
+   case XPATH_BOOLEAN:
+   ZVAL_BOOL(args[i],  obj-boolval);
+   break;
+   case XPATH_NUMBER:
+   ZVAL_DOUBLE(args[i], obj-floatval);
+   break;
+   case XPATH_NODESET:
+   if (type == 1) {
+   str = xmlXPathCastToString(obj);
+   ZVAL_STRING(args[i], str, 1);
+   xmlFree(str);
+   } else if (type == 2) {
+   int j;
+   dom_object *intern;
+   array_init(args[i]);
+   if (obj-nodesetval-nodeNr  0) {
+   intern = (dom_object *) 
php_dom_object_get_data((void *) obj-nodesetval-nodeTab[0]-doc);
+   for (j = 0; j  
obj-nodesetval-nodeNr; j++) {
+   xmlNodePtr node = 
obj-nodesetval-nodeTab[j];
+   zval *child;
+   
+   MAKE_STD_ZVAL(child);
+   /* not sure, if we need 
this... it's copied from xpath.c */
+   if (node-type == 
XML_NAMESPACE_DECL) {
+   xmlNsPtr curns;
+   xmlNodePtr nsparent;
+   
+   nsparent = 
node-_private;
+   curns = xmlNewNs(NULL, 
node-name, NULL);
+   if (node-children) {
+

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

2003-11-28 Thread Wez Furlong
wez Fri Nov 28 17:11:35 2003 EDT

  Modified files:  (Branch: PHP_4_3)
/php-src/main   network.c streams.c 
  Log:
  Fix for bug #25939; feof not working correctly for sockets.
  Possibly also fixes #23220; warnings issued by fgets on ssl sockets.
  
  
Index: php-src/main/network.c
diff -u php-src/main/network.c:1.83.2.20 php-src/main/network.c:1.83.2.21
--- php-src/main/network.c:1.83.2.20Fri Oct 17 07:09:49 2003
+++ php-src/main/network.c  Fri Nov 28 17:11:34 2003
@@ -16,7 +16,7 @@
| Streams work by Wez Furlong [EMAIL PROTECTED]   |
+--+
  */
-/* $Id: network.c,v 1.83.2.20 2003/10/17 11:09:49 sas Exp $ */
+/* $Id: network.c,v 1.83.2.21 2003/11/28 22:11:34 wez Exp $ */
 
 /*#define DEBUG_MAIN_NETWORK 1*/
 
@@ -1139,8 +1139,14 @@
int alive = 1;
int fd = sock-socket;
fd_set rfds;
-   struct timeval tv = {0, 0};
+   struct timeval tv;
char buf;
+   
+   if (sock-timeout.tv_sec == -1) {
+   tv.tv_sec = FG(default_socket_timeout);
+   } else {
+   tv = sock-timeout;
+   }
 
/* logic: if the select call indicates that there is data to
 * be read, but a read returns 0 bytes of data, then the socket
Index: php-src/main/streams.c
diff -u php-src/main/streams.c:1.125.2.83 php-src/main/streams.c:1.125.2.84
--- php-src/main/streams.c:1.125.2.83   Thu Nov 27 19:00:34 2003
+++ php-src/main/streams.c  Fri Nov 28 17:11:34 2003
@@ -20,7 +20,7 @@
+--+
  */
 
-/* $Id: streams.c,v 1.125.2.83 2003/11/28 00:00:34 iliaa Exp $ */
+/* $Id: streams.c,v 1.125.2.84 2003/11/28 22:11:34 wez Exp $ */
 
 #define _GNU_SOURCE
 #include php.h
@@ -659,6 +659,10 @@
if (stream-writepos - stream-readpos  0)
return 0;
 
+   if (!stream-eof  php_stream_is(stream, PHP_STREAM_IS_SOCKET)) {
+   stream-eof = !_php_network_is_stream_alive(stream);
+   }
+   
return stream-eof;
 }
 

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

2003-11-28 Thread Wez Furlong
wez Fri Nov 28 17:48:32 2003 EDT

  Modified files:  (Branch: PHP_4_3)
/php-src/main   streams.c 
  Log:
  Probable fix for #25575; STDIN/STDOUT/STDERR streams not registered
  as network sockets when PHP run from x?inetd.
  
  
Index: php-src/main/streams.c
diff -u php-src/main/streams.c:1.125.2.84 php-src/main/streams.c:1.125.2.85
--- php-src/main/streams.c:1.125.2.84   Fri Nov 28 17:11:34 2003
+++ php-src/main/streams.c  Fri Nov 28 17:48:31 2003
@@ -20,7 +20,7 @@
+--+
  */
 
-/* $Id: streams.c,v 1.125.2.84 2003/11/28 22:11:34 wez Exp $ */
+/* $Id: streams.c,v 1.125.2.85 2003/11/28 22:48:31 wez Exp $ */
 
 #define _GNU_SOURCE
 #include php.h
@@ -2016,6 +2016,16 @@
 {
php_stdio_stream_data *self;
php_stream *stream;
+#if defined(S_ISFIFO) || defined(S_ISSOCK)
+   struct stat sb;
+   int stat_ok;
+
+   stat_ok = fd = 0  fstat(fd, sb) == 0;
+
+   if (stat_ok  S_ISSOCK(sb.st_mode)) {
+   return _php_stream_sock_open_from_socket(fd, persistent_id STREAMS_CC 
TSRMLS_CC);
+   }
+#endif
 
self = pemalloc_rel_orig(sizeof(*self), persistent_id);
memset(self, 0, sizeof(*self));
@@ -2027,9 +2037,8 @@
 
 #ifdef S_ISFIFO
/* detect if this is a pipe */
-   if (self-fd = 0) {
-   struct stat sb;
-   self-is_pipe = (fstat(self-fd, sb) == 0  S_ISFIFO(sb.st_mode)) ? 
1 : 0;
+   if (stat_ok) {
+   self-is_pipe = S_ISFIFO(sb.st_mode) ? 1 : 0;
}
 #elif defined(PHP_WIN32)
{

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



[PHP-CVS] cvs: php-src /ext/openssl xp_ssl.c /main/streams streams.c xp_socket.c

2003-11-28 Thread Wez Furlong
wez Fri Nov 28 18:20:23 2003 EDT

  Modified files:  
/php-src/ext/opensslxp_ssl.c 
/php-src/main/streams   streams.c xp_socket.c 
  Log:
  (sort of) MFB, feof fix for sockets.
  
  
Index: php-src/ext/openssl/xp_ssl.c
diff -u php-src/ext/openssl/xp_ssl.c:1.11 php-src/ext/openssl/xp_ssl.c:1.12
--- php-src/ext/openssl/xp_ssl.c:1.11   Thu Nov 27 12:40:15 2003
+++ php-src/ext/openssl/xp_ssl.cFri Nov 28 18:20:22 2003
@@ -16,7 +16,7 @@
   +--+
 */
 
-/* $Id: xp_ssl.c,v 1.11 2003/11/27 17:40:15 wez Exp $ */
+/* $Id: xp_ssl.c,v 1.12 2003/11/28 23:20:22 wez Exp $ */
 
 #include php.h
 #include ext/standard/file.h
@@ -437,10 +437,16 @@
case PHP_STREAM_OPTION_CHECK_LIVENESS:
{
fd_set rfds;
-   struct timeval tv = {0,0};
+   struct timeval tv;
char buf;
int alive = 1;
 
+   if (sslsock-s.timeout.tv_sec == -1) {
+   tv.tv_sec = FG(default_socket_timeout);
+   } else {
+   tv = sslsock-s.timeout;
+   }
+
if (sslsock-s.socket == -1) {
alive = 0;
} else {
Index: php-src/main/streams/streams.c
diff -u php-src/main/streams/streams.c:1.41 php-src/main/streams/streams.c:1.42
--- php-src/main/streams/streams.c:1.41 Thu Nov 27 19:00:28 2003
+++ php-src/main/streams/streams.c  Fri Nov 28 18:20:23 2003
@@ -19,7 +19,7 @@
+--+
  */
 
-/* $Id: streams.c,v 1.41 2003/11/28 00:00:28 iliaa Exp $ */
+/* $Id: streams.c,v 1.42 2003/11/28 23:20:23 wez Exp $ */
 
 #define _GNU_SOURCE
 #include php.h
@@ -602,6 +602,12 @@
return 0;
}
 
+   if (!stream-eof  PHP_STREAM_OPTION_RETURN_ERR ==
+   php_stream_set_option(stream, PHP_STREAM_OPTION_CHECK_LIVENESS,
+   0, NULL)) {
+   stream-eof = 1;
+   }
+
return stream-eof;
 }
 
@@ -1113,7 +1119,7 @@
break;

default:
-   ret = PHP_STREAM_OPTION_RETURN_ERR;
+   ;
}
}
 
Index: php-src/main/streams/xp_socket.c
diff -u php-src/main/streams/xp_socket.c:1.16 php-src/main/streams/xp_socket.c:1.17
--- php-src/main/streams/xp_socket.c:1.16   Thu Nov 27 12:39:01 2003
+++ php-src/main/streams/xp_socket.cFri Nov 28 18:20:23 2003
@@ -16,7 +16,7 @@
   +--+
 */
 
-/* $Id: xp_socket.c,v 1.16 2003/11/27 17:39:01 wez Exp $ */
+/* $Id: xp_socket.c,v 1.17 2003/11/28 23:20:23 wez Exp $ */
 
 #include php.h
 #include ext/standard/file.h
@@ -203,10 +203,16 @@
case PHP_STREAM_OPTION_CHECK_LIVENESS:
{
fd_set rfds;
-   struct timeval tv = {0,0};
+   struct timeval tv;
char buf;
int alive = 1;
 
+   if (sock-timeout.tv_sec == -1) {
+   tv.tv_sec = FG(default_socket_timeout);
+   } else {
+   tv = sock-timeout;
+   }
+
if (sock-socket == -1) {
alive = 0;
} else {

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



[PHP-CVS] cvs: php-src / NEWS /ext/libxml libxml.c /ext/standard basic_functions.h filestat.c ftp_fopen_wrapper.c /main php_streams.h /main/streams plain_wrapper.c streams.c

2003-11-28 Thread Sara Golemon
pollita Fri Nov 28 18:25:29 2003 EDT

  Modified files:  
/php-src/ext/libxml libxml.c 
/php-src/ext/standard   basic_functions.h filestat.c 
ftp_fopen_wrapper.c 
/php-src/main   php_streams.h 
/php-src/main/streams   plain_wrapper.c streams.c 
/php-srcNEWS 
  Log:
  Route php_stat() via streams/url_stat API (php_stream_stat_path).
  This enables fopen-wrappers support on stat() and related family calls.
  
  Index: php-src/ext/libxml/libxml.c
diff -u php-src/ext/libxml/libxml.c:1.8 php-src/ext/libxml/libxml.c:1.9
--- php-src/ext/libxml/libxml.c:1.8 Fri Nov  7 14:12:46 2003
+++ php-src/ext/libxml/libxml.c Fri Nov 28 18:25:25 2003
@@ -17,7 +17,7 @@
+--+
  */
 
-/* $Id: libxml.c,v 1.8 2003/11/07 19:12:46 iliaa Exp $ */
+/* $Id: libxml.c,v 1.9 2003/11/28 23:25:25 pollita Exp $ */
 
 #define IS_EXT_MODULE
 
@@ -253,7 +253,7 @@
   in xml processing (eg. DTD files)  */
wrapper = php_stream_locate_url_wrapper(resolved_path, path_to_open, 
ENFORCE_SAFE_MODE TSRMLS_CC);
if (wrapper  wrapper-wops-url_stat) {
-   if (wrapper-wops-url_stat(wrapper, path_to_open, ssbuf TSRMLS_CC) 
== -1) {
+   if (wrapper-wops-url_stat(wrapper, path_to_open, 0, ssbuf, NULL 
TSRMLS_CC) == -1) {
return NULL;
}
}
Index: php-src/ext/standard/basic_functions.h
diff -u php-src/ext/standard/basic_functions.h:1.129 
php-src/ext/standard/basic_functions.h:1.130
--- php-src/ext/standard/basic_functions.h:1.129Sun Nov 23 20:17:27 2003
+++ php-src/ext/standard/basic_functions.h  Fri Nov 28 18:25:26 2003
@@ -17,7 +17,7 @@
+--+
 */
 
-/* $Id: basic_functions.h,v 1.129 2003/11/24 01:17:27 iliaa Exp $ */
+/* $Id: basic_functions.h,v 1.130 2003/11/28 23:25:26 pollita Exp $ */
 
 #ifndef BASIC_FUNCTIONS_H
 #define BASIC_FUNCTIONS_H
@@ -170,11 +170,9 @@
long page_inode;
long page_mtime;
 
-   /* filestat.c */
-   char *CurrentStatFile;
-   php_stat_len CurrentStatLength;
-   struct stat sb;
-   struct stat lsb;
+   /* filestat.c  main/streams/streams.c */
+   char *CurrentStatFile, *CurrentLStatFile;
+   php_stream_statbuf *ssb, *lssb;
 
/* rand.c */
php_uint32   state[MT_N+1];  /* state vector + 1 extra to not violate ANSI C */
Index: php-src/ext/standard/filestat.c
diff -u php-src/ext/standard/filestat.c:1.127 php-src/ext/standard/filestat.c:1.128
--- php-src/ext/standard/filestat.c:1.127   Fri Nov  7 04:16:16 2003
+++ php-src/ext/standard/filestat.c Fri Nov 28 18:25:26 2003
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: filestat.c,v 1.127 2003/11/07 09:16:16 helly Exp $ */
+/* $Id: filestat.c,v 1.128 2003/11/28 23:25:26 pollita Exp $ */
 
 #include php.h
 #include safe_mode.h
@@ -99,7 +99,7 @@
 PHP_RINIT_FUNCTION(filestat)
 {
BG(CurrentStatFile)=NULL;
-   BG(CurrentStatLength)=0;
+   BG(CurrentLStatFile)=NULL;
return SUCCESS;
 }
 
@@ -108,6 +108,9 @@
if (BG(CurrentStatFile)) {
efree (BG(CurrentStatFile));
}
+   if (BG(CurrentLStatFile)) {
+   efree (BG(CurrentLStatFile));
+   }
return SUCCESS;
 }
 
@@ -526,11 +529,16 @@
efree(BG(CurrentStatFile));
BG(CurrentStatFile) = NULL;
}
+   if (BG(CurrentLStatFile)) {
+   efree(BG(CurrentLStatFile));
+   BG(CurrentLStatFile) = NULL;
+   }
 }
 /* }}} */
 
 #define IS_LINK_OPERATION(__t) ((__t) == FS_TYPE || (__t) == FS_IS_LINK || (__t) == 
FS_LSTAT)
 #define IS_EXISTS_CHECK(__t) ((__t) == FS_EXISTS  || (__t) == FS_IS_W || (__t) == 
FS_IS_R || (__t) == FS_IS_X || (__t) == FS_IS_FILE || (__t) == FS_IS_DIR || (__t) == 
FS_IS_LINK)
+#define IS_ABLE_CHECK(__t) ((__t) == FS_IS_R || (__t) == FS_IS_W || (__t) == FS_IS_X)
 
 /* {{{ php_stat
  */
@@ -543,6 +551,7 @@
 #else
struct stat *stat_sb;
 #endif
+   php_stream_statbuf ssb;
int rmask=S_IROTH, wmask=S_IWOTH, xmask=S_IXOTH; /* access rights defaults to 
other */
char *stat_sb_names[13]={dev, ino, mode, nlink, uid, gid, rdev,
  size, atime, mtime, ctime, blksize, blocks};
@@ -559,65 +568,25 @@
RETURN_FALSE;
}
 
-   switch (type) {
-   case FS_IS_W:
-   RETURN_BOOL (!VCWD_ACCESS(filename, W_OK));
-   case FS_IS_R:
-   RETURN_BOOL (!VCWD_ACCESS(filename, R_OK));
-   case FS_IS_X:
-   RETURN_BOOL (!VCWD_ACCESS(filename, X_OK));
-   case FS_EXISTS:
-   RETURN_BOOL (!VCWD_ACCESS(filename, F_OK));
-   }
-
-   stat_sb = BG(sb);
-
- 

[PHP-CVS] cvs: php-src(PHP_4_3) /ext/domxml php_domxml.c /ext/domxml/tests bug26384.phpt

2003-11-28 Thread Christian Stocker
chregu  Fri Nov 28 19:43:39 2003 EDT

  Added files: (Branch: PHP_4_3)
/php-src/ext/domxml/tests   bug26384.phpt 

  Modified files:  
/php-src/ext/domxml php_domxml.c 
  Log:
  enhanced bug-26384-fix. It now only does an DocCopy, if xsl:key was
  found in xslt-document by default.
  
  
Index: php-src/ext/domxml/php_domxml.c
diff -u php-src/ext/domxml/php_domxml.c:1.218.2.38 
php-src/ext/domxml/php_domxml.c:1.218.2.39
--- php-src/ext/domxml/php_domxml.c:1.218.2.38  Fri Nov 28 12:39:25 2003
+++ php-src/ext/domxml/php_domxml.c Fri Nov 28 19:43:37 2003
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: php_domxml.c,v 1.218.2.38 2003/11/28 17:39:25 rrichards Exp $ */
+/* $Id: php_domxml.c,v 1.218.2.39 2003/11/29 00:43:37 chregu Exp $ */
 
 /* TODO
  * - Support Notation Nodes
@@ -202,6 +202,7 @@
 zend_class_entry *domxsltstylesheet_class_entry;
 #endif
 
+static int xslt_has_xsl_keys (xmlDocPtr doc);
 
 static int node_attributes(zval **attributes, xmlNode *nodep TSRMLS_DC);
 static int node_children(zval **children, xmlNode *nodep TSRMLS_DC);
@@ -4724,6 +4725,21 @@
 /* }}} */
 #endif
 
+static int xslt_has_xsl_keys (xmlDocPtr doc) {
+   
+   xmlNode *nodep;
+   nodep = xmlDocGetRootElement(doc)-children;
+   while (nodep) {
+   if (nodep-type == XML_ELEMENT_NODE  xmlStrEqual(nodep-name, key) 
 xmlStrEqual(nodep-ns-href, XSLT_NAMESPACE)) {
+   return 1;
+   break;
+   }
+   nodep = nodep-next;
+   }
+   return 0;
+}
+
+
 /* {{{ int node_attributes(zval **attributes, int node)
Returns list of children nodes */
 static int node_attributes(zval **attributes, xmlNode *nodep TSRMLS_DC)
@@ -5382,7 +5398,7 @@
xmlDocPtr xmldocp;
xmlDocPtr docp;
char **params = NULL;
-   int ret, clone = 0;
+   int ret, clone = -1;
char *filename;
int filename_len = 0;
FILE *f;
@@ -5404,7 +5420,10 @@
}
 
DOMXML_GET_OBJ(xmldocp, idxml, le_domxmldocp);
-
+   if (clone == -1  xslt_has_xsl_keys(xsltstp-doc) == 1) {
+   clone = 1;
+   }
+   
if (idparams) {
params = php_domxslt_make_params(idparams, xpath_params TSRMLS_CC);
}

Index: php-src/ext/domxml/tests/bug26384.phpt
+++ php-src/ext/domxml/tests/bug26384.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) /ext/domxml/tests area_list.xsl area_name.xml

2003-11-28 Thread Christian Stocker
chregu  Fri Nov 28 19:53:35 2003 EDT

  Added files: (Branch: PHP_4_3)
/php-src/ext/domxml/tests   area_list.xsl area_name.xml 
  Log:
  add xml files for bug26384.phpt
  
  

Index: php-src/ext/domxml/tests/area_list.xsl
+++ php-src/ext/domxml/tests/area_list.xsl

Index: php-src/ext/domxml/tests/area_name.xml
+++ php-src/ext/domxml/tests/area_name.xml

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



[PHP-CVS] cvs: php-src /ext/ncurses ncurses.c

2003-11-28 Thread Sara Golemon
pollita Fri Nov 28 21:04:38 2003 EDT

  Modified files:  
/php-src/ext/ncursesncurses.c 
  Log:
  Handle dirty script exit.
  
Index: php-src/ext/ncurses/ncurses.c
diff -u php-src/ext/ncurses/ncurses.c:1.25 php-src/ext/ncurses/ncurses.c:1.26
--- php-src/ext/ncurses/ncurses.c:1.25  Tue Jun 10 16:03:33 2003
+++ php-src/ext/ncurses/ncurses.c   Fri Nov 28 21:04:37 2003
@@ -266,6 +266,10 @@
  */
 PHP_MSHUTDOWN_FUNCTION(ncurses)
 {
+   if (NCURSES_G(registered_constants)) {
+   endwin();
+   }
+
return SUCCESS;
 }
 /* }}} */

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



[PHP-CVS] cvs: php-src /tests/lang bug24926.phpt

2003-11-28 Thread Jani Taskinen
sniper  Fri Nov 28 21:28:50 2003 EDT

  Added files: 
/php-src/tests/lang bug24926.phpt 
  Log:
  test for bug #24926
  

Index: php-src/tests/lang/bug24926.phpt
+++ php-src/tests/lang/bug24926.phpt
--TEST--
Bug #24926 (lambda function (create_function()) cannot be stored in a class property)
--FILE--
?php

error_reporting (E_ALL);

class foo {

public $functions = array();

function foo()
{
$function = create_function('', 'return FOO\n;');
print($function());

$this-functions['test'] = $function;
print($this-functions['test']());// werkt al niet meer

}
}

$a = new foo ();

?
--EXPECT--
FOO
FOO

-- 
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) /tests/lang bug24926.phpt

2003-11-28 Thread Jani Taskinen
sniper  Fri Nov 28 21:29:05 2003 EDT

  Added files: (Branch: PHP_4_3)
/php-src/tests/lang bug24926.phpt 
  Log:
  MFH
  

Index: php-src/tests/lang/bug24926.phpt
+++ php-src/tests/lang/bug24926.phpt
--TEST--
Bug #24926 (lambda function (create_function()) cannot be stored in a class property)
--FILE--
?php

error_reporting (E_ALL);

class foo {

public $functions = array();

function foo()
{
$function = create_function('', 'return FOO\n;');
print($function());

$this-functions['test'] = $function;
print($this-functions['test']());// werkt al niet meer

}
}

$a = new foo ();

?
--EXPECT--
FOO
FOO

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



[PHP-CVS] cvs: php-src / NEWS

2003-11-28 Thread Jani Taskinen
sniper  Fri Nov 28 21:49:04 2003 EDT

  Modified files:  
/php-srcNEWS 
  Log:
  news for xslt
  
Index: php-src/NEWS
diff -u php-src/NEWS:1.1506 php-src/NEWS:1.1507
--- php-src/NEWS:1.1506 Fri Nov 28 18:25:28 2003
+++ php-src/NEWSFri Nov 28 21:49:03 2003
@@ -1,6 +1,7 @@
 PHPNEWS
 |||
 ?? Oct 2003, PHP 5 Beta 3
+- Added possibility to call PHP functions as XSLT-functions. (Christian)
 - Added new functions:
   . dba_key_split() to split inifile keys in an array. (Marcus)
   . time_nanosleep() signal safe sleep (Magnus, Ilia)

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



Re: [PHP-CVS] cvs: php-src /ext/xsl php_xsl.c php_xsl.h /ext/xsl/tests xslt011.phpt xslt011.xml xslt011.xsl

2003-11-28 Thread Jani Taskinen
On Fri, 28 Nov 2003, Christian Stocker wrote:

chregu Fri Nov 28 17:08:17 2003 EDT

  Added files: 
/php-src/ext/xsl/tests xslt011.phpt xslt011.xml xslt011.xsl 

  Modified files:  
/php-src/ext/xsl   php_xsl.c php_xsl.h 
  Log:
  @- Added possibility to call php functions as XSLT-functions (chregu)
  - Added possibility to call php functions as XSLT-functions
eg: xsl:value-of select=php:function('date','r')/ 
Namespace is http://php.net/functions

Don't use @, it doesn't work, edit NEWS manually.
(I added this already, but the next time..:)

--Jani
  


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



[PHP-CVS] cvs: php-src / php.ini-dist php.ini-recommended

2003-11-28 Thread Sara Golemon
pollita Fri Nov 28 21:49:58 2003 EDT

  Modified files:  
/php-srcphp.ini-recommended php.ini-dist 
  Log:
  Update php.ini-* with E_STRICT error reporting level.  -dist excludes E_STRICT, 
-recommended includes it.
  
Index: php-src/php.ini-recommended
diff -u php-src/php.ini-recommended:1.145 php-src/php.ini-recommended:1.146
--- php-src/php.ini-recommended:1.145   Thu Nov 20 02:46:46 2003
+++ php-src/php.ini-recommended Fri Nov 28 21:49:57 2003
@@ -261,6 +261,9 @@
 ; intentional (e.g., using an uninitialized variable and
 ; relying on the fact it's automatically initialized to an
 ; empty string)
+; E_STRICT  - run-time notices, enable to have PHP suggest changes
+; to your code which will ensure the best interoperability
+; and forward compatability of your code
 ; E_CORE_ERROR  - fatal errors that occur during PHP's initial startup
 ; E_CORE_WARNING- warnings (non-fatal errors) that occur during PHP's
 ; initial startup
@@ -272,6 +275,10 @@
 ;
 ; Examples:
 ;
+;   - Show all errors, except for notices and coding standards warnings
+;
+;error_reporting = E_ALL  ~E_NOTICE  ~E_STRICT
+;
 ;   - Show all errors, except for notices
 ;
 ;error_reporting = E_ALL  ~E_NOTICE
Index: php-src/php.ini-dist
diff -u php-src/php.ini-dist:1.200 php-src/php.ini-dist:1.201
--- php-src/php.ini-dist:1.200  Thu Nov 20 02:46:46 2003
+++ php-src/php.ini-distFri Nov 28 21:49:57 2003
@@ -246,6 +246,9 @@
 ; intentional (e.g., using an uninitialized variable and
 ; relying on the fact it's automatically initialized to an
 ; empty string)
+; E_STRICT - run-time notices, enable to have PHP suggest changes
+; to your code which will ensure the best interoperability
+; and forward compatability of your code
 ; E_CORE_ERROR  - fatal errors that occur during PHP's initial startup
 ; E_CORE_WARNING- warnings (non-fatal errors) that occur during PHP's
 ; initial startup
@@ -265,9 +268,9 @@
 ;
 ;error_reporting = E_COMPILE_ERROR|E_ERROR|E_CORE_ERROR
 ;
-;   - Show all errors except for notices
+;   - Show all errors except for notices and coding standards warnings
 ;
-error_reporting  =  E_ALL  ~E_NOTICE
+error_reporting  =  E_ALL  ~E_NOTICE  ~E_STRICT
 
 ; Print out errors (as a part of the output).  For production web sites,
 ; you're strongly encouraged to turn this feature off, and use error logging

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



Re: [PHP-CVS] cvs: php-src /ext/ncurses ncurses.c

2003-11-28 Thread Jani Taskinen

MFH?

--Jani

On Sat, 29 Nov 2003, Sara Golemon wrote:

pollitaFri Nov 28 21:04:38 2003 EDT

  Modified files:  
/php-src/ext/ncurses   ncurses.c 
  Log:
  Handle dirty script exit.
  
Index: php-src/ext/ncurses/ncurses.c
diff -u php-src/ext/ncurses/ncurses.c:1.25 php-src/ext/ncurses/ncurses.c:1.26
--- php-src/ext/ncurses/ncurses.c:1.25 Tue Jun 10 16:03:33 2003
+++ php-src/ext/ncurses/ncurses.c  Fri Nov 28 21:04:37 2003
@@ -266,6 +266,10 @@
  */
 PHP_MSHUTDOWN_FUNCTION(ncurses)
 {
+  if (NCURSES_G(registered_constants)) {
+  endwin();
+  }
+
   return SUCCESS;
 }
 /* }}} */



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

2003-11-28 Thread Sara Golemon
pollita Fri Nov 28 22:41:09 2003 EDT

  Modified files:  (Branch: PHP_4_3)
/php-src/ext/ncursesncurses.c 
  Log:
  MFH
  
Index: php-src/ext/ncurses/ncurses.c
diff -u php-src/ext/ncurses/ncurses.c:1.18.2.4 php-src/ext/ncurses/ncurses.c:1.18.2.5
--- php-src/ext/ncurses/ncurses.c:1.18.2.4  Tue Dec 31 11:35:01 2002
+++ php-src/ext/ncurses/ncurses.c   Fri Nov 28 22:41:09 2003
@@ -266,6 +266,9 @@
  */
 PHP_MSHUTDOWN_FUNCTION(ncurses)
 {
+   if (NCURSES_G(registered_constants)) {
+   endwin();
+   }
return SUCCESS;
 }
 /* }}} */

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



[PHP-CVS] cvs: php-src /ext/standard var.c /ext/standard/tests/array 007.phpt array_intersect_1.phpt bug26458.phpt

2003-11-28 Thread Ilia Alshanetsky
iliaa   Fri Nov 28 23:43:07 2003 EDT

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

  Modified files:  
/php-src/ext/standard   var.c 
/php-src/ext/standard/tests/array   array_intersect_1.phpt 007.phpt 
  Log:
  Fixed bug #26458 (var_dump(), var_export(), debug_zval_dump() not binary 
  safe for array keys).
  
  Index: php-src/ext/standard/var.c
diff -u php-src/ext/standard/var.c:1.176 php-src/ext/standard/var.c:1.177
--- php-src/ext/standard/var.c:1.176Fri Nov 28 10:42:58 2003
+++ php-src/ext/standard/var.c  Fri Nov 28 23:43:06 2003
@@ -18,7 +18,7 @@
+--+
 */
 
-/* $Id: var.c,v 1.176 2003/11/28 15:42:58 wez Exp $ */
+/* $Id: var.c,v 1.177 2003/11/29 04:43:06 iliaa Exp $ */
 
 
 /* {{{ includes 
@@ -50,7 +50,15 @@
if (hash_key-nKeyLength==0) { /* numeric key */
php_printf(%*c[%ld]=\n, level + 1, ' ', hash_key-h);
} else { /* string key */
-   php_printf(%*c[\%s\]=\n, level + 1, ' ', hash_key-arKey);
+   if (va_arg(args, int)  hash_key-arKey[0] == '\0') { 
+   /* XXX: perphaps when we are inside the class we should permit 
access to 
+* private  protected values
+*/
+   return 0;
+   }
+   php_printf(%*c[\, level + 1, ' ');
+   PHPWRITE(hash_key-arKey, hash_key-nKeyLength - 1);
+   php_printf(\]=\n);
}
php_var_dump(zv, level + 2 TSRMLS_CC);
return 0;
@@ -107,7 +115,7 @@
efree(class_name);
 head_done:
if (myht) {
-   zend_hash_apply_with_arguments(myht, (apply_func_args_t) 
php_array_element_dump, 1, level);
+   zend_hash_apply_with_arguments(myht, (apply_func_args_t) 
php_array_element_dump, 1, level, (Z_TYPE_PP(struc) == IS_ARRAY ? 0 : 1));
}
if (level  1) {
php_printf(%*c, level-1, ' ');
@@ -166,7 +174,15 @@
if (hash_key-nKeyLength==0) { /* numeric key */
php_printf(%*c[%ld]=\n, level + 1, ' ', hash_key-h);
} else { /* string key */
-   php_printf(%*c[\%s\]=\n, level + 1, ' ', hash_key-arKey);
+   /* XXX: perphaps when we are inside the class we should permit access 
to 
+* private  protected values
+*/
+   if (va_arg(args, int)  hash_key-arKey[0] == '\0') {
+   return 0;
+   }
+   php_printf(%*c[\, level + 1, ' ');
+   PHPWRITE(hash_key-arKey, hash_key-nKeyLength - 1);
+   php_printf(\]=\n);
}
php_debug_zval_dump(zv, level + 2 TSRMLS_CC);
return 0;
@@ -213,7 +229,7 @@
efree(class_name);
 head_done:
if (myht) {
-   zend_hash_apply_with_arguments(myht, (apply_func_args_t) 
zval_array_element_dump, 1, level);
+   zend_hash_apply_with_arguments(myht, (apply_func_args_t) 
zval_array_element_dump, 1, level, (Z_TYPE_PP(struc) == IS_ARRAY ? 0 : 1));
}
if (level  1) {
php_printf(%*c, level-1, ' ');
@@ -271,11 +287,20 @@
if (hash_key-nKeyLength==0) { /* numeric key */
php_printf(%*c%ld = , level + 1, ' ', hash_key-h);
} else { /* string key */
-   char *key;
-   int key_len;
-   key = php_addcslashes(hash_key-arKey, hash_key-nKeyLength - 1, 
key_len, 0, '\\, 2 TSRMLS_CC);
-   php_printf(%*c'%s' = , level + 1, ' ', key);
-   efree(key);
+   /* XXX: perphaps when we are inside the class we should permit access 
to 
+* private  protected values
+*/
+   if (va_arg(args, int)  hash_key-arKey[0] == '\0') {
+   return 0;
+   } else {
+   char *key;
+   int key_len;
+   key = php_addcslashes(hash_key-arKey, hash_key-nKeyLength - 
1, key_len, 0, '\\, 2 TSRMLS_CC);
+   php_printf(%*c', level + 1, ' ');
+   PHPWRITE(key, key_len);
+   php_printf(' = );
+   efree(key);
+   }
}
php_var_export(zv, level + 2 TSRMLS_CC);
PUTS (,\n);
@@ -331,7 +356,7 @@
php_printf(\n%*c, level - 1, ' ');
}
PUTS (array (\n);
-   zend_hash_apply_with_arguments(myht, (apply_func_args_t) 
php_array_element_export, 1, level);
+   zend_hash_apply_with_arguments(myht, (apply_func_args_t) 
php_array_element_export, 1, level, (Z_TYPE_PP(struc) == IS_ARRAY ? 0 : 1));
if (level  1) {

[PHP-CVS] cvs: php-src(PHP_4_3) /ext/standard var.c /ext/standard/tests/array bug26458.phpt

2003-11-28 Thread Ilia Alshanetsky
iliaa   Fri Nov 28 23:43:12 2003 EDT

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

  Modified files:  
/php-src/ext/standard   var.c 
  Log:
  MFH: Fixed bug #26458 (var_dump(), var_export(), debug_zval_dump() not 
  binary safe for array keys).
  
  
Index: php-src/ext/standard/var.c
diff -u php-src/ext/standard/var.c:1.150.2.12 php-src/ext/standard/var.c:1.150.2.13
--- php-src/ext/standard/var.c:1.150.2.12   Tue Oct  7 21:52:07 2003
+++ php-src/ext/standard/var.c  Fri Nov 28 23:43:11 2003
@@ -51,7 +51,9 @@
if (hash_key-nKeyLength==0) { /* numeric key */
php_printf(%*c[%ld]=\n, level + 1, ' ', hash_key-h);
} else { /* string key */
-   php_printf(%*c[\%s\]=\n, level + 1, ' ', hash_key-arKey);
+   php_printf(%*c[\, level + 1, ' ');
+   PHPWRITE(hash_key-arKey, hash_key-nKeyLength - 1);
+   php_printf(\]=\n);
}
php_var_dump(zv, level + 2 TSRMLS_CC);
return 0;
@@ -159,7 +161,9 @@
if (hash_key-nKeyLength==0) { /* numeric key */
php_printf(%*c[%ld]=\n, level + 1, ' ', hash_key-h);
} else { /* string key */
-   php_printf(%*c[\%s\]=\n, level + 1, ' ', hash_key-arKey);
+   php_printf(%*c[\, level + 1, ' ');
+   PHPWRITE(hash_key-arKey, hash_key-nKeyLength - 1);
+   php_printf(\]=\n);
}
php_debug_zval_dump(zv, level + 2 TSRMLS_CC);
return 0;
@@ -259,7 +263,9 @@
char *key;
int key_len;
key = php_addcslashes(hash_key-arKey, hash_key-nKeyLength - 1, 
key_len, 0, '\\, 2 TSRMLS_CC);
-   php_printf(%*c'%s' = , level + 1, ' ', key);
+   php_printf(%*c', level + 1, ' ');
+   PHPWRITE(key, key_len);
+   php_printf(' = );
efree(key);
}
php_var_export(zv, level + 2 TSRMLS_CC);

Index: php-src/ext/standard/tests/array/bug26458.phpt
+++ php-src/ext/standard/tests/array/bug26458.phpt
--TEST--
Bug #26458 (var_dump(), var_export()  debug_zval_dump() are not binary safe for array 
keys)
--FILE--
?php
$test = array(A\x00B = Hello world);
var_dump($test);
var_export($test);
debug_zval_dump($test);
?
--EXPECT--
array(1) {
  [AB]=
  string(11) Hello world
}
array (
  'AB' = 'Hello world',
)array(1) refcount(2){
  [AB]=
  string(11) Hello world refcount(1)
}

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



[PHP-CVS] cvs: php-src /win32 php5ts.dsw

2003-11-28 Thread Jani Taskinen
sniper  Sat Nov 29 00:12:24 2003 EDT

  Modified files:  
/php-src/win32  php5ts.dsw 
  Log:
  - remove non-existing servlet entry
  
Index: php-src/win32/php5ts.dsw
diff -u php-src/win32/php5ts.dsw:1.20 php-src/win32/php5ts.dsw:1.21
--- php-src/win32/php5ts.dsw:1.20   Fri Jun 27 10:34:06 2003
+++ php-src/win32/php5ts.dswSat Nov 29 00:12:23 2003
@@ -213,18 +213,6 @@
 
 ###
 
-Project: servlet=..\sapi\servlet\servlet.dsp - Package Owner=4
-
-Package=5
-{{{
-}}}
-
-Package=4
-{{{
-}}}
-
-###
-
 Project: testsuite=.\testsuite.dsp - Package Owner=4
 
 Package=5

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