Re: [PHP-CVS] cvs: php-src(PHP_5_2) / NEWS /ext/standard file.c

2009-05-19 Thread Antony Dovgal
On 18.05.2009 22:46, Ilia Alshanetsky wrote:
 iliaa Mon May 18 18:46:07 2009 UTC
 
   Modified files:  (Branch: PHP_5_2)
 /php-src/ext/standard file.c 
 /php-src  NEWS 
   Log:
   
   MFB: Fixed bug #48313 (fgetcsv() does not return null for empty rows)

All these tests started to fail:
/local/qa/5_2.zts/ext/standard/tests/file/fgetcsv.phpt
/local/qa/5_2.zts/ext/standard/tests/file/fgetcsv_variation1.phpt
/local/qa/5_2.zts/ext/standard/tests/file/fgetcsv_variation11.phpt
/local/qa/5_2.zts/ext/standard/tests/file/fgetcsv_variation14.phpt
/local/qa/5_2.zts/ext/standard/tests/file/fgetcsv_variation2.phpt
/local/qa/5_2.zts/ext/standard/tests/file/fgetcsv_variation21.phpt
/local/qa/5_2.zts/ext/standard/tests/file/fgetcsv_variation6.phpt
/local/qa/5_2.zts/ext/standard/tests/file/fgetcsv_variation7.phpt

-- 
Wbr, 
Antony Dovgal

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

2009-05-18 Thread Ilia Alshanetsky
iliaa   Mon May 18 18:46:07 2009 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/standard   file.c 
/php-srcNEWS 
  Log:
  
  MFB: Fixed bug #48313 (fgetcsv() does not return null for empty rows)
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/file.c?r1=1.409.2.6.2.41r2=1.409.2.6.2.42diff_format=u
Index: php-src/ext/standard/file.c
diff -u php-src/ext/standard/file.c:1.409.2.6.2.41 
php-src/ext/standard/file.c:1.409.2.6.2.42
--- php-src/ext/standard/file.c:1.409.2.6.2.41  Fri May  8 09:49:27 2009
+++ php-src/ext/standard/file.c Mon May 18 18:46:06 2009
@@ -21,7 +21,7 @@
+--+
  */
 
-/* $Id: file.c,v 1.409.2.6.2.41 2009/05/08 09:49:27 lbarnaud Exp $ */
+/* $Id: file.c,v 1.409.2.6.2.42 2009/05/18 18:46:06 iliaa Exp $ */
 
 /* Synced with php 3.0 revision 1.218 1999-06-16 [ssb] */
 
@@ -2384,8 +2384,12 @@
}
 
/* 3. Now pass our field back to php */
-   *comp_end = '\0';
-   add_next_index_stringl(return_value, temp, comp_end - temp, 1);
+   if (comp_end - temp) {
+   *comp_end = '\0';
+   add_next_index_stringl(return_value, temp, comp_end - 
temp, 1);
+   } else {
+   add_next_index_null(return_value);
+   }
} while (inc_len  0);
 
 out:
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.1513r2=1.2027.2.547.2.1514diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.1513 php-src/NEWS:1.2027.2.547.2.1514
--- php-src/NEWS:1.2027.2.547.2.1513Sun May 17 14:59:24 2009
+++ php-src/NEWSMon May 18 18:46:06 2009
@@ -16,6 +16,7 @@
 - Fixed segfault on invalid session.save_path. (Hannes)
 - Fixed leaks in imap when a mail_criteria is used. (Pierre)
 
+- Fixed bug #48313 (fgetcsv() does not return null for empty rows). (Ilia)
 - Fixed bug #48309 (stream_copy_to_stream() and fpasstru() do not update stream
   position of plain files). (Arnaud)
 - Fixed bug #48307 (stream_copy_to_stream() copies 0 bytes when $source is a 



-- 
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) / NEWS /ext/standard file.c streamsfuncs.c /ext/standard/tests/streams bug47997.phpt /main php_streams.h /main/streams cast.c streams.c

2009-04-19 Thread Arnaud Le Blanc
lbarnaudSun Apr 19 14:44:10 2009 UTC

  Added files: (Branch: PHP_5_2)
/php-src/ext/standard/tests/streams bug47997.phpt 

  Modified files:  
/php-srcNEWS 
/php-src/ext/standard   file.c streamsfuncs.c 
/php-src/main   php_streams.h 
/php-src/main/streams   cast.c streams.c 
  Log:
  MFB5.3: Fixed bug #47997 (stream_copy_to_stream returns 1 on empty streams)
  
  http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.1471r2=1.2027.2.547.2.1472diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.1471 php-src/NEWS:1.2027.2.547.2.1472
--- php-src/NEWS:1.2027.2.547.2.1471Thu Apr 16 13:53:24 2009
+++ php-src/NEWSSun Apr 19 14:44:09 2009
@@ -10,6 +10,7 @@
 - Fixed memory leak in ob_get_clean/ob_get_flush. (Christian)
 - Fixed segfault on invalid session.save_path. (Hannes)
 
+- Fixed bug #47997 (stream_copy_to_stream returns 1 on empty streams). (Arnaud)
 - Fixed bug #47981 (error handler not called regardless). (Hannes)
 - Fixed bug #47969 (ezmlm_hash() returns different values depend on OS).
   (Ilia)
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/file.c?r1=1.409.2.6.2.38r2=1.409.2.6.2.39diff_format=u
Index: php-src/ext/standard/file.c
diff -u php-src/ext/standard/file.c:1.409.2.6.2.38 
php-src/ext/standard/file.c:1.409.2.6.2.39
--- php-src/ext/standard/file.c:1.409.2.6.2.38  Wed Dec 31 11:17:44 2008
+++ php-src/ext/standard/file.c Sun Apr 19 14:44:09 2009
@@ -21,7 +21,7 @@
+--+
  */
 
-/* $Id: file.c,v 1.409.2.6.2.38 2008/12/31 11:17:44 sebastian Exp $ */
+/* $Id: file.c,v 1.409.2.6.2.39 2009/04/19 14:44:09 lbarnaud Exp $ */
 
 /* Synced with php 3.0 revision 1.218 1999-06-16 [ssb] */
 
@@ -630,7 +630,10 @@
 
switch (Z_TYPE_P(data)) {
case IS_RESOURCE:
-   numbytes = php_stream_copy_to_stream(srcstream, stream, 
PHP_STREAM_COPY_ALL);
+   numbytes = (int) 
php_stream_copy_to_stream_ex(srcstream, stream, PHP_STREAM_COPY_ALL);
+   if ((size_t)numbytes == PHP_STREAM_FAILURE) {
+   numbytes = -1;
+   }
break;
case IS_NULL:
case IS_LONG:
@@ -1836,7 +1839,7 @@
deststream = php_stream_open_wrapper(dest, wb, ENFORCE_SAFE_MODE | 
REPORT_ERRORS, NULL);
 
if (srcstream  deststream) {
-   ret = php_stream_copy_to_stream(srcstream, deststream, 
PHP_STREAM_COPY_ALL) == 0 ? FAILURE : SUCCESS;
+   ret = php_stream_copy_to_stream_ex(srcstream, deststream, 
PHP_STREAM_COPY_ALL) == PHP_STREAM_FAILURE ? FAILURE : SUCCESS;
}
if (srcstream) {
php_stream_close(srcstream);
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/streamsfuncs.c?r1=1.58.2.6.2.31r2=1.58.2.6.2.32diff_format=u
Index: php-src/ext/standard/streamsfuncs.c
diff -u php-src/ext/standard/streamsfuncs.c:1.58.2.6.2.31 
php-src/ext/standard/streamsfuncs.c:1.58.2.6.2.32
--- php-src/ext/standard/streamsfuncs.c:1.58.2.6.2.31   Thu Jan  8 17:03:42 2009
+++ php-src/ext/standard/streamsfuncs.c Sun Apr 19 14:44:09 2009
@@ -17,7 +17,7 @@
   +--+
 */
 
-/* $Id: streamsfuncs.c,v 1.58.2.6.2.31 2009/01/08 17:03:42 lbarnaud Exp $ */
+/* $Id: streamsfuncs.c,v 1.58.2.6.2.32 2009/04/19 14:44:09 lbarnaud Exp $ */
 
 #include php.h
 #include php_globals.h
@@ -437,6 +437,7 @@
php_stream *src, *dest;
zval *zsrc, *zdest;
long maxlen = PHP_STREAM_COPY_ALL, pos = 0;
+   size_t ret;
 
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, rr|ll, zsrc, 
zdest, maxlen, pos) == FAILURE) {
RETURN_FALSE;
@@ -450,7 +451,12 @@
RETURN_FALSE;
}
 
-   RETURN_LONG(php_stream_copy_to_stream(src, dest, maxlen));
+   ret = php_stream_copy_to_stream_ex(src, dest, maxlen);
+
+   if (ret == PHP_STREAM_FAILURE) {
+   RETURN_FALSE;
+   }
+   RETURN_LONG(ret);
 }
 /* }}} */
 
http://cvs.php.net/viewvc.cgi/php-src/main/php_streams.h?r1=1.103.2.1.2.9r2=1.103.2.1.2.10diff_format=u
Index: php-src/main/php_streams.h
diff -u php-src/main/php_streams.h:1.103.2.1.2.9 
php-src/main/php_streams.h:1.103.2.1.2.10
--- php-src/main/php_streams.h:1.103.2.1.2.9Wed Dec 31 11:17:47 2008
+++ php-src/main/php_streams.h  Sun Apr 19 14:44:09 2009
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: php_streams.h,v 1.103.2.1.2.9 2008/12/31 11:17:47 sebastian Exp $ */
+/* $Id: php_streams.h,v 1.103.2.1.2.10 2009/04/19 14:44:09 lbarnaud Exp $ */
 
 #ifndef PHP_STREAMS_H
 #define PHP_STREAMS_H
@@ -416,9 +416,13 @@
  * Uses mmap if the src is a plain file and at offset 0 */
 #define PHP_STREAM_COPY_ALL((size_t)-1)
 
+#define PHP_STREAM_FAILURE   

[PHP-CVS] cvs: php-src(PHP_5_2) / NEWS /ext/standard file.c flock_compat.h /ext/standard/tests/file userstreams_004.phpt /main/streams userspace.c

2008-11-25 Thread Arnaud Le Blanc
lbarnaudWed Nov 26 04:20:42 2008 UTC

  Added files: (Branch: PHP_5_2)
/php-src/ext/standard/tests/fileuserstreams_004.phpt 

  Modified files:  
/php-src/ext/standard   file.c flock_compat.h 
/php-src/main/streams   userspace.c 
/php-srcNEWS 
  Log:
  MFH: Fixed bug #46673 (stream_lock call with wrong paramater)
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/file.c?r1=1.409.2.6.2.36r2=1.409.2.6.2.37diff_format=u
Index: php-src/ext/standard/file.c
diff -u php-src/ext/standard/file.c:1.409.2.6.2.36 
php-src/ext/standard/file.c:1.409.2.6.2.37
--- php-src/ext/standard/file.c:1.409.2.6.2.36  Sat Nov  1 22:39:14 2008
+++ php-src/ext/standard/file.c Wed Nov 26 04:20:41 2008
@@ -21,7 +21,7 @@
+--+
  */
 
-/* $Id: file.c,v 1.409.2.6.2.36 2008/11/01 22:39:14 jani Exp $ */
+/* $Id: file.c,v 1.409.2.6.2.37 2008/11/26 04:20:41 lbarnaud Exp $ */
 
 /* Synced with php 3.0 revision 1.218 1999-06-16 [ssb] */
 
@@ -195,10 +195,10 @@
REGISTER_LONG_CONSTANT(SEEK_SET, SEEK_SET, CONST_CS | 
CONST_PERSISTENT);
REGISTER_LONG_CONSTANT(SEEK_CUR, SEEK_CUR, CONST_CS | 
CONST_PERSISTENT);
REGISTER_LONG_CONSTANT(SEEK_END, SEEK_END, CONST_CS | 
CONST_PERSISTENT);
-   REGISTER_LONG_CONSTANT(LOCK_SH, 1, CONST_CS | CONST_PERSISTENT);
-   REGISTER_LONG_CONSTANT(LOCK_EX, 2, CONST_CS | CONST_PERSISTENT);
-   REGISTER_LONG_CONSTANT(LOCK_UN, 3, CONST_CS | CONST_PERSISTENT);
-   REGISTER_LONG_CONSTANT(LOCK_NB, 4, CONST_CS | CONST_PERSISTENT);
+   REGISTER_LONG_CONSTANT(LOCK_SH, PHP_LOCK_SH, CONST_CS | 
CONST_PERSISTENT);
+   REGISTER_LONG_CONSTANT(LOCK_EX, PHP_LOCK_EX, CONST_CS | 
CONST_PERSISTENT);
+   REGISTER_LONG_CONSTANT(LOCK_UN, PHP_LOCK_UN, CONST_CS | 
CONST_PERSISTENT);
+   REGISTER_LONG_CONSTANT(LOCK_NB, PHP_LOCK_NB, CONST_CS | 
CONST_PERSISTENT);
 
REGISTER_LONG_CONSTANT(STREAM_NOTIFY_CONNECT, 
PHP_STREAM_NOTIFY_CONNECT,  CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT(STREAM_NOTIFY_AUTH_REQUIRED,   
PHP_STREAM_NOTIFY_AUTH_REQUIRED,CONST_CS | CONST_PERSISTENT);
@@ -347,7 +347,7 @@
}
 
/* flock_values contains all possible actions if (operation  4) we 
won't block on the lock */
-   act = flock_values[act - 1] | (operation  4 ? LOCK_NB : 0);
+   act = flock_values[act - 1] | (operation  PHP_LOCK_NB ? LOCK_NB : 0);
if (php_stream_lock(stream, act)) {
if (operation  errno == EWOULDBLOCK  arg3  
PZVAL_IS_REF(arg3)) {
Z_LVAL_P(arg3) = 1;
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/flock_compat.h?r1=1.20.2.1.2.2r2=1.20.2.1.2.3diff_format=u
Index: php-src/ext/standard/flock_compat.h
diff -u php-src/ext/standard/flock_compat.h:1.20.2.1.2.2 
php-src/ext/standard/flock_compat.h:1.20.2.1.2.3
--- php-src/ext/standard/flock_compat.h:1.20.2.1.2.2Mon Dec 31 07:20:12 2007
+++ php-src/ext/standard/flock_compat.h Wed Nov 26 04:20:41 2008
@@ -16,7 +16,7 @@
+--+
 */
 
-/* $Id: flock_compat.h,v 1.20.2.1.2.2 2007/12/31 07:20:12 sebastian Exp $ */
+/* $Id: flock_compat.h,v 1.20.2.1.2.3 2008/11/26 04:20:41 lbarnaud Exp $ */
 
 #ifndef FLOCK_COMPAT_H
 #define FLOCK_COMPAT_H
@@ -35,6 +35,12 @@
 PHPAPI int flock(int fd, int operation);
 #endif
 
+/* Userland LOCK_* constants */
+#define PHP_LOCK_SH 1
+#define PHP_LOCK_EX 2
+#define PHP_LOCK_UN 3
+#define PHP_LOCK_NB 4
+
 #ifdef PHP_WIN32
 #define EWOULDBLOCK WSAEWOULDBLOCK
 #  define fsync _commit
http://cvs.php.net/viewvc.cgi/php-src/main/streams/userspace.c?r1=1.31.2.3.2.8r2=1.31.2.3.2.9diff_format=u
Index: php-src/main/streams/userspace.c
diff -u php-src/main/streams/userspace.c:1.31.2.3.2.8 
php-src/main/streams/userspace.c:1.31.2.3.2.9
--- php-src/main/streams/userspace.c:1.31.2.3.2.8   Mon Dec 31 07:20:15 2007
+++ php-src/main/streams/userspace.cWed Nov 26 04:20:41 2008
@@ -17,11 +17,15 @@
+--+
 */
 
-/* $Id: userspace.c,v 1.31.2.3.2.8 2007/12/31 07:20:15 sebastian Exp $ */
+/* $Id: userspace.c,v 1.31.2.3.2.9 2008/11/26 04:20:41 lbarnaud Exp $ */
 
 #include php.h
 #include php_globals.h
 #include ext/standard/file.h
+#include ext/standard/flock_compat.h
+#ifdef HAVE_SYS_FILE_H
+#include sys/file.h
+#endif
 
 static int le_protocols;
 
@@ -908,7 +912,23 @@
 
case PHP_STREAM_OPTION_LOCKING:
MAKE_STD_ZVAL(zvalue);
-   ZVAL_LONG(zvalue, value);
+   ZVAL_LONG(zvalue, 0);
+
+   if (value  LOCK_NB) {
+   Z_LVAL_P(zvalue) |= PHP_LOCK_NB;
+   }
+   switch(value  ~LOCK_NB) {
+   case LOCK_SH:
+   Z_LVAL_P(zvalue) |= PHP_LOCK_SH;
+   break;
+

[PHP-CVS] cvs: php-src(PHP_5_2) / NEWS /ext/standard file.c /main/streams plain_wrapper.c

2007-11-12 Thread Ilia Alshanetsky
iliaa   Mon Nov 12 18:47:46 2007 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/main/streams   plain_wrapper.c 
/php-src/ext/standard   file.c 
/php-srcNEWS 
  Log:
  
  Fixed bug #43182 (file_put_contents() LOCK_EX does not work properly on 
  file 
  
http://cvs.php.net/viewvc.cgi/php-src/main/streams/plain_wrapper.c?r1=1.52.2.6.2.25r2=1.52.2.6.2.26diff_format=u
Index: php-src/main/streams/plain_wrapper.c
diff -u php-src/main/streams/plain_wrapper.c:1.52.2.6.2.25 
php-src/main/streams/plain_wrapper.c:1.52.2.6.2.26
--- php-src/main/streams/plain_wrapper.c:1.52.2.6.2.25  Thu Nov  1 17:32:26 2007
+++ php-src/main/streams/plain_wrapper.cMon Nov 12 18:47:46 2007
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: plain_wrapper.c,v 1.52.2.6.2.25 2007/11/01 17:32:26 jani Exp $ */
+/* $Id: plain_wrapper.c,v 1.52.2.6.2.26 2007/11/12 18:47:46 iliaa Exp $ */
 
 #include php.h
 #include php_globals.h
@@ -63,6 +63,9 @@
case 'x':
flags = O_CREAT|O_EXCL;
break;
+   case 'c':
+   flags = O_CREAT;
+   break;
default:
/* unknown mode */
return FAILURE;
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/file.c?r1=1.409.2.6.2.28r2=1.409.2.6.2.29diff_format=u
Index: php-src/ext/standard/file.c
diff -u php-src/ext/standard/file.c:1.409.2.6.2.28 
php-src/ext/standard/file.c:1.409.2.6.2.29
--- php-src/ext/standard/file.c:1.409.2.6.2.28  Tue Sep  4 12:51:49 2007
+++ php-src/ext/standard/file.c Mon Nov 12 18:47:46 2007
@@ -21,7 +21,7 @@
+--+
  */
 
-/* $Id: file.c,v 1.409.2.6.2.28 2007/09/04 12:51:49 iliaa Exp $ */
+/* $Id: file.c,v 1.409.2.6.2.29 2007/11/12 18:47:46 iliaa Exp $ */
 
 /* Synced with php 3.0 revision 1.218 1999-06-16 [ssb] */
 
@@ -592,6 +592,7 @@
zval *zcontext = NULL;
php_stream_context *context = NULL;
php_stream *srcstream = NULL;
+   char mode[3] = wb;

if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, sz/|lr!, 
filename, filename_len, 
data, flags, zcontext) == FAILURE) {
@@ -604,8 +605,14 @@
 
context = php_stream_context_from_zval(zcontext, flags  
PHP_FILE_NO_DEFAULT_CONTEXT);
 
-   stream = php_stream_open_wrapper_ex(filename, (flags  PHP_FILE_APPEND) 
? ab : wb, 
-   ((flags  PHP_FILE_USE_INCLUDE_PATH) ? USE_PATH : 0) | 
ENFORCE_SAFE_MODE | REPORT_ERRORS, NULL, context);
+   if (flags  PHP_FILE_APPEND) {
+   mode[0] = 'a';
+   } else if (flags  LOCK_EX) {
+   mode[0] = 'c';
+   }
+   mode[2] = '\0';
+
+   stream = php_stream_open_wrapper_ex(filename, mode, ((flags  
PHP_FILE_USE_INCLUDE_PATH) ? USE_PATH : 0) | ENFORCE_SAFE_MODE | REPORT_ERRORS, 
NULL, context);
if (stream == NULL) {
RETURN_FALSE;
}
@@ -615,6 +622,10 @@
RETURN_FALSE;
}
 
+   if (mode[0] = 'c') {
+   php_stream_truncate_set_size(stream, 0);
+   }
+
switch (Z_TYPE_P(data)) {
case IS_RESOURCE:
numbytes = php_stream_copy_to_stream(srcstream, stream, 
PHP_STREAM_COPY_ALL);
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.1005r2=1.2027.2.547.2.1006diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.1005 php-src/NEWS:1.2027.2.547.2.1006
--- php-src/NEWS:1.2027.2.547.2.1005Mon Nov 12 11:24:13 2007
+++ php-src/NEWSMon Nov 12 18:47:46 2007
@@ -3,6 +3,8 @@
 ?? ??? 2008, PHP 5.2.6
 - Fixed bug #43216 (stream_is_local() returns false on file://). (Dmitry)
 - Fixed bug #43201 (Crash on using unitialized vals and __get/__set). (Dmitry)
+- Fixed bug #43182 (file_put_contents() LOCK_EX does not work properly on file 
+  truncation). (Ilia)
 - Fixed bug #43175 (__destruct() throwing an exception with __call() causes
   segfault). (Dmitry)
 - Fixed bug #42937 (__call() method not invoked when methods are called on

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

2007-09-02 Thread Ilia Alshanetsky
iliaa   Mon Sep  3 02:53:56 2007 UTC

  Modified files:  (Branch: PHP_5_2)
/php-srcNEWS 
/php-src/ext/standard   file.c 
  Log:
  
  Fixed bug #42468 (Write lock on file_get_contents fails when using a 
  compression stream).
  
  
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.923r2=1.2027.2.547.2.924diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.923 php-src/NEWS:1.2027.2.547.2.924
--- php-src/NEWS:1.2027.2.547.2.923 Sat Sep  1 18:38:38 2007
+++ php-src/NEWSMon Sep  3 02:53:56 2007
@@ -1,8 +1,8 @@
 PHPNEWS
 |||
 ?? ??? 20??, PHP 5.2.5
-- Added optional parameter $provide_object to debug_backtrace(). (Sebastian)
 - Upgraded PCRE to version 7.3 (Nuno)
+- Added optional parameter $provide_object to debug_backtrace(). (Sebastian)
 
 - Fixed bug #42512 (ip2long('255.255.255.255') should return 4294967295 on
   64-bit PHP). (Derick)
@@ -12,6 +12,8 @@
   options). (Dmitry)
 - Fixed bug #42452 (PDO classes do not expose Reflection API information).
   (Hannes)
+- Fixed bug #42468 (Write lock on file_get_contents fails when using a 
+  compression stream). (Ilia)
 - Fixed bug #42359 (xsd:list type not parsed). (Dmitry)
 - Fixed bug #42326 (SoapServer crash). (Dmitry)
 - Fixed bug #42086 (SoapServer return Procedure '' not present for WSIBasic
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/file.c?r1=1.409.2.6.2.26r2=1.409.2.6.2.27diff_format=u
Index: php-src/ext/standard/file.c
diff -u php-src/ext/standard/file.c:1.409.2.6.2.26 
php-src/ext/standard/file.c:1.409.2.6.2.27
--- php-src/ext/standard/file.c:1.409.2.6.2.26  Sun Aug 12 17:09:59 2007
+++ php-src/ext/standard/file.c Mon Sep  3 02:53:56 2007
@@ -21,7 +21,7 @@
+--+
  */
 
-/* $Id: file.c,v 1.409.2.6.2.26 2007/08/12 17:09:59 iliaa Exp $ */
+/* $Id: file.c,v 1.409.2.6.2.27 2007/09/03 02:53:56 iliaa Exp $ */
 
 /* Synced with php 3.0 revision 1.218 1999-06-16 [ssb] */
 
@@ -610,7 +610,7 @@
RETURN_FALSE;
}
 
-   if (flags  LOCK_EX  php_stream_lock(stream, LOCK_EX)) {
+   if (flags  LOCK_EX  (!php_stream_supports_lock(stream) || 
php_stream_lock(stream, LOCK_EX))) {
php_stream_close(stream);
RETURN_FALSE;
}

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

2007-08-09 Thread Ilia Alshanetsky
iliaa   Fri Aug 10 00:36:57 2007 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/standard   file.c 
/php-srcNEWS 
  Log:
  
  Fixed bug #42243 (copy() does not ouput an error when the first arg is a
  dir). 
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/file.c?r1=1.409.2.6.2.22r2=1.409.2.6.2.23diff_format=u
Index: php-src/ext/standard/file.c
diff -u php-src/ext/standard/file.c:1.409.2.6.2.22 
php-src/ext/standard/file.c:1.409.2.6.2.23
--- php-src/ext/standard/file.c:1.409.2.6.2.22  Wed Aug  8 22:32:24 2007
+++ php-src/ext/standard/file.c Fri Aug 10 00:36:57 2007
@@ -21,7 +21,7 @@
+--+
  */
 
-/* $Id: file.c,v 1.409.2.6.2.22 2007/08/08 22:32:24 tony2001 Exp $ */
+/* $Id: file.c,v 1.409.2.6.2.23 2007/08/10 00:36:57 iliaa Exp $ */
 
 /* Synced with php 3.0 revision 1.218 1999-06-16 [ssb] */
 
@@ -1765,6 +1765,10 @@
if (php_stream_stat_path_ex(dest, PHP_STREAM_URL_STAT_QUIET, dest_s, 
NULL) != 0) {
goto safe_to_copy;
}
+   if (S_ISDIR(src_s.sb.st_mode)) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, The first argument 
to copy() function cannot be a directory.);
+   return FAILURE;
+   }
if (!src_s.sb.st_ino || !dest_s.sb.st_ino) {
goto no_stat;
}
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.890r2=1.2027.2.547.2.891diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.890 php-src/NEWS:1.2027.2.547.2.891
--- php-src/NEWS:1.2027.2.547.2.890 Fri Aug 10 00:30:04 2007
+++ php-src/NEWSFri Aug 10 00:36:57 2007
@@ -4,6 +4,8 @@
 - Fixed bug #42261 (header wrong for date field). (roberto at spadim dot com
   dot br, Ilia)
 - Fixed bug #42247 (ldap_parse_result() not defined under win32). (Jani)
+- Fixed bug #42243 (copy() does not ouput an error when the first arg is a
+  dir). (Ilia)
 - Fixed bug #42237 (stream_copy_to_stream returns invalid values for mmaped 
   streams). (andrew dot minerd at sellingsource dot com, Ilia)
 - Fixed bug #42233 (Problems with æøå in extract()). (Jani)

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

2007-07-01 Thread Jani Taskinen
sniper  Sun Jul  1 21:28:17 2007 UTC

  Modified files:  (Branch: PHP_5_2)
/php-srcNEWS 
/php-src/ext/standard   file.c 
  Log:
  MFH: - Fixed bug #41865 (fputcsv(): 2nd parameter is not optional)
  
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.807r2=1.2027.2.547.2.808diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.807 php-src/NEWS:1.2027.2.547.2.808
--- php-src/NEWS:1.2027.2.547.2.807 Thu Jun 28 03:13:29 2007
+++ php-src/NEWSSun Jul  1 21:28:16 2007
@@ -39,6 +39,7 @@
 - Fixed PECL bug #11216 (crash in ZipArchive::addEmptyDir when a directory 
   already exists). (Pierre)
 
+- Fixed bug #41865 (fputcsv(): 2nd parameter is not optional). (Jani)
 - Fixed bug #41813 (segmentation fault when using string offset as an object).
   (judas dot iscariote at gmail dot com, Tony)
 - Fixed bug #41795 (checkdnsrr does not support DNS_TXT type). 
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/file.c?r1=1.409.2.6.2.20r2=1.409.2.6.2.21diff_format=u
Index: php-src/ext/standard/file.c
diff -u php-src/ext/standard/file.c:1.409.2.6.2.20 
php-src/ext/standard/file.c:1.409.2.6.2.21
--- php-src/ext/standard/file.c:1.409.2.6.2.20  Sun May 27 17:33:39 2007
+++ php-src/ext/standard/file.c Sun Jul  1 21:28:16 2007
@@ -21,7 +21,7 @@
+--+
  */
 
-/* $Id: file.c,v 1.409.2.6.2.20 2007/05/27 17:33:39 iliaa Exp $ */
+/* $Id: file.c,v 1.409.2.6.2.21 2007/07/01 21:28:16 sniper Exp $ */
 
 /* Synced with php 3.0 revision 1.218 1999-06-16 [ssb] */
 
@@ -1914,7 +1914,7 @@
int count, i = 0;
smart_str csvline = {0};
 
-   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, r|ass,
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, ra|ss,
fp, fields, delimiter_str, delimiter_str_len,
enclosure_str, enclosure_str_len) == FAILURE) {
return;

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

2007-05-27 Thread Ilia Alshanetsky
iliaa   Sun May 27 17:33:39 2007 UTC

  Modified files:  (Branch: PHP_5_2)
/php-srcNEWS 
/php-src/ext/standard   file.c 
  Log:
  Fixed bug #41492 (open_basedir/safe_mode bypass inside realpath()). 
  
  
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.739r2=1.2027.2.547.2.740diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.739 php-src/NEWS:1.2027.2.547.2.740
--- php-src/NEWS:1.2027.2.547.2.739 Sun May 27 17:05:50 2007
+++ php-src/NEWSSun May 27 17:33:39 2007
@@ -2,6 +2,7 @@
 |||
 ?? Jun 2007, PHP 5.2.3
 - Fixed bug #41511 (Compile failure under IRIX 6.5.30 building md5.c). (Jani)
+- Fixed bug #41492 (open_basedir/safe_mode bypass inside realpath()). (Ilia)
 - Fixed bug #41504 (json_decode() incorrectly decodes JSON arrays with empty
   string keys). (Ilia)
 - Fixed bug #41236 (Regression in timeout handling of non-blocking SSL
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/file.c?r1=1.409.2.6.2.19r2=1.409.2.6.2.20diff_format=u
Index: php-src/ext/standard/file.c
diff -u php-src/ext/standard/file.c:1.409.2.6.2.19 
php-src/ext/standard/file.c:1.409.2.6.2.20
--- php-src/ext/standard/file.c:1.409.2.6.2.19  Fri May 18 20:34:13 2007
+++ php-src/ext/standard/file.c Sun May 27 17:33:39 2007
@@ -21,7 +21,7 @@
+--+
  */
 
-/* $Id: file.c,v 1.409.2.6.2.19 2007/05/18 20:34:13 tony2001 Exp $ */
+/* $Id: file.c,v 1.409.2.6.2.20 2007/05/27 17:33:39 iliaa Exp $ */
 
 /* Synced with php 3.0 revision 1.218 1999-06-16 [ssb] */
 
@@ -2371,6 +2371,14 @@
convert_to_string_ex(path);
 
if (VCWD_REALPATH(Z_STRVAL_PP(path), resolved_path_buff)) {
+   if (PG(safe_mode)  (!php_checkuid(resolved_path_buff, NULL, 
CHECKUID_CHECK_FILE_AND_DIR))) {
+   RETURN_FALSE;
+   }
+
+   if (php_check_open_basedir(resolved_path_buff TSRMLS_CC)) {
+   RETURN_FALSE;
+   }
+
 #ifdef ZTS
if (VCWD_ACCESS(resolved_path_buff, F_OK)) {
RETURN_FALSE;

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

2007-05-18 Thread Antony Dovgal
tony2001Fri May 18 12:06:44 2007 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/standard   file.c 
/php-srcNEWS 
  Log:
  MFH: fix #41430 (Fatal error with negative values of maxlen parameter of 
file_get_contents())
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/file.c?r1=1.409.2.6.2.17r2=1.409.2.6.2.18diff_format=u
Index: php-src/ext/standard/file.c
diff -u php-src/ext/standard/file.c:1.409.2.6.2.17 
php-src/ext/standard/file.c:1.409.2.6.2.18
--- php-src/ext/standard/file.c:1.409.2.6.2.17  Fri Feb 23 16:22:20 2007
+++ php-src/ext/standard/file.c Fri May 18 12:06:44 2007
@@ -21,7 +21,7 @@
+--+
  */
 
-/* $Id: file.c,v 1.409.2.6.2.17 2007/02/23 16:22:20 tony2001 Exp $ */
+/* $Id: file.c,v 1.409.2.6.2.18 2007/05/18 12:06:44 tony2001 Exp $ */
 
 /* Synced with php 3.0 revision 1.218 1999-06-16 [ssb] */
 
@@ -545,6 +545,11 @@
RETURN_FALSE;
}
 
+   if (maxlen  0) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, Length must be 
greater than or equal to zero);
+   RETURN_FALSE;
+   }
+
if (offset  0  php_stream_seek(stream, offset, SEEK_SET)  0) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, Failed to seek to 
position %ld in the stream, offset);
php_stream_close(stream);
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.716r2=1.2027.2.547.2.717diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.716 php-src/NEWS:1.2027.2.547.2.717
--- php-src/NEWS:1.2027.2.547.2.716 Fri May 18 11:52:47 2007
+++ php-src/NEWSFri May 18 12:06:44 2007
@@ -17,6 +17,8 @@
 - Fixed altering $this via argument named this. (Dmitry)
 - Fixed PHP CLI to use the php.ini from the binary location. (Hannes)
 - Fixed segfault in strripos(). (Tony, Joxean Koret)
+- Fixed bug #41430 (Fatal error with negative values of maxlen parameter of 
+  file_get_contents()). (Tony)
 - Fixed bug #41421 (Uncaught exception from a stream wrapper segfaults). 
   (Tony, Dmitry)
 - Fixed bug #41403 (json_decode cannot decode floats if localeconv 

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

2007-02-23 Thread Antony Dovgal
tony2001Fri Feb 23 16:22:20 2007 UTC

  Modified files:  (Branch: PHP_5_2)
/php-srcNEWS 
/php-src/ext/standard   file.c 
  Log:
  MFH: fix #40606 (umask is not being restored when request is finished)
  
  
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.558r2=1.2027.2.547.2.559diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.558 php-src/NEWS:1.2027.2.547.2.559
--- php-src/NEWS:1.2027.2.547.2.558 Fri Feb 23 11:15:08 2007
+++ php-src/NEWSFri Feb 23 16:22:19 2007
@@ -9,6 +9,8 @@
 - Added --ri switch to CLI which allows to check extension information. 
(Marcus)
 - Added tidyNode::getParent() method (John, Nuno)
 - Fixed zend_llist_remove_tail (Michael Wallner, Dmitry)
+- Fixed bug #40606 (umask is not being restored when request is finished). 
+  (Tony)
 - Fixed bug #40598 (libxml segfault). (Rob)
 - Fixed bug #40578 (imagettftext() multithreading issue). (Tony, Pierre)
 - Fixed bug #40576 (double values are truncated to 6 decimal digits when 
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/file.c?r1=1.409.2.6.2.16r2=1.409.2.6.2.17diff_format=u
Index: php-src/ext/standard/file.c
diff -u php-src/ext/standard/file.c:1.409.2.6.2.16 
php-src/ext/standard/file.c:1.409.2.6.2.17
--- php-src/ext/standard/file.c:1.409.2.6.2.16  Tue Feb 13 12:56:36 2007
+++ php-src/ext/standard/file.c Fri Feb 23 16:22:20 2007
@@ -21,7 +21,7 @@
+--+
  */
 
-/* $Id: file.c,v 1.409.2.6.2.16 2007/02/13 12:56:36 tony2001 Exp $ */
+/* $Id: file.c,v 1.409.2.6.2.17 2007/02/23 16:22:20 tony2001 Exp $ */
 
 /* Synced with php 3.0 revision 1.218 1999-06-16 [ssb] */
 
@@ -1488,7 +1488,7 @@
 
oldumask = umask(077);
 
-   if (BG(umask) != -1) {
+   if (BG(umask) == -1) {
BG(umask) = oldumask;
}
 

-- 
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) / NEWS /ext/standard file.c /ext/standard/tests/file bug39538.phpt

2006-11-22 Thread Pierre-Alain Joye
pajoye  Wed Nov 22 12:59:49 2006 UTC

  Added files: (Branch: PHP_5_2)
/php-src/ext/standard/tests/filebug39538.phpt 

  Modified files:  
/php-srcNEWS 
/php-src/ext/standard   file.c 
  Log:
  - MFH:  #39538, fgetcsv can't handle starting newlines and trailing odd
number of backslashes (David Soria Parra, Pierre)
  
  
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.369r2=1.2027.2.547.2.370diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.369 php-src/NEWS:1.2027.2.547.2.370
--- php-src/NEWS:1.2027.2.547.2.369 Wed Nov 22 10:42:41 2006
+++ php-src/NEWSWed Nov 22 12:59:48 2006
@@ -42,6 +42,8 @@
 - Fixed wrong signature initialization in imagepng (Takeshi Abe)
 - Added optimization for imageline with horizontal and vertial lines (Pierre)
 - Fixed bug #39576 (array_walk() doesn't separate userdata zval). (Tony)
+- Fixed bug #39538 (fgetcsv can't handle starting newlines and trailing odd
+  number of backslashes). (David Soria Parra, Pierre)
 - Fixed bug #39454 (Returning a SOAP array segfaults PHP). (Dmitry)
 - Fixed bug #39445 (Calling debug_backtrace() in the __toString() function
   produces a crash). (Dmitry)
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/file.c?r1=1.409.2.6.2.11r2=1.409.2.6.2.12diff_format=u
Index: php-src/ext/standard/file.c
diff -u php-src/ext/standard/file.c:1.409.2.6.2.11 
php-src/ext/standard/file.c:1.409.2.6.2.12
--- php-src/ext/standard/file.c:1.409.2.6.2.11  Mon Nov 20 11:12:42 2006
+++ php-src/ext/standard/file.c Wed Nov 22 12:59:49 2006
@@ -21,7 +21,7 @@
+--+
  */
 
-/* $Id: file.c,v 1.409.2.6.2.11 2006/11/20 11:12:42 tony2001 Exp $ */
+/* $Id: file.c,v 1.409.2.6.2.12 2006/11/22 12:59:49 pajoye Exp $ */
 
 /* Synced with php 3.0 revision 1.218 1999-06-16 [ssb] */
 
@@ -2171,9 +2171,11 @@
size_t new_len;
char *new_temp;
 
-   memcpy(tptr, 
hunk_begin, bptr - hunk_begin);
-   tptr += (bptr - 
hunk_begin);
-   hunk_begin = 
bptr;
+   if (hunk_begin 
!= line_end) {
+   
memcpy(tptr, hunk_begin, bptr - hunk_begin);
+   tptr += 
(bptr - hunk_begin);
+   
hunk_begin = bptr;
+   }
 
/* add the 
embedded line end to the field */
memcpy(tptr, 
line_end, line_end_len);

http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/file/bug39538.phpt?view=markuprev=1.1
Index: php-src/ext/standard/tests/file/bug39538.phpt
+++ php-src/ext/standard/tests/file/bug39538.phpt
--TEST--
bug 39538
--FILE--
?php
$content = array(\\nthis is an test\, \next data\, 
\p\narsed\,\\r\nthis is an test\, \next data\, 
\p\r\narsed\,\\n\rthis is an test\, \next data\, \p\n\rarsed\);

$file = dirname(__FILE__) . /bug39538.csv;
@unlink($file);
foreach ($content as $v) {
file_put_contents($file, $v);
print_r (fgetcsv(fopen($file, r), filesize($file)));
}
@unlink($file);
--EXPECT--
Array
(
[0] = 
this is an test
[1] = next data
[2] = p
arsed
)
Array
(
[0] = 
this is an test
[1] = next data
[2] = p
arsed
)
Array
(
[0] = 
this is an test
[1] = next data
[2] = p
arsed
)



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

2006-11-14 Thread Ilia Alshanetsky
iliaa   Wed Nov 15 00:20:40 2006 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/standard   file.c 
/php-srcNEWS 
  Log:
  Added missing object support to file_put_contents(). 
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/file.c?r1=1.409.2.6.2.9r2=1.409.2.6.2.10diff_format=u
Index: php-src/ext/standard/file.c
diff -u php-src/ext/standard/file.c:1.409.2.6.2.9 
php-src/ext/standard/file.c:1.409.2.6.2.10
--- php-src/ext/standard/file.c:1.409.2.6.2.9   Mon Nov 13 20:31:27 2006
+++ php-src/ext/standard/file.c Wed Nov 15 00:20:40 2006
@@ -21,7 +21,7 @@
+--+
  */
 
-/* $Id: file.c,v 1.409.2.6.2.9 2006/11/13 20:31:27 tony2001 Exp $ */
+/* $Id: file.c,v 1.409.2.6.2.10 2006/11/15 00:20:40 iliaa Exp $ */
 
 /* Synced with php 3.0 revision 1.218 1999-06-16 [ssb] */
 
@@ -653,11 +653,23 @@
}
break;
 
+   case IS_OBJECT:
+   if (Z_OBJ_HT_P(data) != NULL) {
+   zval out;
+
+   if (zend_std_cast_object_tostring(data, out, 
IS_STRING TSRMLS_CC) == SUCCESS) {
+   numbytes = php_stream_write(stream, 
Z_STRVAL(out), Z_STRLEN(out));
+   if (numbytes != Z_STRLEN(out)) {
+   php_error_docref(NULL 
TSRMLS_CC, E_WARNING, Only %d of %d bytes written, possibly out of free disk 
space, numbytes, Z_STRLEN(out));
+   numbytes = -1;
+   }
+   zval_dtor(out);
+   break;
+   }
+   }
default:
-   php_error_docref(NULL TSRMLS_CC, E_WARNING, The 2nd 
parameter should be either a string or an array);
-   numbytes = -1;
+   numbytes = -1;  
break;
-   
}
php_stream_close(stream);
 
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.362r2=1.2027.2.547.2.363diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.362 php-src/NEWS:1.2027.2.547.2.363
--- php-src/NEWS:1.2027.2.547.2.362 Tue Nov 14 19:59:31 2006
+++ php-src/NEWSWed Nov 15 00:20:40 2006
@@ -1,6 +1,7 @@
 PHPNEWS
 |||
 ?? ??? 2007, PHP 5.2.1
+- Added missing object support to file_put_contents(). (Ilia)
 - Updated bundled libcURL to version 7.16.0 in the Windows distro. (Edin)
 - cgi.* and fastcgi.* directives are moved to INI subsystem.
   The new directive cgi.check_shebang_line can be used to ommiting checnk

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