[PHP-CVS] cvs: php4 /tests/classes inheritance_002.phpt

2003-06-06 Thread Marcus Boerger
helly   Fri Jun  6 20:57:07 2003 EDT

  Modified files:  
/php4/tests/classes inheritance_002.phpt 
  Log:
  Goodbye namespaces
  
Index: php4/tests/classes/inheritance_002.phpt
diff -u php4/tests/classes/inheritance_002.phpt:1.1 
php4/tests/classes/inheritance_002.phpt:1.2
--- php4/tests/classes/inheritance_002.phpt:1.1 Sat Apr 19 14:21:58 2003
+++ php4/tests/classes/inheritance_002.phpt Fri Jun  6 20:57:07 2003
@@ -4,73 +4,65 @@
 
 --FILE--
 
 --EXPECT--
 ### PHP4 style
@@ -84,4 +76,4 @@
 string(16) "Base constructor"
 ### Mixed style 2
 string(17) "Child constructor"
-string(16) "Base constructor"
\ No newline at end of file
+string(16) "Base constructor"



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



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

2003-06-06 Thread Sterling Hughes
sterlingFri Jun  6 16:10:05 2003 EDT

  Modified files:  
/php4/ext/dom   text.c 
  Log:
  add splitText()
  never has such a complex process been endured for such a simple function
  libxml makes me queasy right now :)
  
  
Index: php4/ext/dom/text.c
diff -u php4/ext/dom/text.c:1.1 php4/ext/dom/text.c:1.2
--- php4/ext/dom/text.c:1.1 Thu Jun  5 13:06:52 2003
+++ php4/ext/dom/text.c Fri Jun  6 16:10:05 2003
@@ -17,7 +17,7 @@
+--+
 */
 
-/* $Id: text.c,v 1.1 2003/06/05 17:06:52 rrichards Exp $ */
+/* $Id: text.c,v 1.2 2003/06/06 20:10:05 sterling Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -25,7 +25,7 @@
 
 #include "php.h"
 #include "php_dom.h"
-
+#include "dom_ce.h"
 
 /*
 * class domtext extends domcharacterdata 
@@ -97,7 +97,49 @@
 */
 PHP_FUNCTION(dom_text_split_text)
 {
- DOM_NOT_IMPLEMENTED();
+   zval   *id;
+   xmlChar*cur;
+   xmlChar*first;
+   xmlChar*second;
+   xmlNodePtr  node;
+   xmlNodePtr  nnode;
+   longoffset;
+   int ret;
+   int length;
+
+   DOM_GET_THIS_OBJ(node, getThis(), xmlNodePtr);
+
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &offset) == FAILURE) 
{
+   return;
+   }
+
+   if (node->type != XML_TEXT_NODE) {
+   RETURN_FALSE;
+   }
+
+   cur = xmlNodeListGetString(node->doc, node, 1);
+   if (cur == NULL) {
+   RETURN_FALSE;
+   }
+   length = xmlStrlen(cur);
+
+   if (offset > length || offset < 0) {
+   RETURN_FALSE;
+   }
+
+   first = xmlStrndup(cur, offset);
+   second = xmlStrdup(cur + offset);
+   
+   xmlFree(cur);
+
+   xmlNodeSetContentLen(node, first, offset);
+   nnode = xmlNewText(second);
+
+   nnode->type = XML_ELEMENT_NODE;
+   xmlAddNextSibling(node, nnode);
+   nnode->type = XML_TEXT_NODE;
+   
+   return_value = php_dom_create_object(nnode, &ret, NULL, return_value 
TSRMLS_CC);
 }
 /* }}} end dom_text_split_text */
 



-- 
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-06 Thread Jani Taskinen
sniper  Fri Jun  6 15:30:47 2003 EDT

  Modified files:  (Branch: PHP_4_3)
/php4   NEWS 
  Log:
  hrm..
  
Index: php4/NEWS
diff -u php4/NEWS:1.1247.2.245 php4/NEWS:1.1247.2.246
--- php4/NEWS:1.1247.2.245  Fri Jun  6 15:13:10 2003
+++ php4/NEWS   Fri Jun  6 15:30:46 2003
@@ -23,7 +23,7 @@
 - Fixed ext/yaz to not log if "yaz.log_file" php.ini option is not set.
   (Adam Dickmeiss)
 - Fixed ext/exif to honor "magic_quotes_runtime" php.ini option. (Marcus)
-- Fixed bug #24060 (del_panel function in ext/ncurses). (Georg)
+- Fixed bug #24060 (ncurses_del_panel() causes segfault). (Georg)
 - Fixed bug #24054 (Integer overflow failure with GCC/x86 for *=). (Sascha)
 - Fixed bug #23913 (make rename() work across partitions on *nix). (Ilia)
 - Fixed bug #23912 (Invalid CSS in phpinfo() output). (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) / NEWS

2003-06-06 Thread Georg Richter
georg   Fri Jun  6 15:13:11 2003 EDT

  Modified files:  (Branch: PHP_4_3)
/php4   NEWS 
  Log:
  fixed bug 24060
  
  
Index: php4/NEWS
diff -u php4/NEWS:1.1247.2.244 php4/NEWS:1.1247.2.245
--- php4/NEWS:1.1247.2.244  Fri Jun  6 08:21:26 2003
+++ php4/NEWS   Fri Jun  6 15:13:10 2003
@@ -23,6 +23,7 @@
 - Fixed ext/yaz to not log if "yaz.log_file" php.ini option is not set.
   (Adam Dickmeiss)
 - Fixed ext/exif to honor "magic_quotes_runtime" php.ini option. (Marcus)
+- Fixed bug #24060 (del_panel function in ext/ncurses). (Georg)
 - Fixed bug #24054 (Integer overflow failure with GCC/x86 for *=). (Sascha)
 - Fixed bug #23913 (make rename() work across partitions on *nix). (Ilia)
 - Fixed bug #23912 (Invalid CSS in phpinfo() output). (Ilia)



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



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

2003-06-06 Thread Rob Richards
rrichards   Fri Jun  6 15:04:32 2003 EDT

  Modified files:  
/php4/ext/dom   php_dom.c 
  Log:
  fix double free issue
  fix property access within invalid objects and failed reads
  
Index: php4/ext/dom/php_dom.c
diff -u php4/ext/dom/php_dom.c:1.3 php4/ext/dom/php_dom.c:1.4
--- php4/ext/dom/php_dom.c:1.3  Thu Jun  5 14:54:25 2003
+++ php4/ext/dom/php_dom.c  Fri Jun  6 15:04:32 2003
@@ -18,7 +18,7 @@
+--+
 */
 
-/* $Id: php_dom.c,v 1.3 2003/06/05 18:54:25 sterling Exp $ */
+/* $Id: php_dom.c,v 1.4 2003/06/06 19:04:32 rrichards Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -235,21 +235,26 @@
 
ret = FAILURE;
obj = (dom_object *)zend_objects_get_address(object TSRMLS_CC);
-   if (obj->prop_handler != NULL) {
-   ret = zend_hash_find(obj->prop_handler, Z_STRVAL_P(member), 
Z_STRLEN_P(member)+1, (void **) &hnd);
-   }
-   if (ret == SUCCESS) {
-   hnd->read_func(obj, &retval TSRMLS_CC);
-   if (retval) {
-   /* ensure we're creating a temporary variable */
-   retval->refcount = 1;
-   PZVAL_UNLOCK(retval);
+   if (obj->ptr != NULL) {
+   if (obj->prop_handler != NULL) {
+   ret = zend_hash_find(obj->prop_handler, Z_STRVAL_P(member), 
Z_STRLEN_P(member)+1, (void **) &hnd);
+   }
+   if (ret == SUCCESS) {
+   ret = hnd->read_func(obj, &retval TSRMLS_CC);
+   if (ret == SUCCESS) {
+   /* ensure we're creating a temporary variable */
+   retval->refcount = 1;
+   PZVAL_UNLOCK(retval);
+   } else {
+   retval = EG(uninitialized_zval_ptr);
+   }
} else {
-   retval = EG(uninitialized_zval_ptr);
+   std_hnd = zend_get_std_object_handlers();
+   retval = std_hnd->read_property(object, member TSRMLS_CC);
}
} else {
-   std_hnd = zend_get_std_object_handlers();
-   retval = std_hnd->read_property(object, member TSRMLS_CC);
+   retval = EG(uninitialized_zval_ptr);
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, "Underlying object 
missing");
}
if (member == &tmp_member) {
zval_dtor(member);
@@ -276,15 +281,18 @@
 
ret = FAILURE;
obj = (dom_object *)zend_objects_get_address(object TSRMLS_CC);
-
-   if (obj->prop_handler != NULL) {
-   ret = zend_hash_find((HashTable *)obj->prop_handler, 
Z_STRVAL_P(member), Z_STRLEN_P(member)+1, (void **) &hnd);
-   }
-   if (ret == SUCCESS) {
-   hnd->write_func(obj, value TSRMLS_CC);
+   if (obj->ptr != NULL) {
+   if (obj->prop_handler != NULL) {
+   ret = zend_hash_find((HashTable *)obj->prop_handler, 
Z_STRVAL_P(member), Z_STRLEN_P(member)+1, (void **) &hnd);
+   }
+   if (ret == SUCCESS) {
+   hnd->write_func(obj, value TSRMLS_CC);
+   } else {
+   std_hnd = zend_get_std_object_handlers();
+   std_hnd->write_property(object, member, value TSRMLS_CC);
+   }
} else {
-   std_hnd = zend_get_std_object_handlers();
-   std_hnd->write_property(object, member, value TSRMLS_CC);
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, "Underlying object 
missing");
}
if (member == &tmp_member) {
zval_dtor(member);
@@ -668,7 +676,7 @@
xmlNodePtr curnode;
 
if (node != NULL) {
-   curnode = node->last;
+   curnode = node;
while (curnode != NULL) {
node = curnode;
node_free_list(node->children TSRMLS_CC);
@@ -685,7 +693,7 @@
}

dom_unregister_node(node TSRMLS_CC);
-   curnode = node->prev;
+   curnode = node->next;
xmlUnlinkNode(node);
xmlFreeNode(node);
}
@@ -758,7 +766,7 @@
xmlFreeNode((xmlNode *) node);
}
} else {
-   dom_object_set_data(node, NULL TSRMLS_CC);
+   dom_unregister_node(node TSRMLS_CC);
}
}
 }



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



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

2003-06-06 Thread Georg Richter
georg   Fri Jun  6 15:02:31 2003 EDT

  Modified files:  
/php4/ext/ncurses   ncurses_functions.c 
  Log:
  fixed bug #24060
  
  
Index: php4/ext/ncurses/ncurses_functions.c
diff -u php4/ext/ncurses/ncurses_functions.c:1.38 
php4/ext/ncurses/ncurses_functions.c:1.39
--- php4/ext/ncurses/ncurses_functions.c:1.38   Mon Mar 17 08:04:08 2003
+++ php4/ext/ncurses/ncurses_functions.cFri Jun  6 15:02:30 2003
@@ -2235,15 +2235,13 @@
 PHP_FUNCTION(ncurses_del_panel)
 {
zval *handle;
-   PANEL **panel;
 
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &handle) == FAILURE) 
{
return;
}
+   zend_list_delete(Z_RESVAL_PP(handle));
 
-   FETCH_PANEL(panel, &handle);
-
-   RETURN_LONG(del_panel(*panel));
+   RETURN_TRUE;
 }
 /* }}} */
 



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



[PHP-CVS] cvs: php4 /tests/lang namespace_001.phpt

2003-06-06 Thread Jay Smith
jay Fri Jun  6 15:00:48 2003 EDT

  Removed files:   
/php4/tests/langnamespace_001.phpt 
  Log:
  Namespaces are gone, and so is this test.
  
  



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

2003-06-06 Thread Georg Richter
georg   Fri Jun  6 14:50:46 2003 EDT

  Modified files:  (Branch: PHP_4_3)
/php4/ext/ncurses   ncurses_functions.c 
  Log:
  fixed #24060
  
  
Index: php4/ext/ncurses/ncurses_functions.c
diff -u php4/ext/ncurses/ncurses_functions.c:1.26.2.7 
php4/ext/ncurses/ncurses_functions.c:1.26.2.8
--- php4/ext/ncurses/ncurses_functions.c:1.26.2.7   Tue Dec 31 11:35:01 2002
+++ php4/ext/ncurses/ncurses_functions.cFri Jun  6 14:50:46 2003
@@ -2278,14 +2278,13 @@
 PHP_FUNCTION(ncurses_del_panel)
 {
zval **handle;
-   PANEL **panel;
 
if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &handle) == FAILURE)
WRONG_PARAM_COUNT;
 
-   FETCH_PANEL(panel, handle);
+   zend_list_delete(Z_RESVAL_PP(handle));
 
-   RETURN_LONG(del_panel(*panel));
+   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/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  
 #include 
 #ifdef PHP_WIN32
-# include 
+# include 
 # define EWOULDBLOCK WSAEWOULDBLOCK
 # define ETIMEDOUT WSAETIMEDOUT
 # define bcopy memcpy
@@ -42,6 +42,7 @@
 # include 
 # include 
 # include 
+# include 
 #endif
 #include 
 #include 
@@ -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 last_error;
Index: php4/ext/sockets/sockets.c
diff -u php4/ext/sockets/sockets.c:1.

Re: [PHP-CVS] cvs: php4 /ext/dom element.c node.c php_dom.c

2003-06-06 Thread Moriyoshi Koizumi
Sterling Hughes <[EMAIL PROTECTED]> wrote:

> On Thu, 2003-06-05 at 15:16, Moriyoshi Koizumi wrote:
> > The following part seems to cause memleaks. Is this really a right 
> > fix?
> > 
> > > + if (!PZVAL_IS_REF(node)) {
> > > + zval_add_ref(&node);
> > > + }
> > > + 
> > 
> > /home/koizumi/src/php5/ext/dom/php_dom.c(814) :  Freeing 0x0831D19C (32 bytes),
> > script=/home/koizumi/src/php5/ext/dom/tests/dom001.php
> > /home/koizumi/src/php5/Zend/zend_hash.c(150) : Actual location (location was rel
> > ayed)
> > /home/koizumi/src/php5/ext/dom/php_dom.c(813) :  Freeing 0x0831D13C (44 bytes),
> > script=/home/koizumi/src/php5/ext/dom/tests/dom001.php
> > /home/koizumi/src/php5/ext/dom/php_dom.c(798) :  Freeing 0x08314B24 (24 bytes),
> > script=/home/koizumi/src/php5/ext/dom/tests/dom001.php
> > 
> 
> Yep.  But it doesn't crash. :)

:) What's the script like that Rob sent to you? Hopefully I can help..

Moriyoshi

> -sterling
> 
> > 
> > Moriyoshi
> -- 
> "People can have the Model T in any colour -- so long as it's black." 
> - Henry Ford
> 
> -- 
> PHP CVS Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


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



Re: [PHP-CVS] cvs: php4 /ext/dom element.c node.c php_dom.c

2003-06-06 Thread Sterling Hughes
On Thu, 2003-06-05 at 15:08, Sterling Hughes wrote:
> On Thu, 2003-06-05 at 15:16, Moriyoshi Koizumi wrote:
> > The following part seems to cause memleaks. Is this really a right 
> > fix?
> > 
> > > + if (!PZVAL_IS_REF(node)) {
> > > + zval_add_ref(&node);
> > > + }
> > > + 
> > 
> > /home/koizumi/src/php5/ext/dom/php_dom.c(814) :  Freeing 0x0831D19C (32 bytes),
> > script=/home/koizumi/src/php5/ext/dom/tests/dom001.php
> > /home/koizumi/src/php5/Zend/zend_hash.c(150) : Actual location (location was rel
> > ayed)
> > /home/koizumi/src/php5/ext/dom/php_dom.c(813) :  Freeing 0x0831D13C (44 bytes),
> > script=/home/koizumi/src/php5/ext/dom/tests/dom001.php
> > /home/koizumi/src/php5/ext/dom/php_dom.c(798) :  Freeing 0x08314B24 (24 bytes),
> > script=/home/koizumi/src/php5/ext/dom/tests/dom001.php
> > 
> 
> Yep.  But it doesn't crash. :)
> 

(just a note that this will probably be fixed differently, but for now,
its a fix).

-Sterling

> -sterling
> 
> > 
> > Moriyoshi
> -- 
> "People can have the Model T in any colour -- so long as it's black." 
> - Henry Ford
-- 
"People can have the Model T in any colour -- so long as it's black." 
- Henry Ford

-- 
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-06 Thread Sascha Schumann
sas Fri Jun  6 08:21:26 2003 EDT

  Modified files:  (Branch: PHP_4_3)
/php4   NEWS 
  Log:
  Refine error description
  
  
Index: php4/NEWS
diff -u php4/NEWS:1.1247.2.243 php4/NEWS:1.1247.2.244
--- php4/NEWS:1.1247.2.243  Fri Jun  6 08:18:30 2003
+++ php4/NEWS   Fri Jun  6 08:21:26 2003
@@ -23,7 +23,7 @@
 - Fixed ext/yaz to not log if "yaz.log_file" php.ini option is not set.
   (Adam Dickmeiss)
 - Fixed ext/exif to honor "magic_quotes_runtime" php.ini option. (Marcus)
-- Fixed bug #24054 (Assignment operator *= broken). (Sascha)
+- Fixed bug #24054 (Integer overflow failure with GCC/x86 for *=). (Sascha)
 - 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



Re: [PHP-CVS] cvs: php4 /ext/dom element.c node.c php_dom.c

2003-06-06 Thread Sterling Hughes
On Thu, 2003-06-05 at 15:16, Moriyoshi Koizumi wrote:
> The following part seems to cause memleaks. Is this really a right 
> fix?
> 
> > +   if (!PZVAL_IS_REF(node)) {
> > +   zval_add_ref(&node);
> > +   }
> > +   
> 
> /home/koizumi/src/php5/ext/dom/php_dom.c(814) :  Freeing 0x0831D19C (32 bytes),
> script=/home/koizumi/src/php5/ext/dom/tests/dom001.php
> /home/koizumi/src/php5/Zend/zend_hash.c(150) : Actual location (location was rel
> ayed)
> /home/koizumi/src/php5/ext/dom/php_dom.c(813) :  Freeing 0x0831D13C (44 bytes),
> script=/home/koizumi/src/php5/ext/dom/tests/dom001.php
> /home/koizumi/src/php5/ext/dom/php_dom.c(798) :  Freeing 0x08314B24 (24 bytes),
> script=/home/koizumi/src/php5/ext/dom/tests/dom001.php
> 

Yep.  But it doesn't crash. :)

-sterling

> 
> Moriyoshi
-- 
"People can have the Model T in any colour -- so long as it's black." 
- Henry Ford

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



Re: [PHP-CVS] cvs: php4 /ext/dom element.c node.c php_dom.c

2003-06-06 Thread Moriyoshi Koizumi
The following part seems to cause memleaks. Is this really a right 
fix?

> + if (!PZVAL_IS_REF(node)) {
> + zval_add_ref(&node);
> + }
> + 

/home/koizumi/src/php5/ext/dom/php_dom.c(814) :  Freeing 0x0831D19C (32 bytes),
script=/home/koizumi/src/php5/ext/dom/tests/dom001.php
/home/koizumi/src/php5/Zend/zend_hash.c(150) : Actual location (location was rel
ayed)
/home/koizumi/src/php5/ext/dom/php_dom.c(813) :  Freeing 0x0831D13C (44 bytes),
script=/home/koizumi/src/php5/ext/dom/tests/dom001.php
/home/koizumi/src/php5/ext/dom/php_dom.c(798) :  Freeing 0x08314B24 (24 bytes),
script=/home/koizumi/src/php5/ext/dom/tests/dom001.php


Moriyoshi


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



[PHP-CVS] cvs: php4 /ext/dom CREDITS

2003-06-06 Thread Sterling Hughes
sterlingThu Jun  5 15:12:08 2003 EDT

  Added files: 
/php4/ext/dom   CREDITS 
  Log:
  add CREDITS file
  
  



-- 
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-06 Thread Jani Taskinen
sniper  Fri Jun  6 08:18:31 2003 EDT

  Modified files:  (Branch: PHP_4_3)
/php4   NEWS 
  Log:
  BFN
  
Index: php4/NEWS
diff -u php4/NEWS:1.1247.2.242 php4/NEWS:1.1247.2.243
--- php4/NEWS:1.1247.2.242  Thu Jun  5 01:07:15 2003
+++ php4/NEWS   Fri Jun  6 08:18:30 2003
@@ -23,6 +23,7 @@
 - Fixed ext/yaz to not log if "yaz.log_file" php.ini option is not set.
   (Adam Dickmeiss)
 - Fixed ext/exif to honor "magic_quotes_runtime" php.ini option. (Marcus)
+- Fixed bug #24054 (Assignment operator *= broken). (Sascha)
 - 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/domxml php_domxml.c

2003-06-06 Thread Moriyoshi Koizumi
moriyoshi   Thu Jun  5 14:59:55 2003 EDT

  Modified files:  
/php4/ext/domxmlphp_domxml.c 
  Log:
  Avoid unnecessary zval separation
  
  
Index: php4/ext/domxml/php_domxml.c
diff -u php4/ext/domxml/php_domxml.c:1.255 php4/ext/domxml/php_domxml.c:1.256
--- php4/ext/domxml/php_domxml.c:1.255  Mon Jun  2 14:57:59 2003
+++ php4/ext/domxml/php_domxml.cThu Jun  5 14:59:55 2003
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: php_domxml.c,v 1.255 2003/06/02 18:57:59 rrichards Exp $ */
+/* $Id: php_domxml.c,v 1.256 2003/06/05 18:59:55 moriyoshi Exp $ */
 
 /* TODO
  * - Support Notation Nodes
@@ -1090,8 +1090,10 @@
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid argument 
or parameter array");
return NULL;
} else {
-   SEPARATE_ZVAL(value);
-   convert_to_string_ex(value);
+   if (Z_TYPE_PP(value) != IS_STRING) {
+   SEPARATE_ZVAL(value);
+   convert_to_string(*value);
+   }
expr = Z_STRVAL_PP(value);

if (expr) {
@@ -5481,8 +5483,10 @@
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid argument 
or parameter array");
return NULL;
} else {
-   SEPARATE_ZVAL(value);
-   convert_to_string_ex(value);
+   if (Z_TYPE_PP(value) != IS_STRING) {
+   SEPARATE_ZVAL(value);
+   convert_to_string(*value);
+   }
 
if (!xpath_params) {
xpath_expr = 
php_domxslt_string_to_xpathexpr(Z_STRVAL_PP(value) TSRMLS_CC);



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



[PHP-CVS] cvs: php4 /ext/dom element.c node.c php_dom.c

2003-06-06 Thread Sterling Hughes
sterlingThu Jun  5 14:54:26 2003 EDT

  Modified files:  
/php4/ext/dom   element.c node.c php_dom.c 
  Log:
  fix a bunch of memory overruns, and uninitialized variable uses
  fixes crash on sample script rob sent me
  
  
Index: php4/ext/dom/element.c
diff -u php4/ext/dom/element.c:1.1 php4/ext/dom/element.c:1.2
--- php4/ext/dom/element.c:1.1  Thu Jun  5 13:06:52 2003
+++ php4/ext/dom/element.c  Thu Jun  5 14:54:25 2003
@@ -17,7 +17,7 @@
+--+
 */
 
-/* $Id: element.c,v 1.1 2003/06/05 17:06:52 rrichards Exp $ */
+/* $Id: element.c,v 1.2 2003/06/05 18:54:25 sterling Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -65,7 +65,7 @@
xmlNodePtr nodep = NULL, oldnode = NULL;
dom_object *intern;
char *name, *value = NULL;
-   int name_len, value_len;
+   int name_len, value_len = 0;
 
id = getThis();

Index: php4/ext/dom/node.c
diff -u php4/ext/dom/node.c:1.1 php4/ext/dom/node.c:1.2
--- php4/ext/dom/node.c:1.1 Thu Jun  5 13:06:52 2003
+++ php4/ext/dom/node.c Thu Jun  5 14:54:25 2003
@@ -17,7 +17,7 @@
+--+
 */
 
-/* $Id: node.c,v 1.1 2003/06/05 17:06:52 rrichards Exp $ */
+/* $Id: node.c,v 1.2 2003/06/05 18:54:25 sterling Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -982,6 +982,10 @@
return;
}
 
+   if (!PZVAL_IS_REF(node)) {
+   zval_add_ref(&node);
+   }
+   
DOM_GET_OBJ(child, node, xmlNodePtr);
 
if (dom_hierarchy(nodep, child) == FAILURE) {
Index: php4/ext/dom/php_dom.c
diff -u php4/ext/dom/php_dom.c:1.2 php4/ext/dom/php_dom.c:1.3
--- php4/ext/dom/php_dom.c:1.2  Thu Jun  5 13:48:25 2003
+++ php4/ext/dom/php_dom.c  Thu Jun  5 14:54:25 2003
@@ -18,7 +18,7 @@
+--+
 */
 
-/* $Id: php_dom.c,v 1.2 2003/06/05 17:48:25 sterling Exp $ */
+/* $Id: php_dom.c,v 1.3 2003/06/05 18:54:25 sterling Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -698,9 +698,11 @@
 {
xmlDtdPtr extSubset, intSubset;
xmlDocPtr docp;
+
if (!node) {
return;
}
+
switch (node->type) {
case XML_DOCUMENT_NODE:
case XML_HTML_DOCUMENT_NODE:



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



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

2003-06-06 Thread Moriyoshi Koizumi
moriyoshi   Thu Jun  5 14:54:19 2003 EDT

  Modified files:  
/php4/ext/xsl   xsltprocessor.c 
  Log:
  Avoid unnecesary zval separation 
  
  
Index: php4/ext/xsl/xsltprocessor.c
diff -u php4/ext/xsl/xsltprocessor.c:1.1 php4/ext/xsl/xsltprocessor.c:1.2
--- php4/ext/xsl/xsltprocessor.c:1.1Thu Jun  5 13:10:13 2003
+++ php4/ext/xsl/xsltprocessor.cThu Jun  5 14:54:19 2003
@@ -17,7 +17,7 @@
+--+
 */
 
-/* $Id: xsltprocessor.c,v 1.1 2003/06/05 17:10:13 rrichards Exp $ */
+/* $Id: xsltprocessor.c,v 1.2 2003/06/05 18:54:19 moriyoshi Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -95,8 +95,10 @@
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid argument 
or parameter array");
return NULL;
} else {
-   SEPARATE_ZVAL(value);
-   convert_to_string_ex(value);
+   if (Z_TYPE_PP(value) != IS_STRING) {
+   SEPARATE_ZVAL(value);
+   convert_to_string(*value);
+   }
 
if (!xpath_params) {
xpath_expr = 
php_xsl_xslt_string_to_xpathexpr(Z_STRVAL_PP(value) TSRMLS_CC);



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



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

2003-06-06 Thread Sterling Hughes
sterlingThu Jun  5 14:30:19 2003 EDT

  Modified files:  
/php4/ext/dom   document.c 
  Log:
  version length too
  
  
Index: php4/ext/dom/document.c
diff -u php4/ext/dom/document.c:1.2 php4/ext/dom/document.c:1.3
--- php4/ext/dom/document.c:1.2 Thu Jun  5 14:29:55 2003
+++ php4/ext/dom/document.c Thu Jun  5 14:30:19 2003
@@ -17,7 +17,7 @@
+--+
 */
 
-/* $Id: document.c,v 1.2 2003/06/05 18:29:55 sterling Exp $ */
+/* $Id: document.c,v 1.3 2003/06/05 18:30:19 sterling Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -941,7 +941,7 @@
xmlDoc *docp = NULL, *olddoc;
dom_object *intern;
char *encoding, *version = NULL;
-   int encoding_len = 0, version_len;
+   int encoding_len = 0, version_len = 0;
 
id = getThis();




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



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

2003-06-06 Thread Sterling Hughes
sterlingThu Jun  5 14:29:55 2003 EDT

  Modified files:  
/php4/ext/dom   document.c 
  Log:
  initialize the encoding length
  
  
Index: php4/ext/dom/document.c
diff -u php4/ext/dom/document.c:1.1 php4/ext/dom/document.c:1.2
--- php4/ext/dom/document.c:1.1 Thu Jun  5 13:06:52 2003
+++ php4/ext/dom/document.c Thu Jun  5 14:29:55 2003
@@ -17,7 +17,7 @@
+--+
 */
 
-/* $Id: document.c,v 1.1 2003/06/05 17:06:52 rrichards Exp $ */
+/* $Id: document.c,v 1.2 2003/06/05 18:29:55 sterling Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -941,7 +941,7 @@
xmlDoc *docp = NULL, *olddoc;
dom_object *intern;
char *encoding, *version = NULL;
-   int encoding_len, version_len;
+   int encoding_len = 0, version_len;
 
id = getThis();




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



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

2003-06-06 Thread Moriyoshi Koizumi
moriyoshi   Thu Jun  5 14:04:30 2003 EDT

  Modified files:  
/php4/ext/xsl   php_xsl.c 
  Log:
  WS fix
  
  
Index: php4/ext/xsl/php_xsl.c
diff -u php4/ext/xsl/php_xsl.c:1.1 php4/ext/xsl/php_xsl.c:1.2
--- php4/ext/xsl/php_xsl.c:1.1  Thu Jun  5 13:10:13 2003
+++ php4/ext/xsl/php_xsl.c  Thu Jun  5 14:04:30 2003
@@ -16,7 +16,7 @@
   +--+
 */
 
-/* $Id: php_xsl.c,v 1.1 2003/06/05 17:10:13 rrichards Exp $ */
+/* $Id: php_xsl.c,v 1.2 2003/06/05 18:04:30 moriyoshi Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -274,7 +274,7 @@
 {
php_info_print_table_start();
php_info_print_table_row(2, "XML/XSLT", "enabled");
-   {
+   {
char buffer[128];
int major, minor, subminor;
 
@@ -289,7 +289,7 @@
subminor = (xsltLibxmlVersion - major * 1 - minor * 100);
snprintf(buffer, 128, "%d.%d.%d", major, minor, subminor);
php_info_print_table_row(2, "libxslt compiled against libxml Version", 
buffer);
- }
+   }
php_info_print_table_end();
 
/* Remove comments if you have entries in php.ini



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



[PHP-CVS] cvs: php4(PHP_4_3) /tests/lang bug24054.phpt

2003-06-06 Thread Jani Taskinen
sniper  Fri Jun  6 07:10:14 2003 EDT

  Added files: (Branch: PHP_4_3)
/php4/tests/langbug24054.phpt 
  Log:
  MFH
  

Index: php4/tests/lang/bug24054.phpt
+++ php4/tests/lang/bug24054.phpt
--TEST--
Bug #24054 (Assignment operator *= broken)
--FILE--

--EXPECT--
float(1.001E+10)
float(1.001E+10)



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



[PHP-CVS] cvs: php4 /tests/lang bug24054.phpt

2003-06-06 Thread Jani Taskinen
sniper  Fri Jun  6 07:09:55 2003 EDT

  Added files: 
/php4/tests/langbug24054.phpt 
  Log:
  Test for bug #24054
  

Index: php4/tests/lang/bug24054.phpt
+++ php4/tests/lang/bug24054.phpt
--TEST--
Bug #24054 (Assignment operator *= broken)
--FILE--

--EXPECT--
float(1.001E+10)
float(1.001E+10)



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



[PHP-CVS] cvs: php4 /ext/dom/examples dom1.inc dom1.php

2003-06-06 Thread Sterling Hughes
sterlingThu Jun  5 13:51:36 2003 EDT

  Added files: 
/php4/ext/dom/examples  dom1.inc dom1.php 
  Log:
  add tests/ files as examples that you can run and play around with
  
  

Index: php4/ext/dom/examples/dom1.inc
+++ php4/ext/dom/examples/dom1.inc


]>

Title

&sp;




a1b1c1
a2c2
a3b3c3




 ";

function print_node($node)
{
  print "Node Name: " . $node->nodeName;
  print "\nNode Type: " . $node->nodeType;
  $child_count = count($node->childNodes);
  print "\nNum Children: " . $child_count;
  if($child_count <= 1){
print "\nNode Content: " . $node->nodeValue;
  }
  print "\n\n";
}

function print_node_list($nodelist)
{
  foreach($nodelist as $node)
  {
print_node($node);
  }
}

?>

Index: php4/ext/dom/examples/dom1.php
+++ php4/ext/dom/examples/dom1.php
loadxml($xmlstr);
if(!$dom) {
  echo "Error while parsing the document\n";
  exit;
}

// children() of of document would result in a memleak
//$children = $dom->children();
//print_node_list($children);

echo "- root\n";
$rootnode = $dom->documentElement;
print_node($rootnode);

echo "- children of root\n";
$children = $rootnode->childNodes;
print_node_list($children);

// The last node should be identical with the last entry in the children array
echo "- last\n";
$last = $rootnode->lastChild;
print_node($last);

// The parent of this last node is the root again
echo "- parent\n";
$parent = $last->parentNode;
print_node($parent);

// The children of this parent are the same children as one above
echo "- children of parent\n";
$children = $parent->childNodes;
print_node_list($children);

echo "- creating a new attribute\n";
//This is worthless
//$attr = $dom->createAttribute("src", "picture.gif");
//print_r($attr);

//$rootnode->set_attributeNode($attr); 
$attr = $rootnode->setAttribute("src", "picture.gif");
$attr = $rootnode->getAttribute("src");
print_r($attr);
print "\n";

echo "- Get Attribute Node\n";
$attr = $rootnode->getAttributeNode("src");
print_node($attr);

echo "- Remove Attribute Node\n";
$attr = $rootnode->removeAttribute("src");
print "Removed " . $attr . " attributes.\n";

echo "- attributes of rootnode\n";
$attrs = $rootnode->attributes;
print_node_list($attrs);

echo "- children of an attribute\n";
$children = current($attrs)->childNodes;
print_node_list($children);

echo "- Add child to root\n";
$myelement = new domElement("Silly", "Symphony");
$newchild = $rootnode->appendChild($myelement);
print_node($newchild);
print $dom->saveXML();
print "\n";

echo "- Find element by tagname\n";
echo "Using dom\n";
$children = $dom->getElementsByTagname("Silly");
print_node_list($children);

echo "Using elem\n";
$children = $rootnode->getElementsByTagName("Silly");
print_node_list($children);

echo "- Unlink Node\n";
print_node($children[0]);
$rootnode->removeChild($children[0]);
print_node_list($rootnode->childNodes);
print $dom->savexml();

echo "- Find element by id\n";
print ("Not implemented\n");

echo "- Check various node_name return values\n";
print ("Not needed\n");

?>



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



[PHP-CVS] cvs: php4 /ext/xsl .cvsignore

2003-06-06 Thread Sterling Hughes
sterlingThu Jun  5 13:49:46 2003 EDT

  Added files: 
/php4/ext/xsl   .cvsignore 
  Log:
  add .cvsignore file
  
  

Index: php4/ext/xsl/.cvsignore
+++ php4/ext/xsl/.cvsignore
deps
*.plg
*.opt
*.ncb
Release
Release_inline
Debug
Release_TS
Release_TSDbg
Release_TS_inline
Debug_TS



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



[PHP-CVS] cvs: php4 /ext/dom .cvsignore

2003-06-06 Thread Sterling Hughes
sterlingThu Jun  5 13:49:23 2003 EDT

  Added files: 
/php4/ext/dom   .cvsignore 
  Log:
  add .cvsignore file
  
  

Index: php4/ext/dom/.cvsignore
+++ php4/ext/dom/.cvsignore
*.lo
*.la
deps
*.plg
*.opt
*.ncb
Release
Release_inline
Debug
Release_TS
Release_TSDbg
Release_TS_inline
Debug_TS



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



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

2003-06-06 Thread Sterling Hughes
sterlingThu Jun  5 13:48:51 2003 EDT

  Modified files:  
/php4/ext/xml   xml.c 
  Log:
  prevent double destroy and double init badness
  
  
Index: php4/ext/xml/xml.c
diff -u php4/ext/xml/xml.c:1.128 php4/ext/xml/xml.c:1.129
--- php4/ext/xml/xml.c:1.128Mon May 26 20:50:00 2003
+++ php4/ext/xml/xml.c  Thu Jun  5 13:48:51 2003
@@ -18,7 +18,7 @@
+--+
  */
 
-/* $Id: xml.c,v 1.128 2003/05/27 00:50:00 iliaa Exp $ */
+/* $Id: xml.c,v 1.129 2003/06/05 17:48:51 sterling Exp $ */
 
 #define IS_EXT_MODULE
 
@@ -35,6 +35,8 @@
 
 #if HAVE_XML
 
+int xml_parser_inited = 0;
+
 #include "php_xml.h"
 # include "ext/standard/head.h"
 
@@ -250,7 +252,10 @@
 PHP_RSHUTDOWN_FUNCTION(xml)
 {
 #ifdef LIBXML_EXPAT_COMPAT
-   xmlCleanupParser();
+   if (xml_parser_inited) {
+   xmlCleanupParser();
+   xml_parser_inited = 0;
+   }
 #endif 
return SUCCESS;
 }



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



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

2003-06-06 Thread Sterling Hughes
sterlingThu Jun  5 13:48:26 2003 EDT

  Modified files:  
/php4/ext/dom   php_dom.c 
  Log:
  fig segv on make install (double destroy badness)
  
  
Index: php4/ext/dom/php_dom.c
diff -u php4/ext/dom/php_dom.c:1.1 php4/ext/dom/php_dom.c:1.2
--- php4/ext/dom/php_dom.c:1.1  Thu Jun  5 13:06:52 2003
+++ php4/ext/dom/php_dom.c  Thu Jun  5 13:48:25 2003
@@ -18,7 +18,7 @@
+--+
 */
 
-/* $Id: php_dom.c,v 1.1 2003/06/05 17:06:52 rrichards Exp $ */
+/* $Id: php_dom.c,v 1.2 2003/06/05 17:48:25 sterling Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -37,6 +37,8 @@
 #define PHP_XPATH 1
 #define PHP_XPTR 2
 
+extern int xml_parser_inited;
+
 zend_object_handlers dom_object_handlers;
 
 static HashTable classes;
@@ -542,8 +544,10 @@
REGISTER_LONG_CONSTANT("XML_ATTRIBUTE_ENUMERATION", 
XML_ATTRIBUTE_ENUMERATION,  CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("XML_ATTRIBUTE_NOTATION",
XML_ATTRIBUTE_NOTATION, CONST_CS | CONST_PERSISTENT);
 
-
-   xmlInitParser();
+   if (!xml_parser_inited) {
+   xmlInitThreads();
+   xml_parser_inited = 1;
+   }
 
return SUCCESS;
 }
@@ -571,7 +575,10 @@
 
 PHP_MSHUTDOWN_FUNCTION(dom)
 {
-   xmlCleanupParser();
+   if (xml_parser_inited) {
+   xmlCleanupParser();
+   xml_parser_inited = 0;
+   }
 
zend_hash_destroy(&dom_domstringlist_prop_handlers);
zend_hash_destroy(&dom_namelist_prop_handlers);



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



[PHP-CVS] cvs: php4 /ext/xsl config.m4 php_xsl.c php_xsl.h xsl.dsp xsl_fe.h xsltprocessor.c

2003-06-06 Thread Rob Richards
rrichards   Thu Jun  5 13:10:13 2003 EDT

  Added files: 
/php4/ext/xsl   config.m4 php_xsl.c php_xsl.h xsl.dsp xsl_fe.h 
xsltprocessor.c 
  Log:
  Inital cut of new xsl extension
  interoperates with new dom extension
  PHP5 only
  
Index: php4/ext/xsl/config.m4
+++ php4/ext/xsl/config.m4
dnl
dnl $Id: config.m4,v 1.1 2003/06/05 17:10:13 rrichards Exp $
dnl
AC_DEFUN(PHP_XSL_CHECK_VERSION,[
  old_CPPFLAGS=$CPPFLAGS
  CPPFLAGS=-I$XSL_DIR/include
  AC_MSG_CHECKING(for libxslt version)
  AC_EGREP_CPP(yes,[
#include 
#if LIBXSLT_VERSION >= 10018
  yes
#endif
  ],[
AC_MSG_RESULT(>= 1.0.18)
  ],[
AC_MSG_ERROR(libxslt version 1.0.18 or greater required.)
  ])
  CPPFLAGS=$old_CPPFLAGS
])

PHP_ARG_WITH(xsl, for XSL support,
[  --with-xsl[=DIR]Include new DOM support (requires libxml >= 2.4.14).
  DIR is the libxml install directory.])



if test "$PHP_XSL" != "no"; then

  if test -r $PHP_XSL/include/libxslt/transform.h; then
XSL_DIR=$PHP_XSL
  else
for i in /usr/local /usr; do
  test -r $i/include/libxslt/transform.h && XSL_DIR=$i
done
  fi

  if test -z "$XSL_DIR"; then
AC_MSG_RESULT(not found)
AC_MSG_ERROR(Please reinstall the libxslt >= 1.0.3 distribution)
  fi

  PHP_XSL_CHECK_VERSION

  XSLT_CONFIG=$XSL_DIR/bin/xslt-config
 
  if test -x $XSLT_CONFIG; then
DOM_LIBS=`$XSLT_CONFIG --libs`
DOM_INCLUDES=`$XSLT_CONFIG --cflags`
AC_MSG_RESULT(found xslt-config in $XSLT_CONFIG)
PHP_EVAL_LIBLINE($DOM_LIBS, XSL_SHARED_LIBADD)
CFLAGS="$CFLAGS $DOM_INCLUDES"
  else 
PHP_ADD_LIBRARY_WITH_PATH($DOM_LIBNAME, $XSL_DIR/lib, XSL_SHARED_LIBADD)
PHP_ADD_INCLUDE($XSL_DIR/include)
  fi

  
  AC_DEFINE(HAVE_XSL,1,[ ])
  PHP_NEW_EXTENSION(xsl, php_xsl.c xsltprocessor.c, $ext_shared)
  PHP_SUBST(XSL_SHARED_LIBADD)
fi







Index: php4/ext/xsl/php_xsl.c
+++ php4/ext/xsl/php_xsl.c
/*
  +--+
  | PHP Version 4|
  +--+
  | Copyright (c) 1997-2003 The PHP Group|
  +--+
  | This source file is subject to version 2.02 of the PHP license,  |
  | that is bundled with this package in the file LICENSE, and is|
  | available at through the world-wide-web at   |
  | http://www.php.net/license/2_02.txt. |
  | If you did not receive a copy of the PHP license and are unable to   |
  | obtain it through the world-wide-web, please send a note to  |
  | [EMAIL PROTECTED] so we can mail you a copy immediately.   |
  +--+
  | Author: Christian Stocker <[EMAIL PROTECTED]>   |
  +--+
*/

/* $Id: php_xsl.c,v 1.1 2003/06/05 17:10:13 rrichards Exp $ */

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

#include "php.h"
#include "php_ini.h"
#include "zend_execute_locks.h"
#include "ext/standard/info.h"
#include "php_xsl.h"

/* If you declare any globals in php_xsl.h uncomment this:
ZEND_DECLARE_MODULE_GLOBALS(xsl)
*/

/* True global resources - no need for thread safety here */

static HashTable classes;
/* not used right now  
static zend_object_handlers xsl_object_handlers;
static HashTable xsl_xsltprocessor_prop_handlers;
*/

/* {{{ xsl_functions[]
 *
 * Every user visible function must have an entry in xsl_functions[].
 */
function_entry xsl_functions[] = {
{NULL, NULL, NULL}  /* Must be the last line in xsl_functions[] */
};
/* }}} */

/* {{{ xsl_module_entry
 */
zend_module_entry xsl_module_entry = {
#if ZEND_MODULE_API_NO >= 20010901
STANDARD_MODULE_HEADER,
#endif
"xsl",
xsl_functions,
PHP_MINIT(xsl),
PHP_MSHUTDOWN(xsl),
PHP_RINIT(xsl), /* Replace with NULL if there's nothing to do at 
request start */
PHP_RSHUTDOWN(xsl), /* Replace with NULL if there's nothing to do at 
request end */
PHP_MINFO(xsl),
#if ZEND_MODULE_API_NO >= 20010901
"0.1", /* Replace with version number for your extension */
#endif
STANDARD_MODULE_PROPERTIES
};
/* }}} */

#ifdef COMPILE_DL_XSL
ZEND_GET_MODULE(xsl)
#endif


/
* copied from php_dom  should be in a common file...
**/


typedef int (*dom_read_t)(xsl_object *obj, zval **retval TSRMLS_DC);
typedef int (*dom_write_t)(xsl_object *obj, zval *newval TSRMLS_DC);

typedef struct _dom_prop_handler {
dom_read_t read_func;
dom_write_t write_func;
} dom_prop_handler;

/* end copied from php_dom.c */

/* {{{ xsl_objects_dtor */
void xsl_objects_dtor(void *object, zend_object_handle handle TSRMLS_DC)
{
/

[PHP-CVS] cvs: CVSROOT / avail

2003-06-06 Thread Sterling Hughes
sterlingThu Jun  5 12:42:06 2003 EDT

  Modified files:  
/CVSROOTavail 
  Log:
  rob richards is doing the new dom and xsl stuff.  give him full php 
  developer access
  
  # and quite a few beers if we meet in person :)
  
  
Index: CVSROOT/avail
diff -u CVSROOT/avail:1.684 CVSROOT/avail:1.685
--- CVSROOT/avail:1.684 Tue Jun  3 12:01:40 2003
+++ CVSROOT/avail   Thu Jun  5 12:42:06 2003
@@ -17,7 +17,7 @@
 # The PHP Developers have full access to the full source trees for
 # PHP and PEAR, as well as the documentation.
 
-avail|tal,mfischer,fmk,hirokawa,jah,eschmid,dbeu,sebastian,samjam,avsm,ronabob,derick,sterling,venaas,stas,hholzgra,cmv,phildriscoll,jmoore,andre,sniper,sr,david,jdonagher,chagenbu,jon,elixer,joosters,jason,mysql,kalowsky,opaquedave,steinm,phanto,gluke,svanegmond,rjs,vlad,jimjag,emile,wez,sasha,camber,ohrn,romolo,martin,lurcher,wsanchez,dreid,bmcadams,swm,zhang,kevin,joey,entity,cardinal,coar,jflemer,raphael,danda,rbb,mboeren,dougm,mlwmohawk,edink,alexwaugh,bernd,zak,sesser,yohgaki,imajes,markonen,dickmeiss,helly,sander,jan,kir,aaron,jwoolley,pbannister,rvenkat,dali,rodif_bl,hyanantha,witten,georg,msopacua,mpdoremus,fujimoto,iliaa,chregu,azzit,gschlossnagle,andrey,dan,moriyoshi,dviner,bfrance,flex,iwakiri,john,harrie,pollita,ianh,k.schroeder,dcowgill,jerenkrantz,jay,ddhill,jorton|phpfi,php3,php4,phpdoc,pear,peardoc,spl,ZendAPI,phpdoc-ar,phpdoc-cs,phpdoc-de,phpdoc-es,phpdoc-fi,phpdoc-fr,phpdoc-he,phpdoc-hk,phpdoc-hu,phpdoc-it,phpdoc-ja,phpdoc-kr,phpdoc-lt,phpdoc-nl,phpdoc-pl,phpdoc-pt_BR,phpdoc-ro,phpdoc-ru,phpdoc-sk,phpdoc-sl,phpdoc-sv,phpdoc-tr,phpdoc-tw,phpdoc-zh,phpdoc-el
+avail|rrichards,tal,mfischer,fmk,hirokawa,jah,eschmid,dbeu,sebastian,samjam,avsm,ronabob,derick,sterling,venaas,stas,hholzgra,cmv,phildriscoll,jmoore,andre,sniper,sr,david,jdonagher,chagenbu,jon,elixer,joosters,jason,mysql,kalowsky,opaquedave,steinm,phanto,gluke,svanegmond,rjs,vlad,jimjag,emile,wez,sasha,camber,ohrn,romolo,martin,lurcher,wsanchez,dreid,bmcadams,swm,zhang,kevin,joey,entity,cardinal,coar,jflemer,raphael,danda,rbb,mboeren,dougm,mlwmohawk,edink,alexwaugh,bernd,zak,sesser,yohgaki,imajes,markonen,dickmeiss,helly,sander,jan,kir,aaron,jwoolley,pbannister,rvenkat,dali,rodif_bl,hyanantha,witten,georg,msopacua,mpdoremus,fujimoto,iliaa,chregu,azzit,gschlossnagle,andrey,dan,moriyoshi,dviner,bfrance,flex,iwakiri,john,harrie,pollita,ianh,k.schroeder,dcowgill,jerenkrantz,jay,ddhill,jorton|phpfi,php3,php4,phpdoc,pear,peardoc,spl,ZendAPI,phpdoc-ar,phpdoc-cs,phpdoc-de,phpdoc-es,phpdoc-fi,phpdoc-fr,phpdoc-he,phpdoc-hk,phpdoc-hu,phpdoc-it,phpdoc-ja,phpdoc-kr,phpdoc-lt,phpdoc-nl,phpdoc-pl,phpdoc-pt_BR,phpdoc-ro,phpdoc-ru,phpdoc-sk,phpdoc-sl,phpdoc-sv,phpdoc-tr,phpdoc-tw,phpdoc-zh,phpdoc-el
 
 
 # People who work on the Engine
@@ -102,7 +102,7 @@
 avail|sterling|php4/ext/curl
 avail|evan|php4/ext/cybercash
 avail|spages|php4/ext/cybermut
-avail|steinm,jarkol,zenderx,chregu,jtate,rrichards,thoralf|php4/ext/domxml
+avail|steinm,jarkol,zenderx,chregu,jtate,thoralf|php4/ext/domxml
 avail|steinm|php4/ext/fdf
 avail|alan_k|php4/ext/dio
 avail|chad,sesser|php4/ext/filepro



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



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

2003-06-06 Thread Georg Richter
georg   Fri Jun  6 04:57:51 2003 EDT

  Modified files:  
/php4/ext/mysqlimysqli_nonapi.c 
  Log:
  fixed return value
  
  
Index: php4/ext/mysqli/mysqli_nonapi.c
diff -u php4/ext/mysqli/mysqli_nonapi.c:1.9 php4/ext/mysqli/mysqli_nonapi.c:1.10
--- php4/ext/mysqli/mysqli_nonapi.c:1.9 Sat Mar 15 17:51:49 2003
+++ php4/ext/mysqli/mysqli_nonapi.c Fri Jun  6 04:57:51 2003
@@ -15,7 +15,7 @@
   | Author: Georg Richter <[EMAIL PROTECTED]>|
   +--+
 
-  $Id: mysqli_nonapi.c,v 1.9 2003/03/15 22:51:49 hholzgra Exp $ 
+  $Id: mysqli_nonapi.c,v 1.10 2003/06/06 08:57:51 georg Exp $ 
 */
 
 #ifdef HAVE_CONFIG_H
@@ -169,7 +169,7 @@
}
 
if (!mysql_field_count(mysql)) {
-   RETURN_FALSE;
+   RETURN_TRUE;
}
 
/* profiler result information */



-- 
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-06 Thread Jani Taskinen
sniper  Fri Jun  6 04:11:38 2003 EDT

  Modified files:  (Branch: PHP_4_3)
/php4/ext/standard  file.c 
  Log:
  ws
  
Index: php4/ext/standard/file.c
diff -u php4/ext/standard/file.c:1.279.2.24 php4/ext/standard/file.c:1.279.2.25
--- php4/ext/standard/file.c:1.279.2.24 Fri May 30 20:33:06 2003
+++ php4/ext/standard/file.cFri Jun  6 04:11:38 2003
@@ -21,7 +21,7 @@
+--+
  */
 
-/* $Id: file.c,v 1.279.2.24 2003/05/31 00:33:06 iliaa Exp $ */
+/* $Id: file.c,v 1.279.2.25 2003/06/06 08:11:38 sniper Exp $ */
 
 /* Synced with php 3.0 revision 1.218 1999-06-16 [ssb] */
 
@@ -219,13 +219,13 @@
 
 PHP_FUNCTION(flock)
 {
-zval **arg1, **arg2, **arg3;
-int fd, act, ret, arg_count = ZEND_NUM_ARGS();
+   zval **arg1, **arg2, **arg3;
+   int fd, act, ret, arg_count = ZEND_NUM_ARGS();
php_stream *stream;
 
-if (arg_count < 2 || arg_count > 3 || zend_get_parameters_ex(arg_count, &arg1, 
&arg2, &arg3) == FAILURE) {
-WRONG_PARAM_COUNT;
-}
+   if (arg_count < 2 || arg_count > 3 || zend_get_parameters_ex(arg_count, &arg1, 
&arg2, &arg3) == FAILURE) {
+   WRONG_PARAM_COUNT;
+   }
 
php_stream_from_zval(stream, arg1);
 
@@ -235,22 +235,22 @@
 
convert_to_long_ex(arg2);
 
-act = Z_LVAL_PP(arg2) & 3;
-if (act < 1 || act > 3) {
+   act = Z_LVAL_PP(arg2) & 3;
+   if (act < 1 || act > 3) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Illegal operation 
argument");
RETURN_FALSE;
-}
+   }
 
-/* flock_values contains all possible actions
-   if (arg2 & 4) we won't block on the lock */
-act = flock_values[act - 1] | (Z_LVAL_PP(arg2) & 4 ? LOCK_NB : 0);
-if ((ret=flock(fd, act)) == -1) {
-RETURN_FALSE;
-}
+   /* flock_values contains all possible actions
+  if (arg2 & 4) we won't block on the lock */
+   act = flock_values[act - 1] | (Z_LVAL_PP(arg2) & 4 ? LOCK_NB : 0);
+   if ((ret=flock(fd, act)) == -1) {
+   RETURN_FALSE;
+   }
if(ret == -1 && errno == EWOULDBLOCK && arg_count == 3) {
ZVAL_LONG(*arg3, 1);
}
-RETURN_TRUE;
+   RETURN_TRUE;
 }
 
 /* }}} */
@@ -584,7 +584,7 @@
 /* }}} */
 
 /* {{{ proto resource stream_get_meta_data(resource fp)
-Retrieves header/meta data from streams/file pointers */
+   Retrieves header/meta data from streams/file pointers */
 PHP_FUNCTION(stream_get_meta_data)
 {
zval **arg1;
@@ -1435,10 +1435,10 @@
 
convert_to_long_ex(bytes);
len = Z_LVAL_PP(bytes);
-if (len < 0) {
+   if (len < 0) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Length parameter may not 
be negative");
RETURN_FALSE;
-}
+   }
 
buf = safe_emalloc(sizeof(char), (len + 1), 0);
/*needed because recv doesnt set null char at end*/
@@ -1675,7 +1675,7 @@
php_stream *stream;
 
if (argcount < 2 || argcount > 3 ||
-   zend_get_parameters_ex(argcount, &arg1, &arg2, &arg3) == FAILURE) {
+   zend_get_parameters_ex(argcount, &arg1, &arg2, &arg3) == FAILURE) {
WRONG_PARAM_COUNT;
}
 
@@ -1954,7 +1954,7 @@
php_stream_statbuf stat_ssb;

char *stat_sb_names[13]={"dev", "ino", "mode", "nlink", "uid", "gid", "rdev",
- "size", "atime", "mtime", "ctime", "blksize", "blocks"};
+ "size", "atime", "mtime", "ctime", "blksize", 
"blocks"};
 
if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &fp) == FAILURE) {
WRONG_PARAM_COUNT;
@@ -2100,10 +2100,10 @@
 
convert_to_long_ex(arg2);
len = Z_LVAL_PP(arg2);
-if (len < 0) {
+   if (len < 0) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Length parameter may not 
be negative");
RETURN_FALSE;
-}
+   }
 
Z_STRVAL_P(return_value) = emalloc(len + 1);
Z_STRLEN_P(return_value) = php_stream_read(stream, Z_STRVAL_P(return_value), 
len);
@@ -2378,24 +2378,24 @@
md->ulc = 0;
}
 
-switch (ch) {
-case '<':
-return TOK_OPENTAG;
-break;
-case '>':
-return TOK_CLOSETAG;
-break;
-case '=':
-return TOK_EQUAL;
-break;
-case '/':
-return TOK_SLASH;
-break;
-case '\'':
-case '"':
-compliment = ch;
-md->token_len = 0;
-while (!php_stream_eof(md->stream) &&
+   switch (ch) {
+   case '<':
+   return TOK_OPENTAG;
+   break;
+   case '>':
+   return TOK_CLOSETAG;
+   break;
+   case '=':
+   return TOK_EQUAL;

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

2003-06-06 Thread Jani Taskinen
sniper  Fri Jun  6 04:10:02 2003 EDT

  Modified files:  
/php4/ext/standard  file.c 
  Log:
  WS
  
Index: php4/ext/standard/file.c
diff -u php4/ext/standard/file.c:1.344 php4/ext/standard/file.c:1.345
--- php4/ext/standard/file.c:1.344  Fri May 30 20:32:45 2003
+++ php4/ext/standard/file.cFri Jun  6 04:10:02 2003
@@ -21,7 +21,7 @@
+--+
  */
 
-/* $Id: file.c,v 1.344 2003/05/31 00:32:45 iliaa Exp $ */
+/* $Id: file.c,v 1.345 2003/06/06 08:10:02 sniper Exp $ */
 
 /* Synced with php 3.0 revision 1.218 1999-06-16 [ssb] */
 
@@ -1920,10 +1920,10 @@
return TOK_EQUAL;
break;
case '/':
-   return TOK_SLASH;
+   return TOK_SLASH;
break;
 
-   case '\'':
+   case '\'':
case '"':
compliment = ch;
md->token_len = 0;



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



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

2003-06-06 Thread Hartmut Holzgraefe
hholzgraThu Jun  5 10:42:12 2003 EDT

  Modified files:  
/php4/ext/mime_magicmime_magic.c 
  Log:
  ... as suggested by Wez
  
  
Index: php4/ext/mime_magic/mime_magic.c
diff -u php4/ext/mime_magic/mime_magic.c:1.28 php4/ext/mime_magic/mime_magic.c:1.29
--- php4/ext/mime_magic/mime_magic.c:1.28   Wed Jun  4 10:21:40 2003
+++ php4/ext/mime_magic/mime_magic.cThu Jun  5 10:42:12 2003
@@ -15,7 +15,7 @@
   | Author: Hartmut Holzgraefe  <[EMAIL PROTECTED]>   |
   +--+
 
-  $Id: mime_magic.c,v 1.28 2003/06/04 14:21:40 hholzgra Exp $ 
+  $Id: mime_magic.c,v 1.29 2003/06/05 14:42:12 hholzgra Exp $ 
 
   This module contains a lot of stuff taken from Apache mod_mime_magic,
   so the license section is a little bit longer than usual:
@@ -324,7 +324,7 @@
{
php_stream *stream;
 
-   php_stream_from_zval(stream, &what);
+   php_stream_from_zval_no_verify(stream, &what);
if (stream) {
break;
}



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



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

2003-06-06 Thread Sterling Hughes
sterlingThu Jun  5 09:58:15 2003 EDT

  Modified files:  
/php4/ext/standard  array.c 
  Log:
  fix array_key_exists() from HANDLE_NUMERIC() changes
  
  # need to go through this file and find any stuff that relies on this 
  # change
  
  
Index: php4/ext/standard/array.c
diff -u php4/ext/standard/array.c:1.230 php4/ext/standard/array.c:1.231
--- php4/ext/standard/array.c:1.230 Tue May 20 14:18:56 2003
+++ php4/ext/standard/array.c   Thu Jun  5 09:58:14 2003
@@ -21,7 +21,7 @@
+--+
 */
 
-/* $Id: array.c,v 1.230 2003/05/20 18:18:56 sterling Exp $ */
+/* $Id: array.c,v 1.231 2003/06/05 13:58:14 sterling Exp $ */
 
 #include "php.h"
 #include "php_ini.h"
@@ -3629,6 +3629,7 @@
 {
zval **key, /* key to check for */
 **array;   /* array to check in */
+   long   lvalue;
 
if (ZEND_NUM_ARGS() != 2 ||
zend_get_parameters_ex(ZEND_NUM_ARGS(), &key, &array) == FAILURE) {
@@ -3642,11 +3643,14 @@
 
switch (Z_TYPE_PP(key)) {
case IS_STRING:
-   if (zend_hash_exists(HASH_OF(*array), Z_STRVAL_PP(key), 
Z_STRLEN_PP(key)+1)) {
+   if (zend_is_numeric_key(*key, &lvalue)) {
+   if (zend_hash_index_exists(HASH_OF(*array), lvalue)) {
+   RETURN_TRUE;
+   }
+   } else if (zend_hash_exists(HASH_OF(*array), Z_STRVAL_PP(key), 
Z_STRLEN_PP(key)+1)) {
RETURN_TRUE;
}
RETURN_FALSE;
-
case IS_LONG:
if (zend_hash_index_exists(HASH_OF(*array), Z_LVAL_PP(key))) {
RETURN_TRUE;



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