[PHP-CVS] cvs: php-src /ext/spl/examples dualiterator.inc

2009-02-03 Thread Etienne Kneuss
colder  Tue Feb  3 12:40:01 2009 UTC

  Modified files:  
/php-src/ext/spl/examples   dualiterator.inc 
  Log:
  Fix #47031 (Fix constants in example)
  
http://cvs.php.net/viewvc.cgi/php-src/ext/spl/examples/dualiterator.inc?r1=1.4r2=1.5diff_format=u
Index: php-src/ext/spl/examples/dualiterator.inc
diff -u php-src/ext/spl/examples/dualiterator.inc:1.4 
php-src/ext/spl/examples/dualiterator.inc:1.5
--- php-src/ext/spl/examples/dualiterator.inc:1.4   Sun Dec 10 23:44:35 2006
+++ php-src/ext/spl/examples/dualiterator.inc   Tue Feb  3 12:40:00 2009
@@ -23,10 +23,9 @@
 
const KEY_LHS   = 0x10;
const KEY_RHS   = 0x20;
-   const KEY_ARRAY = 0x30;
const KEY_0 = 0x00;

-   const DEFAULT_FLAGS = 0x33;
+   const DEFAULT_FLAGS = 0x13;

private $lhs;
private $rhs;
@@ -39,7 +38,7 @@
 * @param flags iteration flags
 */
function __construct(Iterator $lhs, Iterator $rhs, 
-   $flags = 0x33 
/*DualIterator::DEFAULT_FLAGS*/)
+   $flags = 0x13 
/*DualIterator::DEFAULT_FLAGS*/)
{
$this-lhs   = $lhs;
$this-rhs   = $rhs;
@@ -107,20 +106,18 @@
}
}
 
-   /** @return current value depending on KEY_* flags
+   /** @return key value depending on KEY_* flags
 */ 
function key()
{
switch($this-flags  0xF0)
{
default:
-   case self::CURRENT_ARRAY:
-   return array($this-lhs-key(), $this-rhs-key());
-   case self::CURRENT_LHS:
+   case self::KEY_LHS:
return $this-lhs-key();
-   case self::CURRENT_RHS:
+   case self::KEY_RHS:
return $this-rhs-key();
-   case self::CURRENT_0:
+   case self::KEY_0:
return NULL;
}
}



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



[PHP-CVS] cvs: php-src(PHP_5_3) / NEWS /ext/phar Makefile.frag

2009-02-03 Thread Greg Beaver
cellog  Tue Feb  3 18:17:24 2009 UTC

  Modified files:  (Branch: PHP_5_3)
/php-srcNEWS 
/php-src/ext/phar   Makefile.frag 
  Log:
  fix bug #47265 (generating phar.phar fails because of safe_mode)
  
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.965.2.482r2=1.2027.2.547.2.965.2.483diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.965.2.482 
php-src/NEWS:1.2027.2.547.2.965.2.483
--- php-src/NEWS:1.2027.2.547.2.965.2.482   Tue Feb  3 12:54:44 2009
+++ php-src/NEWSTue Feb  3 18:17:24 2009
@@ -1,9 +1,10 @@
 PHPNEWS
 |||
 ?? ??? 2009, PHP 5.3.0 Beta 2
+- Fixed bug #47265 (generating phar.phar failes because of safe_mode). (Greg)
 - Fixed bug #47229 (preg_quote() should escape the '-' char). (Nuno)
-- Fixed bug #46347 (parse_ini_file() doesn't support * in keys). (Nuno)
 - Fixed bug #47031 (Fix constants in DualIterator example). (Etienne)
+- Fixed bug #46347 (parse_ini_file() doesn't support * in keys). (Nuno)
 
 
 29 Jan 2009, PHP 5.3.0 Beta 1
http://cvs.php.net/viewvc.cgi/php-src/ext/phar/Makefile.frag?r1=1.14.2.8r2=1.14.2.9diff_format=u
Index: php-src/ext/phar/Makefile.frag
diff -u php-src/ext/phar/Makefile.frag:1.14.2.8 
php-src/ext/phar/Makefile.frag:1.14.2.9
--- php-src/ext/phar/Makefile.frag:1.14.2.8 Sat Dec 13 14:49:39 2008
+++ php-src/ext/phar/Makefile.frag  Tue Feb  3 18:17:24 2009
@@ -4,7 +4,7 @@
 
 pharcmd: $(builddir)/phar.php $(builddir)/phar.phar
 
-PHP_PHARCMD_SETTINGS = -d 'open_basedir=' -d 'output_buffering=0' -d 
'memory_limit=-1' -d phar.readonly=0
+PHP_PHARCMD_SETTINGS = -d 'open_basedir=' -d 'output_buffering=0' -d 
'memory_limit=-1' -d phar.readonly=0 -d 'safe_mode=0'
 PHP_PHARCMD_EXECUTABLE = ` \
if test -x $(top_builddir)/$(SAPI_CLI_PATH); then \
$(top_srcdir)/build/shtool echo -n -- 
$(top_builddir)/$(SAPI_CLI_PATH) -n; \



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



[PHP-CVS] cvs: php-src /ext/phar Makefile.frag

2009-02-03 Thread Greg Beaver
cellog  Tue Feb  3 18:25:59 2009 UTC

  Modified files:  
/php-src/ext/phar   Makefile.frag 
  Log:
  MFB fix Bug #47265 (generating phar.phar fails because of safe_mode)
  
http://cvs.php.net/viewvc.cgi/php-src/ext/phar/Makefile.frag?r1=1.17r2=1.18diff_format=u
Index: php-src/ext/phar/Makefile.frag
diff -u php-src/ext/phar/Makefile.frag:1.17 php-src/ext/phar/Makefile.frag:1.18
--- php-src/ext/phar/Makefile.frag:1.17 Sat Dec 13 14:49:21 2008
+++ php-src/ext/phar/Makefile.frag  Tue Feb  3 18:25:59 2009
@@ -4,7 +4,7 @@
 
 pharcmd: $(builddir)/phar.php $(builddir)/phar.phar
 
-PHP_PHARCMD_SETTINGS = -d 'open_basedir=' -d 'output_buffering=0' -d 
'memory_limit=-1' -d phar.readonly=0
+PHP_PHARCMD_SETTINGS = -d 'open_basedir=' -d 'output_buffering=0' -d 
'memory_limit=-1' -d phar.readonly=0 -d 'safe_mode=0'
 PHP_PHARCMD_EXECUTABLE = ` \
if test -x $(top_builddir)/$(SAPI_CLI_PATH); then \
$(top_srcdir)/build/shtool echo -n -- 
$(top_builddir)/$(SAPI_CLI_PATH) -n; \



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



[PHP-CVS] cvs: php-src(PHP_5_3) / NEWS /ext/phar stream.c /ext/phar/tests bug47085.phpt

2009-02-03 Thread Greg Beaver
cellog  Tue Feb  3 18:29:25 2009 UTC

  Added files: (Branch: PHP_5_3)
/php-src/ext/phar/tests bug47085.phpt 

  Modified files:  
/php-srcNEWS 
/php-src/ext/phar   stream.c 
  Log:
  fix bug #47085:rename() returns true even if the file in PHAR does not exist
  
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.965.2.483r2=1.2027.2.547.2.965.2.484diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.965.2.483 
php-src/NEWS:1.2027.2.547.2.965.2.484
--- php-src/NEWS:1.2027.2.547.2.965.2.483   Tue Feb  3 18:17:24 2009
+++ php-src/NEWSTue Feb  3 18:29:25 2009
@@ -3,6 +3,7 @@
 ?? ??? 2009, PHP 5.3.0 Beta 2
 - Fixed bug #47265 (generating phar.phar failes because of safe_mode). (Greg)
 - Fixed bug #47229 (preg_quote() should escape the '-' char). (Nuno)
+- Fixed bug #47085 (rename() returns true even if the file in PHAR does not 
exist). (Greg)
 - Fixed bug #47031 (Fix constants in DualIterator example). (Etienne)
 - Fixed bug #46347 (parse_ini_file() doesn't support * in keys). (Nuno)
 
http://cvs.php.net/viewvc.cgi/php-src/ext/phar/stream.c?r1=1.27.2.22r2=1.27.2.23diff_format=u
Index: php-src/ext/phar/stream.c
diff -u php-src/ext/phar/stream.c:1.27.2.22 php-src/ext/phar/stream.c:1.27.2.23
--- php-src/ext/phar/stream.c:1.27.2.22 Wed Dec 31 11:15:42 2008
+++ php-src/ext/phar/stream.c   Tue Feb  3 18:29:25 2009
@@ -888,6 +888,14 @@
is_dir = entry-is_dir;
} else {
is_dir = zend_hash_exists((phar-virtual_dirs), 
resource_from-path+1, strlen(resource_from-path)-1);
+   if (!is_dir) {
+   /* file does not exist */
+   php_url_free(resource_from);
+   php_url_free(resource_to);
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, phar 
error: cannot rename \%s\ to \%s\ from extracted phar archive, source does 
not exist, url_from, url_to);
+   return 0;
+
+   }
}
 
/* Rename directory. Update all nested paths */

http://cvs.php.net/viewvc.cgi/php-src/ext/phar/tests/bug47085.phpt?view=markuprev=1.1
Index: php-src/ext/phar/tests/bug47085.phpt
+++ php-src/ext/phar/tests/bug47085.phpt



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



[PHP-CVS] cvs: php-src /ext/phar stream.c /ext/phar/tests bug47085.phpt

2009-02-03 Thread Greg Beaver
cellog  Tue Feb  3 18:29:46 2009 UTC

  Modified files:  
/php-src/ext/phar   stream.c 
/php-src/ext/phar/tests bug47085.phpt 
  Log:
  MFB: fix bug #47085:rename() returns true even if the file in PHAR does not 
exist
  
http://cvs.php.net/viewvc.cgi/php-src/ext/phar/stream.c?r1=1.39r2=1.40diff_format=u
Index: php-src/ext/phar/stream.c
diff -u php-src/ext/phar/stream.c:1.39 php-src/ext/phar/stream.c:1.40
--- php-src/ext/phar/stream.c:1.39  Wed Dec 31 11:12:35 2008
+++ php-src/ext/phar/stream.c   Tue Feb  3 18:29:46 2009
@@ -888,6 +888,14 @@
is_dir = entry-is_dir;
} else {
is_dir = zend_hash_exists((phar-virtual_dirs), 
resource_from-path+1, strlen(resource_from-path)-1);
+   if (!is_dir) {
+   /* file does not exist */
+   php_url_free(resource_from);
+   php_url_free(resource_to);
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, phar 
error: cannot rename \%s\ to \%s\ from extracted phar archive, source does 
not exist, url_from, url_to);
+   return 0;
+
+   }
}
 
/* Rename directory. Update all nested paths */
http://cvs.php.net/viewvc.cgi/php-src/ext/phar/tests/bug47085.phpt?r1=1.1r2=1.2diff_format=u
Index: php-src/ext/phar/tests/bug47085.phpt
diff -u /dev/null php-src/ext/phar/tests/bug47085.phpt:1.2
--- /dev/null   Tue Feb  3 18:29:46 2009
+++ php-src/ext/phar/tests/bug47085.phptTue Feb  3 18:29:46 2009
@@ -0,0 +1,24 @@
+--TEST--
+Phar: PHP bug #47085: rename() returns true even if the file in PHAR does not 
exist
+--SKIPIF--
+?php if (!extension_loaded(phar)) die(skip); ?
+--INI--
+phar.require_hash=0
+phar.readonly=0
+--FILE--
+?php
+$fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar';
+
+$phar = new Phar($fname, 0, 'a.phar');
+$phar['x'] = 'hi';
+unset($phar);
+rename(phar://a.phar/x, phar://a.phar/y);
+var_dump(rename(phar://a.phar/x, phar://a.phar/y));
+?
+===DONE===
+--CLEAN--
+?php unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . 
'.phar');?
+--EXPECTF--
+Warning: rename(): phar error: cannot rename phar://a.phar/x to 
phar://a.phar/y from extracted phar archive, source does not exist in 
%sbug47085.php on line %d
+bool(false)
+===DONE===
\ No newline at end of file



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



[PHP-CVS] cvs: php-src(PHP_5_3) / NEWS /ext/bz2 bz2_filter.c

2009-02-03 Thread Greg Beaver
cellog  Tue Feb  3 18:56:26 2009 UTC

  Modified files:  (Branch: PHP_5_3)
/php-srcNEWS 
/php-src/ext/bz2bz2_filter.c 
  Log:
  Re-Fixed bug #46026 (bz2.decompress/zlib.inflate filter tries to decompress 
after end of stream)
  
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.965.2.484r2=1.2027.2.547.2.965.2.485diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.965.2.484 
php-src/NEWS:1.2027.2.547.2.965.2.485
--- php-src/NEWS:1.2027.2.547.2.965.2.484   Tue Feb  3 18:29:25 2009
+++ php-src/NEWSTue Feb  3 18:56:25 2009
@@ -6,7 +6,8 @@
 - Fixed bug #47085 (rename() returns true even if the file in PHAR does not 
exist). (Greg)
 - Fixed bug #47031 (Fix constants in DualIterator example). (Etienne)
 - Fixed bug #46347 (parse_ini_file() doesn't support * in keys). (Nuno)
-
+- Re-Fixed bug #46026 (bz2.decompress/zlib.inflate filter tries to decompress 
after
+  end of stream). (Greg)
 
 29 Jan 2009, PHP 5.3.0 Beta 1
 - Upgraded bundled sqlite to version 3.6.10. (Scott, Ilia)
http://cvs.php.net/viewvc.cgi/php-src/ext/bz2/bz2_filter.c?r1=1.3.2.2.2.5.2.6r2=1.3.2.2.2.5.2.7diff_format=u
Index: php-src/ext/bz2/bz2_filter.c
diff -u php-src/ext/bz2/bz2_filter.c:1.3.2.2.2.5.2.6 
php-src/ext/bz2/bz2_filter.c:1.3.2.2.2.5.2.7
--- php-src/ext/bz2/bz2_filter.c:1.3.2.2.2.5.2.6Wed Dec 31 11:15:35 2008
+++ php-src/ext/bz2/bz2_filter.cTue Feb  3 18:56:26 2009
@@ -16,7 +16,7 @@
+--+
 */
 
-/* $Id: bz2_filter.c,v 1.3.2.2.2.5.2.6 2008/12/31 11:15:35 sebastian Exp $ */
+/* $Id: bz2_filter.c,v 1.3.2.2.2.5.2.7 2009/02/03 18:56:26 cellog Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -353,11 +353,14 @@
if (Z_TYPE_P(filterparams) == IS_ARRAY || 
Z_TYPE_P(filterparams) == IS_OBJECT) {
 
if (SUCCESS == 
zend_hash_find(HASH_OF(filterparams), concatenated, sizeof(concatenated), 
(void **) tmpzval) ) {
-   SEPARATE_ZVAL(tmpzval);
-   convert_to_boolean_ex(tmpzval);
-   data-expect_concatenated = 
Z_LVAL_PP(tmpzval);
-   zval_ptr_dtor(tmpzval);
-   tmpzval = NULL;
+   zval tmp, *tmp2;
+
+   tmp = **tmpzval;
+   zval_copy_ctor(tmp);
+   tmp2 = tmp;
+   convert_to_boolean_ex(tmp2);
+   data-expect_concatenated = Z_LVAL(tmp);
+   tmpzval = NULL;
}
 
zend_hash_find(HASH_OF(filterparams), small, 
sizeof(small), (void **) tmpzval);
@@ -366,10 +369,13 @@
}
 
if (tmpzval) {
-   SEPARATE_ZVAL(tmpzval);
-   convert_to_boolean_ex(tmpzval);
-   data-small_footprint = Z_LVAL_PP(tmpzval);
-   zval_ptr_dtor(tmpzval);
+   zval tmp, *tmp2;
+
+   tmp = **tmpzval;
+   zval_copy_ctor(tmp);
+   tmp2 = tmp;
+   convert_to_boolean_ex(tmp2);
+   data-small_footprint = Z_LVAL(tmp);
}
}
 
@@ -385,26 +391,31 @@
if (Z_TYPE_P(filterparams) == IS_ARRAY || 
Z_TYPE_P(filterparams) == IS_OBJECT) {
if (zend_hash_find(HASH_OF(filterparams), 
blocks, sizeof(blocks), (void**) tmpzval) == SUCCESS) {
/* How much memory to allocate (1 - 9) 
x 100kb */
-   SEPARATE_ZVAL(tmpzval);
-   convert_to_long_ex(tmpzval);
-   if (Z_LVAL_PP(tmpzval)  1 || 
Z_LVAL_PP(tmpzval)  9) {
+   zval tmp;
+   
+   tmp = **tmpzval;
+   zval_copy_ctor(tmp);
+   convert_to_long(tmp);
+   if (Z_LVAL(tmp)  1 || Z_LVAL(tmp)  9) 
{
php_error_docref(NULL 
TSRMLS_CC, E_WARNING, Invalid parameter given for number of blocks to 
allocate. (%ld), Z_LVAL_PP(tmpzval));
} else {
-   blockSize100k = 
Z_LVAL_PP(tmpzval);
+   blockSize100k = Z_LVAL(tmp);
   

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

2009-02-03 Thread Greg Beaver
cellog  Tue Feb  3 19:02:41 2009 UTC

  Modified files:  
/php-src/ext/bz2bz2_filter.c 
  Log:
  MFB: Re-Fixed bug #46026 (bz2.decompress/zlib.inflate filter tries to 
decompress after end of stream)
  
http://cvs.php.net/viewvc.cgi/php-src/ext/bz2/bz2_filter.c?r1=1.19r2=1.20diff_format=u
Index: php-src/ext/bz2/bz2_filter.c
diff -u php-src/ext/bz2/bz2_filter.c:1.19 php-src/ext/bz2/bz2_filter.c:1.20
--- php-src/ext/bz2/bz2_filter.c:1.19   Wed Dec 31 11:12:29 2008
+++ php-src/ext/bz2/bz2_filter.cTue Feb  3 19:02:41 2009
@@ -16,7 +16,7 @@
+--+
 */
 
-/* $Id: bz2_filter.c,v 1.19 2008/12/31 11:12:29 sebastian Exp $ */
+/* $Id: bz2_filter.c,v 1.20 2009/02/03 19:02:41 cellog Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -333,7 +333,7 @@
/* Create this filter */
data = pecalloc(1, sizeof(php_bz2_filter_data), persistent);
if (!data) {
-   php_error_docref(NULL TSRMLS_CC, E_WARNING, Failed allocating 
%zu bytes, sizeof(php_bz2_filter_data));
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, Failed allocating 
%zu bytes., sizeof(php_bz2_filter_data));
return NULL;
}
 
@@ -346,14 +346,14 @@
data-strm.avail_out = data-outbuf_len = data-inbuf_len = 2048;
data-strm.next_in = data-inbuf = (char *) pemalloc(data-inbuf_len, 
persistent);
if (!data-inbuf) {
-   php_error_docref(NULL TSRMLS_CC, E_WARNING, Failed allocating 
%zu bytes, data-inbuf_len);
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, Failed allocating 
%zu bytes., data-inbuf_len);
pefree(data, persistent);
return NULL;
}
data-strm.avail_in = 0;
data-strm.next_out = data-outbuf = (char *) 
pemalloc(data-outbuf_len, persistent);
if (!data-outbuf) {
-   php_error_docref(NULL TSRMLS_CC, E_WARNING, Failed allocating 
%zu bytes, data-outbuf_len);
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, Failed allocating 
%zu bytes., data-outbuf_len);
pefree(data-inbuf, persistent);
pefree(data, persistent);
return NULL;
@@ -369,11 +369,14 @@
if (Z_TYPE_P(filterparams) == IS_ARRAY || 
Z_TYPE_P(filterparams) == IS_OBJECT) {
 
if (SUCCESS == 
zend_hash_find(HASH_OF(filterparams), concatenated, sizeof(concatenated), 
(void **) tmpzval) ) {
-   SEPARATE_ZVAL(tmpzval);
-   convert_to_boolean_ex(tmpzval);
-   data-expect_concatenated = 
Z_LVAL_PP(tmpzval);
-   zval_ptr_dtor(tmpzval);
-   tmpzval = NULL;
+   zval tmp, *tmp2;
+
+   tmp = **tmpzval;
+   zval_copy_ctor(tmp);
+   tmp2 = tmp;
+   convert_to_boolean_ex(tmp2);
+   data-expect_concatenated = Z_LVAL(tmp);
+   tmpzval = NULL;
}
 
zend_hash_find(HASH_OF(filterparams), small, 
sizeof(small), (void **) tmpzval);
@@ -382,10 +385,13 @@
}
 
if (tmpzval) {
-   SEPARATE_ZVAL(tmpzval);
-   convert_to_boolean_ex(tmpzval);
-   data-small_footprint = Z_LVAL_PP(tmpzval);
-   zval_ptr_dtor(tmpzval);
+   zval tmp, *tmp2;
+
+   tmp = **tmpzval;
+   zval_copy_ctor(tmp);
+   tmp2 = tmp;
+   convert_to_boolean_ex(tmp2);
+   data-small_footprint = Z_LVAL(tmp);
}
}
 
@@ -401,26 +407,31 @@
if (Z_TYPE_P(filterparams) == IS_ARRAY || 
Z_TYPE_P(filterparams) == IS_OBJECT) {
if (zend_hash_find(HASH_OF(filterparams), 
blocks, sizeof(blocks), (void**) tmpzval) == SUCCESS) {
/* How much memory to allocate (1 - 9) 
x 100kb */
-   SEPARATE_ZVAL(tmpzval);
-   convert_to_long_ex(tmpzval);
-   if (Z_LVAL_PP(tmpzval)  1 || 
Z_LVAL_PP(tmpzval)  9) {
+   zval tmp;
+   
+   tmp = **tmpzval;
+   zval_copy_ctor(tmp);
+ 

[PHP-CVS] cvs: php-src(PHP_5_3) /ext/sockets sockets.c

2009-02-03 Thread Ilia Alshanetsky
iliaa   Tue Feb  3 19:22:55 2009 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/socketssockets.c 
  Log:
  MFB: Return empty string when recv() does not fetch any data
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/sockets/sockets.c?r1=1.171.2.9.2.14.2.15r2=1.171.2.9.2.14.2.16diff_format=u
Index: php-src/ext/sockets/sockets.c
diff -u php-src/ext/sockets/sockets.c:1.171.2.9.2.14.2.15 
php-src/ext/sockets/sockets.c:1.171.2.9.2.14.2.16
--- php-src/ext/sockets/sockets.c:1.171.2.9.2.14.2.15   Sat Jan 24 13:06:21 2009
+++ php-src/ext/sockets/sockets.c   Tue Feb  3 19:22:55 2009
@@ -19,7 +19,7 @@
+--+
  */
 
-/* $Id: sockets.c,v 1.171.2.9.2.14.2.15 2009/01/24 13:06:21 tony2001 Exp $ */
+/* $Id: sockets.c,v 1.171.2.9.2.14.2.16 2009/02/03 19:22:55 iliaa Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -1046,6 +1046,9 @@
 
efree(tmpbuf);
RETURN_FALSE;
+   } else if (!retval) {
+   efree(tmpbuf);
+   RETURN_EMPTY_STRING();
}
 
tmpbuf = erealloc(tmpbuf, retval + 1);



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



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

2009-02-03 Thread Ilia Alshanetsky
iliaa   Tue Feb  3 19:23:12 2009 UTC

  Modified files:  
/php-src/ext/socketssockets.c 
  Log:
  
  MFB: Return empty string when recv() does not fetch any data
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/sockets/sockets.c?r1=1.209r2=1.210diff_format=u
Index: php-src/ext/sockets/sockets.c
diff -u php-src/ext/sockets/sockets.c:1.209 php-src/ext/sockets/sockets.c:1.210
--- php-src/ext/sockets/sockets.c:1.209 Sat Jan 24 13:09:13 2009
+++ php-src/ext/sockets/sockets.c   Tue Feb  3 19:23:12 2009
@@ -19,7 +19,7 @@
+--+
  */
 
-/* $Id: sockets.c,v 1.209 2009/01/24 13:09:13 tony2001 Exp $ */
+/* $Id: sockets.c,v 1.210 2009/02/03 19:23:12 iliaa Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -1036,6 +1036,9 @@
 
efree(tmpbuf);
RETURN_FALSE;
+   } else if (!retval) {
+   efree(tmpbuf);
+   RETURN_EMPTY_STRING();
}
 
tmpbuf = erealloc(tmpbuf, retval + 1);



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



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/simplexml simplexml.c /ext/simplexml/tests bug46048.phpt

2009-02-03 Thread David Coallier
davidc  Tue Feb  3 21:42:36 2009 UTC

  Added files: (Branch: PHP_5_3)
/php-src/ext/simplexml/testsbug46048.phpt 

  Modified files:  
/php-src/ext/simplexml  simplexml.c 
  Log:
  - Fixed Bug #46048 (SimpleXML top-level @attributes not part of iterator)
  - Added test for bug #46048
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/simplexml/simplexml.c?r1=1.151.2.22.2.35.2.30r2=1.151.2.22.2.35.2.31diff_format=u
Index: php-src/ext/simplexml/simplexml.c
diff -u php-src/ext/simplexml/simplexml.c:1.151.2.22.2.35.2.30 
php-src/ext/simplexml/simplexml.c:1.151.2.22.2.35.2.31
--- php-src/ext/simplexml/simplexml.c:1.151.2.22.2.35.2.30  Wed Dec 31 
11:15:43 2008
+++ php-src/ext/simplexml/simplexml.c   Tue Feb  3 21:42:35 2009
@@ -18,7 +18,7 @@
   +--+
 */
 
-/* $Id: simplexml.c,v 1.151.2.22.2.35.2.30 2008/12/31 11:15:43 sebastian Exp $ 
*/
+/* $Id: simplexml.c,v 1.151.2.22.2.35.2.31 2009/02/03 21:42:35 davidc Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -1087,7 +1087,7 @@
if (!node) {
return rv;
}
-   if (is_debug) {
+   if (is_debug || sxe-iter.type != SXE_ITER_CHILD) {
if (sxe-iter.type == SXE_ITER_ELEMENT) {
node = php_sxe_get_first_node(sxe, node TSRMLS_CC);
}
@@ -2555,7 +2555,7 @@
 {
php_info_print_table_start();
php_info_print_table_header(2, Simplexml support, enabled);
-   php_info_print_table_row(2, Revision, $Revision: 
1.151.2.22.2.35.2.30 $);
+   php_info_print_table_row(2, Revision, $Revision: 
1.151.2.22.2.35.2.31 $);
php_info_print_table_row(2, Schema support,
 #ifdef LIBXML_SCHEMAS_ENABLED
enabled);

http://cvs.php.net/viewvc.cgi/php-src/ext/simplexml/tests/bug46048.phpt?view=markuprev=1.1
Index: php-src/ext/simplexml/tests/bug46048.phpt
+++ php-src/ext/simplexml/tests/bug46048.phpt



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



[PHP-CVS] cvs: php-src(PHP_5_3) / NEWS

2009-02-03 Thread David Coallier
davidc  Tue Feb  3 21:45:19 2009 UTC

  Modified files:  (Branch: PHP_5_3)
/php-srcNEWS 
  Log:
  - Added news item for Bugfix #46048
  
  
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.965.2.485r2=1.2027.2.547.2.965.2.486diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.965.2.485 
php-src/NEWS:1.2027.2.547.2.965.2.486
--- php-src/NEWS:1.2027.2.547.2.965.2.485   Tue Feb  3 18:56:25 2009
+++ php-src/NEWSTue Feb  3 21:45:19 2009
@@ -8,6 +8,7 @@
 - Fixed bug #46347 (parse_ini_file() doesn't support * in keys). (Nuno)
 - Re-Fixed bug #46026 (bz2.decompress/zlib.inflate filter tries to decompress 
after
   end of stream). (Greg)
+- Fixed bug #46048 (SimpleXML top-level @attributes not part of iterator). 
(David C.)
 
 29 Jan 2009, PHP 5.3.0 Beta 1
 - Upgraded bundled sqlite to version 3.6.10. (Scott, Ilia)



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



Re: [PHP-CVS] cvs: php-src(PHP_5_3) /ext/simplexml simplexml.c /ext/simplexml/tests bug46048.phpt

2009-02-03 Thread Ilia Alshanetsky


MFH to 5.2?

On 3-Feb-09, at 4:42 PM, David Coallier wrote:


davidc  Tue Feb  3 21:42:36 2009 UTC

 Added files: (Branch: PHP_5_3)
   /php-src/ext/simplexml/tests bug46048.phpt

 Modified files:
   /php-src/ext/simplexml   simplexml.c
 Log:
 - Fixed Bug #46048 (SimpleXML top-level @attributes not part of  
iterator)

 - Added test for bug #46048


http://cvs.php.net/viewvc.cgi/php-src/ext/simplexml/simplexml.c?r1=1.151.2.22.2.35.2.30r2=1.151.2.22.2.35.2.31diff_format=u
Index: php-src/ext/simplexml/simplexml.c
diff -u php-src/ext/simplexml/simplexml.c:1.151.2.22.2.35.2.30 php- 
src/ext/simplexml/simplexml.c:1.151.2.22.2.35.2.31
--- php-src/ext/simplexml/simplexml.c:1.151.2.22.2.35.2.30	Wed Dec  
31 11:15:43 2008

+++ php-src/ext/simplexml/simplexml.c   Tue Feb  3 21:42:35 2009
@@ -18,7 +18,7 @@
   
+ 
--+

*/

-/* $Id: simplexml.c,v 1.151.2.22.2.35.2.30 2008/12/31 11:15:43  
sebastian Exp $ */
+/* $Id: simplexml.c,v 1.151.2.22.2.35.2.31 2009/02/03 21:42:35  
davidc Exp $ */


#ifdef HAVE_CONFIG_H
#include config.h
@@ -1087,7 +1087,7 @@
if (!node) {
return rv;
}
-   if (is_debug) {
+   if (is_debug || sxe-iter.type != SXE_ITER_CHILD) {
if (sxe-iter.type == SXE_ITER_ELEMENT) {
node = php_sxe_get_first_node(sxe, node TSRMLS_CC);
}
@@ -2555,7 +2555,7 @@
{
php_info_print_table_start();
php_info_print_table_header(2, Simplexml support, enabled);
-	php_info_print_table_row(2, Revision, $Revision:  
1.151.2.22.2.35.2.30 $);
+	php_info_print_table_row(2, Revision, $Revision:  
1.151.2.22.2.35.2.31 $);

php_info_print_table_row(2, Schema support,
#ifdef LIBXML_SCHEMAS_ENABLED
enabled);

http://cvs.php.net/viewvc.cgi/php-src/ext/simplexml/tests/bug46048.phpt?view=markuprev=1.1
Index: php-src/ext/simplexml/tests/bug46048.phpt
+++ php-src/ext/simplexml/tests/bug46048.phpt



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



Ilia Alshanetsky





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



[PHP-CVS] cvs: php-src(PHP_5_2) /ext/sockets sockets.c

2009-02-03 Thread Ilia Alshanetsky
iliaa   Tue Feb  3 19:22:40 2009 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/socketssockets.c 
  Log:
  
  Return empty string when recv() does not fetch any data
  
http://cvs.php.net/viewvc.cgi/php-src/ext/sockets/sockets.c?r1=1.171.2.9.2.21r2=1.171.2.9.2.22diff_format=u
Index: php-src/ext/sockets/sockets.c
diff -u php-src/ext/sockets/sockets.c:1.171.2.9.2.21 
php-src/ext/sockets/sockets.c:1.171.2.9.2.22
--- php-src/ext/sockets/sockets.c:1.171.2.9.2.21Wed Dec 31 11:17:43 2008
+++ php-src/ext/sockets/sockets.c   Tue Feb  3 19:22:40 2009
@@ -19,7 +19,7 @@
+--+
  */
 
-/* $Id: sockets.c,v 1.171.2.9.2.21 2008/12/31 11:17:43 sebastian Exp $ */
+/* $Id: sockets.c,v 1.171.2.9.2.22 2009/02/03 19:22:40 iliaa Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -901,6 +901,9 @@
 
efree(tmpbuf);
RETURN_FALSE;
+   } else if (!retval) {
+   efree(tmpbuf);
+   RETURN_EMPTY_STRING();
}
 
tmpbuf = erealloc(tmpbuf, retval + 1);



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



[PHP-CVS] cvs: php-src /ext/simplexml simplexml.c /ext/simplexml/tests bug46048.phpt

2009-02-03 Thread David Coallier
davidc  Wed Feb  4 00:07:27 2009 UTC

  Modified files:  
/php-src/ext/simplexml  simplexml.c 
/php-src/ext/simplexml/testsbug46048.phpt 
  Log:
  - MFB (Fixed Bug #46048: SimpleXML top-level @attributes not in iterator).
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/simplexml/simplexml.c?r1=1.271r2=1.272diff_format=u
Index: php-src/ext/simplexml/simplexml.c
diff -u php-src/ext/simplexml/simplexml.c:1.271 
php-src/ext/simplexml/simplexml.c:1.272
--- php-src/ext/simplexml/simplexml.c:1.271 Wed Dec 31 11:12:35 2008
+++ php-src/ext/simplexml/simplexml.c   Wed Feb  4 00:07:27 2009
@@ -18,7 +18,7 @@
   +--+
 */
 
-/* $Id: simplexml.c,v 1.271 2008/12/31 11:12:35 sebastian Exp $ */
+/* $Id: simplexml.c,v 1.272 2009/02/04 00:07:27 davidc Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -1081,7 +1081,7 @@
if (!node) {
return rv;
}
-   if (is_debug) {
+   if (is_debug || sxe-iter.type != SXE_ITER_CHILD) {
if (sxe-iter.type == SXE_ITER_ELEMENT) {
node = php_sxe_get_first_node(sxe, node TSRMLS_CC);
}
@@ -2634,7 +2634,7 @@
 {
php_info_print_table_start();
php_info_print_table_header(2, Simplexml support, enabled);
-   php_info_print_table_row(2, Revision, $Revision: 1.271 $);
+   php_info_print_table_row(2, Revision, $Revision: 1.272 $);
php_info_print_table_row(2, Schema support,
 #ifdef LIBXML_SCHEMAS_ENABLED
enabled);
http://cvs.php.net/viewvc.cgi/php-src/ext/simplexml/tests/bug46048.phpt?r1=1.1r2=1.2diff_format=u
Index: php-src/ext/simplexml/tests/bug46048.phpt
diff -u /dev/null php-src/ext/simplexml/tests/bug46048.phpt:1.2
--- /dev/null   Wed Feb  4 00:07:27 2009
+++ php-src/ext/simplexml/tests/bug46048.phpt   Wed Feb  4 00:07:27 2009
@@ -0,0 +1,24 @@
+--TEST--
+Bug #46048 (SimpleXML top-level @attributes not part of iterator)
+--FILE--
+?php
+$xml = '
+data id=1
+keyvalue/key
+/data
+';
+$obj = simplexml_load_string($xml);
+print_r(get_object_vars($obj));
+echo Done\n;
+?
+--EXPECT-- 
+Array
+(
+[...@attributes] = Array
+(
+[id] = 1
+)
+
+[key] = value
+)
+Done



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