[PHP-CVS] cvs: php-src(PHP_5_2) /ext/zip/tests oo_getcomment.phpt

2006-11-15 Thread Pierre-Alain Joye
pajoye  Wed Nov 15 23:53:46 2006 UTC

  Added files: (Branch: PHP_5_2)
/php-src/ext/zip/tests  oo_getcomment.phpt 
  Log:
  - mv oo_get_comment.phpt oo_getcomment.phpt
  
  

http://cvs.php.net/viewvc.cgi/php-src/ext/zip/tests/oo_getcomment.phpt?view=markup&rev=1.1
Index: php-src/ext/zip/tests/oo_getcomment.phpt
+++ php-src/ext/zip/tests/oo_getcomment.phpt
--TEST--
getComment
--SKIPIF--

--FILE--
open($file)) {
exit('failed');
}
echo $zip->getArchiveComment() . "\n";

$idx = $zip->locateName('foo');
echo $zip->getCommentName('foo') . "\n";
echo $zip->getCommentIndex($idx);

echo $zip->getCommentName('') . "\n";
echo $zip->getCommentName() . "\n";

$zip->close();

?>
--EXPECTF--
Zip archive comment
foo comment
foo comment
Notice: ZipArchive::getCommentName(): Empty string as entry name in %s on line 
%d


Warning: ZipArchive::getCommentName() expects at least 1 parameter, 0 given in 
%s on line %d

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

2006-11-15 Thread Pierre-Alain Joye
pajoye  Wed Nov 15 23:28:06 2006 UTC

  Modified files:  (Branch: PHP_5_2)
/php-srcNEWS 
/php-src/ext/opensslopenssl.c 
  Log:
  - MFH: #39217, serialNumber might be -1 when the value is too big
  
  
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.365&r2=1.2027.2.547.2.366&diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.365 php-src/NEWS:1.2027.2.547.2.366
--- php-src/NEWS:1.2027.2.547.2.365 Wed Nov 15 18:34:56 2006
+++ php-src/NEWSWed Nov 15 23:28:05 2006
@@ -65,6 +65,8 @@
   of overloaded array). (Dmitry)
 - Fixed bug #39265 (Fixed path handling inside mod_files.sh). 
   (michal dot taborsky at gmail dot com, Ilia)
+- Fixed bug #39217 (serialNumber might be -1 when the value is too large)
+  (Pierre, Tony)
 - Fixed bug #39215 (Inappropriate close of stdin/stdout/stderr). (Wez,Ilia)
 - Fixed bug #39151 (Parse error in recursiveiteratoriterator.php). (Marcus)
 - Fixed bug #39121 (Incorrect return array handling in non-wsdl soap client).
http://cvs.php.net/viewvc.cgi/php-src/ext/openssl/openssl.c?r1=1.98.2.5.2.23&r2=1.98.2.5.2.24&diff_format=u
Index: php-src/ext/openssl/openssl.c
diff -u php-src/ext/openssl/openssl.c:1.98.2.5.2.23 
php-src/ext/openssl/openssl.c:1.98.2.5.2.24
--- php-src/ext/openssl/openssl.c:1.98.2.5.2.23 Sun Oct 15 21:09:24 2006
+++ php-src/ext/openssl/openssl.c   Wed Nov 15 23:28:06 2006
@@ -18,7 +18,7 @@
+--+
  */
 
-/* $Id: openssl.c,v 1.98.2.5.2.23 2006/10/15 21:09:24 tony2001 Exp $ */
+/* $Id: openssl.c,v 1.98.2.5.2.24 2006/11/15 23:28:06 pajoye Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -1003,7 +1003,8 @@

add_assoc_name_entry(return_value, "issuer",
X509_get_issuer_name(cert), useshortnames TSRMLS_CC);
add_assoc_long(return_value, "version", 
X509_get_version(cert));
-   add_assoc_long(return_value, "serialNumber",
ASN1_INTEGER_get(X509_get_serialNumber(cert)));
+
+   add_assoc_string(return_value, "serialNumber", i2s_ASN1_INTEGER(NULL, 
X509_get_serialNumber(cert)), 1); 
 
add_assoc_asn1_string(return_value, "validFrom",
X509_get_notBefore(cert));
add_assoc_asn1_string(return_value, "validTo",  
X509_get_notAfter(cert));

-- 
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_2) /ext/date/lib parse_tz.c

2006-11-15 Thread Nuno Lopes

On Fri, 10 Nov 2006, Nuno Lopes wrote:


nlopess Fri Nov 10 23:27:11 2006 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/date/lib parse_tz.c
  Log:
  fix the bug I introduced previously, sorry
  anyway, convert the recursive version of the binary search to an 
iterative one


I'd appreciate if you pass this sorta things by me first.

regards,
Derick


OK, sure. I'll ping you next time.
Nuno 


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



[PHP-CVS] cvs: php-src /ext/mcrypt mcrypt.c php_mcrypt.h /ext/mcrypt/tests basic.phpt blowfish.phpt bug35496.phpt bug37595.phpt

2006-11-15 Thread Michael Wallner
mikeWed Nov 15 22:51:45 2006 UTC

  Added files: 
/php-src/ext/mcrypt/tests   basic.phpt 

  Modified files:  
/php-src/ext/mcrypt mcrypt.c php_mcrypt.h 
/php-src/ext/mcrypt/tests   blowfish.phpt bug35496.phpt bug37595.phpt 
  Log:
  - unicode upgrade
  - fix typo: ENIGNA->ENIGMA
  - add and fix tests
  
  http://cvs.php.net/viewvc.cgi/php-src/ext/mcrypt/mcrypt.c?r1=1.100&r2=1.101&diff_format=u
Index: php-src/ext/mcrypt/mcrypt.c
diff -u php-src/ext/mcrypt/mcrypt.c:1.100 php-src/ext/mcrypt/mcrypt.c:1.101
--- php-src/ext/mcrypt/mcrypt.c:1.100   Sun Oct  8 13:34:22 2006
+++ php-src/ext/mcrypt/mcrypt.c Wed Nov 15 22:51:45 2006
@@ -16,7 +16,7 @@
|  Derick Rethans <[EMAIL PROTECTED]>|
+--+
  */
-/* $Id: mcrypt.c,v 1.100 2006/10/08 13:34:22 bjori Exp $ */
+/* $Id: mcrypt.c,v 1.101 2006/11/15 22:51:45 mike Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -114,122 +114,41 @@
 ZEND_GET_MODULE(mcrypt)
 #endif
 
-#define MCRYPT_ARGS2   
\
-   zval **cipher, **data, **key, **mode;   
\
-   int td; 
\
-   char *ndata;
\
-   size_t bsize;   
\
-   size_t nr;  
\
-   size_t nsize
-
-#define MCRYPT_ARGS
\
-   MCRYPT_ARGS2;   
\
-   zval **iv
-
-#define MCRYPT_CONVERT 
\
-   convert_to_string_ex(cipher);   
\
-   convert_to_string_ex(mode); 
\
-   convert_to_string_ex(data); 
\
-   convert_to_string_ex(key)
-#define MCRYPT_CONVERT_WO_MODE 
\
-   convert_to_string_ex(cipher);   
\
-   convert_to_string_ex(data); 
\
-   convert_to_string_ex(key)
-
-#define MCRYPT_SIZE
\
-   bsize = mcrypt_get_block_size(Z_LVAL_PP(cipher));   \
-   nr = (Z_STRLEN_PP(data) + bsize - 1) / bsize;   \
-   nsize = nr * bsize
-
-#define MCRYPT_CHECK_TD_CPY
\
-   if (td < 0) {   
\
-   php_error_docref(NULL TSRMLS_CC, E_WARNING, MCRYPT_FAILED); 
\
-   RETURN_FALSE;   
\
-   }   
\
-   ndata = ecalloc(nr, bsize); 
\
-   memcpy(ndata, Z_STRVAL_PP(data), Z_STRLEN_PP(data))
-
-#define MCRYPT_CHECK_IV
\
-   convert_to_string_ex(iv);   
\
-   if (Z_STRLEN_PP(iv) != bsize) { 
\
-   php_error_docref(NULL TSRMLS_CC, E_WARNING, 
MCRYPT_IV_WRONG_SIZE);  \
-   RETURN_FALSE;   
\
-   }
-
-#define MCRYPT_ACTION(x)   
\
-   if (Z_LVAL_PP(mode) == 0) { 
\
-   mcrypt_##x(td, ndata, nsize);   
\
-   } else {
\
-   mdecrypt_##x(td, ndata, nsize); 
\
-   }   

[PHP-CVS] cvs: php-src(PHP_5_2) /ext/standard/tests/array array_flip.phpt array_key_exists.phpt array_pad.phpt array_rand.phpt array_unshift.phpt array_values.phpt compact.phpt /ext/standard/tests/fi

2006-11-15 Thread Antony Dovgal
tony2001Wed Nov 15 22:44:29 2006 UTC

  Added files: (Branch: PHP_5_2)
/php-src/ext/standard/tests/array   array_key_exists.phpt 
array_rand.phpt 
array_unshift.phpt 
array_values.phpt compact.phpt 
/php-src/ext/standard/tests/filestatpage.phpt 

  Modified files:  
/php-src/ext/standard/tests/array   array_flip.phpt array_pad.phpt 
  Log:
  add new tests, improve existing ones
  
  http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/array/array_flip.phpt?r1=1.1.2.2&r2=1.1.2.3&diff_format=u
Index: php-src/ext/standard/tests/array/array_flip.phpt
diff -u php-src/ext/standard/tests/array/array_flip.phpt:1.1.2.2 
php-src/ext/standard/tests/array/array_flip.phpt:1.1.2.3
--- php-src/ext/standard/tests/array/array_flip.phpt:1.1.2.2Tue Jul 11 
21:28:38 2006
+++ php-src/ext/standard/tests/array/array_flip.phptWed Nov 15 22:44:29 2006
@@ -14,6 +14,13 @@
2 => "i");
 $trans = array_flip($trans);
 var_dump($trans);
+
+var_dump(array_flip());
+var_dump(array_flip(array()));
+var_dump(array_flip(array(1)));
+var_dump(array_flip(array(array(;
+
+echo "Done\n";
 ?>
 --EXPECTF--
 Warning: array_flip(): Can only flip STRING and INTEGER values! in %s on line 
%d
@@ -35,3 +42,17 @@
   ["i"]=>
   int(2)
 }
+
+Warning: Wrong parameter count for array_flip() in %s on line %d
+NULL
+array(0) {
+}
+array(1) {
+  [1]=>
+  int(0)
+}
+
+Warning: array_flip(): Can only flip STRING and INTEGER values! in %s on line 
%d
+array(0) {
+}
+Done
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/array/array_pad.phpt?r1=1.1.2.2&r2=1.1.2.3&diff_format=u
Index: php-src/ext/standard/tests/array/array_pad.phpt
diff -u php-src/ext/standard/tests/array/array_pad.phpt:1.1.2.2 
php-src/ext/standard/tests/array/array_pad.phpt:1.1.2.3
--- php-src/ext/standard/tests/array/array_pad.phpt:1.1.2.2 Wed Nov 15 
22:10:19 2006
+++ php-src/ext/standard/tests/array/array_pad.phpt Wed Nov 15 22:44:29 2006
@@ -16,6 +16,7 @@
 var_dump(array_pad(array("", -1, 2.0), -3, array()));
 var_dump(array_pad(array("", -1, 2.0), -4, array()));
 var_dump(array_pad(array("", -1, 2.0), 200, 0));
+var_dump(array_pad("", 200, 0));
 
 echo "Done\n";
 ?>
@@ -94,4 +95,7 @@
 
 Warning: array_pad(): You may only pad up to 1048576 elements at a time in %s 
on line %d
 bool(false)
+
+Warning: array_pad(): The argument should be an array in %s on line %d
+NULL
 Done

http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/array/array_key_exists.phpt?view=markup&rev=1.1
Index: php-src/ext/standard/tests/array/array_key_exists.phpt
+++ php-src/ext/standard/tests/array/array_key_exists.phpt
--TEST--
array_key_exists() tests
--FILE--
1)));
var_dump(array_key_exists("a", array(3,2,1)));
var_dump(array_key_exists(NULL, array(5,6,7,""=>"value", 3,2,1)));
var_dump(array_key_exists(NULL, array(5,6,7,3,2,1)));
var_dump(array_key_exists(false, array(5,6,7,""=>"value", 3,2,1)));

echo "Done\n";
?>
--EXPECTF-- 
Warning: array_key_exists() expects exactly 2 parameters, 0 given in %s on line 
%d
NULL

Warning: array_key_exists(): The first argument should be either a string or an 
integer in %s on line %d
bool(false)

Warning: array_key_exists(): The second argument should be either an array or 
an object in %s on line %d
bool(false)
bool(false)
bool(false)
bool(true)
bool(true)
bool(false)
bool(true)
bool(false)

Warning: array_key_exists(): The first argument should be either a string or an 
integer in %s on line %d
bool(false)
Done

http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/array/array_rand.phpt?view=markup&rev=1.1
Index: php-src/ext/standard/tests/array/array_rand.phpt
+++ php-src/ext/standard/tests/array/array_rand.phpt
--TEST--
array_rand() tests
--FILE--

--EXPECTF-- 
Warning: array_rand() expects at least 1 parameter, 0 given in %s on line %d
NULL
NULL

Warning: array_rand(): Second argument has to be between 1 and the number of 
elements in the array in %s on line %d
NULL

Warning: array_rand() expects parameter 1 to be array, integer given in %s on 
line %d
NULL

Warning: array_rand(): Second argument has to be between 1 and the number of 
elements in the array in %s on line %d
NULL

Warning: array_rand(): Second argument has to be between 1 and the number of 
elements in the array in %s on line %d
NULL

Warning: array_rand(): Second argument has to be between 1 and the number of 
elements in the array in %s on line %d
NULL
array(3) {
  [0]=>
  int(%d)
  [1]=>
  int(%d)
  [2]=>
  int(%d)
}
array(2) {
  [0]=>
  int(%d)
  [1]=>
  int(%d)
}
Done

http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/array/array_unshift.phpt?view=markup&rev=1.1
Index: php-src/ext/standard/tests/array/array_unshift.phpt
+++ php-src/ext/standard/tests/array/array_unshift.phpt
--TEST--
array_unshift() tests
--FILE--

--EXPECTF-- 
int(1)
array(1) {
  [0]=>

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

2006-11-15 Thread Antony Dovgal
tony2001Wed Nov 15 22:43:19 2006 UTC

  Modified files:  
/php-src/ext/standard   array.c 
  Log:
  fix array_key_exists() with NULL key in Unicode mode
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/array.c?r1=1.392&r2=1.393&diff_format=u
Index: php-src/ext/standard/array.c
diff -u php-src/ext/standard/array.c:1.392 php-src/ext/standard/array.c:1.393
--- php-src/ext/standard/array.c:1.392  Wed Nov 15 22:09:25 2006
+++ php-src/ext/standard/array.cWed Nov 15 22:43:19 2006
@@ -21,7 +21,7 @@
+--+
 */
 
-/* $Id: array.c,v 1.392 2006/11/15 22:09:25 tony2001 Exp $ */
+/* $Id: array.c,v 1.393 2006/11/15 22:43:19 tony2001 Exp $ */
 
 #include "php.h"
 #include "php_ini.h"
@@ -4335,7 +4335,7 @@
}
RETURN_FALSE;
case IS_NULL:
-   if (zend_hash_exists(HASH_OF(array), "", 1)) {
+   if (zend_u_hash_exists(HASH_OF(array), (UG(unicode) ? 
IS_UNICODE : IS_STRING), EMPTY_ZSTR, 1)) {
RETURN_TRUE;
}
RETURN_FALSE;

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



[PHP-CVS] cvs: php-src /ext/standard/tests/array array_key_exists.phpt array_pad.phpt array_rand.phpt array_unshift.phpt array_values.phpt /ext/standard/tests/file statpage.phpt

2006-11-15 Thread Antony Dovgal
tony2001Wed Nov 15 22:42:28 2006 UTC

  Added files: 
/php-src/ext/standard/tests/array   array_key_exists.phpt 
array_rand.phpt 
array_unshift.phpt 
array_values.phpt 
/php-src/ext/standard/tests/filestatpage.phpt 

  Modified files:  
/php-src/ext/standard/tests/array   array_pad.phpt 
  Log:
  add new tests
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/array/array_pad.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/ext/standard/tests/array/array_pad.phpt
diff -u php-src/ext/standard/tests/array/array_pad.phpt:1.1 
php-src/ext/standard/tests/array/array_pad.phpt:1.2
--- php-src/ext/standard/tests/array/array_pad.phpt:1.1 Wed Nov 15 22:09:25 2006
+++ php-src/ext/standard/tests/array/array_pad.phpt Wed Nov 15 22:42:27 2006
@@ -16,6 +16,7 @@
 var_dump(array_pad(array("", -1, 2.0), -3, array()));
 var_dump(array_pad(array("", -1, 2.0), -4, array()));
 var_dump(array_pad(array("", -1, 2.0), 200, 0));
+var_dump(array_pad("", 200, 0));
 
 echo "Done\n";
 ?>
@@ -94,6 +95,9 @@
 
 Warning: array_pad(): You may only pad up to 1048576 elements at a time in %s 
on line %d
 bool(false)
+
+Warning: array_pad() expects parameter 1 to be array, string given in %s on 
line %d
+NULL
 Done
 --UEXPECTF--
 Warning: array_pad() expects exactly 3 parameters, 0 given in %s on line %d
@@ -170,4 +174,7 @@
 
 Warning: array_pad(): You may only pad up to 1048576 elements at a time in %s 
on line %d
 bool(false)
+
+Warning: array_pad() expects parameter 1 to be array, Unicode string given in 
%s on line %d
+NULL
 Done

http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/array/array_key_exists.phpt?view=markup&rev=1.1
Index: php-src/ext/standard/tests/array/array_key_exists.phpt
+++ php-src/ext/standard/tests/array/array_key_exists.phpt
--TEST--
array_key_exists() tests
--FILE--
1)));
var_dump(array_key_exists("a", array(3,2,1)));
var_dump(array_key_exists(NULL, array(5,6,7,""=>"value", 3,2,1)));
var_dump(array_key_exists(NULL, array(5,6,7,3,2,1)));
var_dump(array_key_exists(false, array(5,6,7,""=>"value", 3,2,1)));

echo "Done\n";
?>
--EXPECTF-- 
Warning: array_key_exists() expects exactly 2 parameters, 0 given in %s on line 
%d
NULL

Warning: array_key_exists(): The first argument should be either a string or an 
integer in %s on line %d
bool(false)

Warning: array_key_exists(): The second argument should be either an array or 
an object in %s on line %d
bool(false)
bool(false)
bool(false)
bool(true)
bool(true)
bool(false)
bool(true)
bool(false)

Warning: array_key_exists(): The first argument should be either a string or an 
integer in %s on line %d
bool(false)
Done

http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/array/array_rand.phpt?view=markup&rev=1.1
Index: php-src/ext/standard/tests/array/array_rand.phpt
+++ php-src/ext/standard/tests/array/array_rand.phpt
--TEST--
array_rand() tests
--FILE--

--EXPECTF-- 
Warning: array_rand() expects at least 1 parameter, 0 given in %s on line %d
NULL
NULL

Warning: array_rand(): Second argument has to be between 1 and the number of 
elements in the array in %s on line %d
NULL

Warning: array_rand() expects parameter 1 to be array, integer given in %s on 
line %d
NULL

Warning: array_rand(): Second argument has to be between 1 and the number of 
elements in the array in %s on line %d
NULL

Warning: array_rand(): Second argument has to be between 1 and the number of 
elements in the array in %s on line %d
NULL

Warning: array_rand(): Second argument has to be between 1 and the number of 
elements in the array in %s on line %d
NULL
array(3) {
  [0]=>
  int(%d)
  [1]=>
  int(%d)
  [2]=>
  int(%d)
}
array(2) {
  [0]=>
  int(%d)
  [1]=>
  int(%d)
}
Done

http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/array/array_unshift.phpt?view=markup&rev=1.1
Index: php-src/ext/standard/tests/array/array_unshift.phpt
+++ php-src/ext/standard/tests/array/array_unshift.phpt
--TEST--
array_unshift() tests
--FILE--

--EXPECTF-- 
int(1)
array(1) {
  [0]=>
  string(0) ""
}

Warning: array_unshift(): The first argument should be an array in %s on line %d
bool(false)
array(1) {
  [0]=>
  string(0) ""
}
int(2)
array(2) {
  [0]=>
  array(1) {
[0]=>
string(0) ""
  }
  [1]=>
  string(0) ""
}
Done
--UEXPECTF--
int(1)
array(1) {
  [0]=>
  unicode(0) ""
}

Warning: array_unshift(): The first argument should be an array in %s on line %d
bool(false)
array(1) {
  [0]=>
  unicode(0) ""
}
int(2)
array(2) {
  [0]=>
  array(1) {
[0]=>
unicode(0) ""
  }
  [1]=>
  unicode(0) ""
}
Done

http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/array/array_values.phpt?view=markup&rev=1.1
Index: php-src/ext/standard/tests/array/array_values.phpt
+++ php-src/ext/standard/tests/array/array_values.phpt
--TEST--
array_values() tests
--FILE--

--EXPECTF-- 
Warning: array_values() ex

[PHP-CVS] cvs: php-src(PHP_5_2) /ext/standard array.c /ext/standard/tests/array array_pad.phpt

2006-11-15 Thread Antony Dovgal
tony2001Wed Nov 15 22:10:20 2006 UTC

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

  Modified files:  
/php-src/ext/standard   array.c 
  Log:
  fix leak, add test
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/array.c?r1=1.308.2.21.2.17&r2=1.308.2.21.2.18&diff_format=u
Index: php-src/ext/standard/array.c
diff -u php-src/ext/standard/array.c:1.308.2.21.2.17 
php-src/ext/standard/array.c:1.308.2.21.2.18
--- php-src/ext/standard/array.c:1.308.2.21.2.17Sun Nov 12 17:23:01 2006
+++ php-src/ext/standard/array.cWed Nov 15 22:10:19 2006
@@ -21,7 +21,7 @@
+--+
 */
 
-/* $Id: array.c,v 1.308.2.21.2.17 2006/11/12 17:23:01 iliaa Exp $ */
+/* $Id: array.c,v 1.308.2.21.2.18 2006/11/15 22:10:19 tony2001 Exp $ */
 
 #include "php.h"
 #include "php_ini.h"
@@ -2656,6 +2656,7 @@
num_pads = pad_size_abs - input_size;
if(num_pads > 1048576) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "You may only pad 
up to 1048576 elements at a time");
+   zval_dtor(return_value);
RETURN_FALSE;
}
pads = (zval ***)safe_emalloc(num_pads, sizeof(zval **), 0);

http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/array/array_pad.phpt?view=markup&rev=1.1
Index: php-src/ext/standard/tests/array/array_pad.phpt
+++ php-src/ext/standard/tests/array/array_pad.phpt
--TEST--
array_pad() tests
--FILE--

--EXPECTF-- 
Warning: array_pad() expects exactly 3 parameters, 0 given in %s on line %d
NULL

Warning: array_pad() expects exactly 3 parameters, 1 given in %s on line %d
NULL

Warning: array_pad() expects exactly 3 parameters, 2 given in %s on line %d
NULL
array(1) {
  [0]=>
  int(0)
}
array(0) {
}
array(1) {
  [0]=>
  int(0)
}
array(5) {
  [0]=>
  string(0) ""
  [1]=>
  int(-1)
  [2]=>
  float(2)
  [3]=>
  int(0)
  [4]=>
  int(0)
}
array(5) {
  [0]=>
  string(0) ""
  [1]=>
  int(-1)
  [2]=>
  float(2)
  [3]=>
  array(0) {
  }
  [4]=>
  array(0) {
  }
}
array(3) {
  [0]=>
  string(0) ""
  [1]=>
  int(-1)
  [2]=>
  float(2)
}
array(3) {
  [0]=>
  string(0) ""
  [1]=>
  int(-1)
  [2]=>
  float(2)
}
array(4) {
  [0]=>
  array(0) {
  }
  [1]=>
  string(0) ""
  [2]=>
  int(-1)
  [3]=>
  float(2)
}

Warning: array_pad(): You may only pad up to 1048576 elements at a time in %s 
on line %d
bool(false)
Done
--UEXPECTF--
Warning: array_pad() expects exactly 3 parameters, 0 given in %s on line %d
NULL

Warning: array_pad() expects exactly 3 parameters, 1 given in %s on line %d
NULL

Warning: array_pad() expects exactly 3 parameters, 2 given in %s on line %d
NULL
array(1) {
  [0]=>
  int(0)
}
array(0) {
}
array(1) {
  [0]=>
  int(0)
}
array(5) {
  [0]=>
  unicode(0) ""
  [1]=>
  int(-1)
  [2]=>
  float(2)
  [3]=>
  int(0)
  [4]=>
  int(0)
}
array(5) {
  [0]=>
  unicode(0) ""
  [1]=>
  int(-1)
  [2]=>
  float(2)
  [3]=>
  array(0) {
  }
  [4]=>
  array(0) {
  }
}
array(3) {
  [0]=>
  unicode(0) ""
  [1]=>
  int(-1)
  [2]=>
  float(2)
}
array(3) {
  [0]=>
  unicode(0) ""
  [1]=>
  int(-1)
  [2]=>
  float(2)
}
array(4) {
  [0]=>
  array(0) {
  }
  [1]=>
  unicode(0) ""
  [2]=>
  int(-1)
  [3]=>
  float(2)
}

Warning: array_pad(): You may only pad up to 1048576 elements at a time in %s 
on line %d
bool(false)
Done

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



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

2006-11-15 Thread Antony Dovgal
tony2001Wed Nov 15 22:09:25 2006 UTC

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

  Modified files:  
/php-src/ext/standard   array.c 
  Log:
  fix memory leak and typo in zend_parse_parameters(), which caused segfault
  add test
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/array.c?r1=1.391&r2=1.392&diff_format=u
Index: php-src/ext/standard/array.c
diff -u php-src/ext/standard/array.c:1.391 php-src/ext/standard/array.c:1.392
--- php-src/ext/standard/array.c:1.391  Mon Nov 13 15:34:49 2006
+++ php-src/ext/standard/array.cWed Nov 15 22:09:25 2006
@@ -21,7 +21,7 @@
+--+
 */
 
-/* $Id: array.c,v 1.391 2006/11/13 15:34:49 iliaa Exp $ */
+/* $Id: array.c,v 1.392 2006/11/15 22:09:25 tony2001 Exp $ */
 
 #include "php.h"
 #include "php_ini.h"
@@ -2669,7 +2669,7 @@
int do_pad; /* Whether we should do padding at all 
*/
int i;

-   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a|lz", &input, 
&pad_size, &pad_value) == FAILURE) {
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "alz", &input, 
&pad_size, &pad_value) == FAILURE) {
return;
}
 
@@ -2690,6 +2690,7 @@
num_pads = pad_size_abs - input_size;
if (num_pads > 1048576) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "You may only pad 
up to 1048576 elements at a time");
+   zval_dtor(return_value);
RETURN_FALSE;
}
pads = (zval ***)safe_emalloc(num_pads, sizeof(zval **), 0);

http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/array/array_pad.phpt?view=markup&rev=1.1
Index: php-src/ext/standard/tests/array/array_pad.phpt
+++ php-src/ext/standard/tests/array/array_pad.phpt
--TEST--
array_pad() tests
--FILE--

--EXPECTF-- 
Warning: array_pad() expects exactly 3 parameters, 0 given in %s on line %d
NULL

Warning: array_pad() expects exactly 3 parameters, 1 given in %s on line %d
NULL

Warning: array_pad() expects exactly 3 parameters, 2 given in %s on line %d
NULL
array(1) {
  [0]=>
  int(0)
}
array(0) {
}
array(1) {
  [0]=>
  int(0)
}
array(5) {
  [0]=>
  string(0) ""
  [1]=>
  int(-1)
  [2]=>
  float(2)
  [3]=>
  int(0)
  [4]=>
  int(0)
}
array(5) {
  [0]=>
  string(0) ""
  [1]=>
  int(-1)
  [2]=>
  float(2)
  [3]=>
  array(0) {
  }
  [4]=>
  array(0) {
  }
}
array(3) {
  [0]=>
  string(0) ""
  [1]=>
  int(-1)
  [2]=>
  float(2)
}
array(3) {
  [0]=>
  string(0) ""
  [1]=>
  int(-1)
  [2]=>
  float(2)
}
array(4) {
  [0]=>
  array(0) {
  }
  [1]=>
  string(0) ""
  [2]=>
  int(-1)
  [3]=>
  float(2)
}

Warning: array_pad(): You may only pad up to 1048576 elements at a time in %s 
on line %d
bool(false)
Done
--UEXPECTF--
Warning: array_pad() expects exactly 3 parameters, 0 given in %s on line %d
NULL

Warning: array_pad() expects exactly 3 parameters, 1 given in %s on line %d
NULL

Warning: array_pad() expects exactly 3 parameters, 2 given in %s on line %d
NULL
array(1) {
  [0]=>
  int(0)
}
array(0) {
}
array(1) {
  [0]=>
  int(0)
}
array(5) {
  [0]=>
  unicode(0) ""
  [1]=>
  int(-1)
  [2]=>
  float(2)
  [3]=>
  int(0)
  [4]=>
  int(0)
}
array(5) {
  [0]=>
  unicode(0) ""
  [1]=>
  int(-1)
  [2]=>
  float(2)
  [3]=>
  array(0) {
  }
  [4]=>
  array(0) {
  }
}
array(3) {
  [0]=>
  unicode(0) ""
  [1]=>
  int(-1)
  [2]=>
  float(2)
}
array(3) {
  [0]=>
  unicode(0) ""
  [1]=>
  int(-1)
  [2]=>
  float(2)
}
array(4) {
  [0]=>
  array(0) {
  }
  [1]=>
  unicode(0) ""
  [2]=>
  int(-1)
  [3]=>
  float(2)
}

Warning: array_pad(): You may only pad up to 1048576 elements at a time in %s 
on line %d
bool(false)
Done

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



Re: [PHP-CVS] cvs: php-src /ext/gettext gettext.c /ext/gettext/tests dcngettext.phpt gettext_basic.phpt gettext_basic_de.phpt /ext/gettext/tests/locale/de/LC_MESSAGES messages.mo messages.po

2006-11-15 Thread Andrei Zmievski

Do you think that using filesystem encoding for domain is appropriate?

-Andrei

On Nov 15, 2006, at 9:14 AM, Michael Wallner wrote:


mikeWed Nov 15 17:14:50 2006 UTC

  Added files:
/php-src/ext/gettext/tests  gettext_basic_de.phpt
/php-src/ext/gettext/tests/locale/de/LC_MESSAGESmessages.mo
messages.po

  Modified files:
/php-src/ext/gettextgettext.c
/php-src/ext/gettext/tests  dcngettext.phpt gettext_basic.phpt
  Log:
  - unicode upgrade
  # as setlocale() throws an E_STRICT deprecated warning, I guess we'll
see ICU message catalogue support?

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


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



Re: [PHP-CVS] cvs: php-src /ext/xml xml.c /ext/xml/tests bug25666.phpt bug26528.phpt bug32001.phpt bug35447.phpt xml006.phpt xml009.phpt

2006-11-15 Thread Andrei Zmievski

Wow, nagging works.

-Andrei

On Nov 15, 2006, at 4:08 AM, Rob Richards wrote:


rrichards   Wed Nov 15 12:08:12 2006 UTC

  Modified files:
/php-src/ext/xmlxml.c
/php-src/ext/xml/tests  bug25666.phpt bug26528.phpt bug32001.phpt
bug35447.phpt xml006.phpt xml009.phpt
  Log:
  add unicode support so Andrei finally stops asking me about it
  update tests
--
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



[PHP-CVS] cvs: php-src(PHP_5_2) /ext/hash hash.c hash_md.c hash_ripemd.c php_hash.h php_hash_md.h php_hash_ripemd.h /ext/hash/tests md2.phpt ripemd256.phpt ripemd320.phpt

2006-11-15 Thread Sara Golemon
pollita Wed Nov 15 20:06:10 2006 UTC

  Added files: (Branch: PHP_5_2)
/php-src/ext/hash/tests md2.phpt ripemd256.phpt ripemd320.phpt 

  Modified files:  
/php-src/ext/hash   hash.c hash_md.c hash_ripemd.c php_hash.h 
php_hash_md.h php_hash_ripemd.h 
  Log:
  Backport md2, ripemd256, and ripemd320 algos from HEAD
  
  http://cvs.php.net/viewvc.cgi/php-src/ext/hash/hash.c?r1=1.18.2.5.2.3&r2=1.18.2.5.2.4&diff_format=u
Index: php-src/ext/hash/hash.c
diff -u php-src/ext/hash/hash.c:1.18.2.5.2.3 
php-src/ext/hash/hash.c:1.18.2.5.2.4
--- php-src/ext/hash/hash.c:1.18.2.5.2.3Fri Jul 28 14:27:03 2006
+++ php-src/ext/hash/hash.c Wed Nov 15 20:06:09 2006
@@ -16,7 +16,7 @@
   +--+
 */
 
-/* $Id: hash.c,v 1.18.2.5.2.3 2006/07/28 14:27:03 iliaa Exp $ */
+/* $Id: hash.c,v 1.18.2.5.2.4 2006/11/15 20:06:09 pollita Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -517,6 +517,7 @@
 
zend_hash_init(&php_hash_hashtable, 35, NULL, NULL, 1);
 
+   php_hash_register_algo("md2",   &php_hash_md2_ops);
php_hash_register_algo("md4",   &php_hash_md4_ops);
php_hash_register_algo("md5",   &php_hash_md5_ops);
php_hash_register_algo("sha1",  &php_hash_sha1_ops);
@@ -525,6 +526,8 @@
php_hash_register_algo("sha512",&php_hash_sha512_ops);
php_hash_register_algo("ripemd128", 
&php_hash_ripemd128_ops);
php_hash_register_algo("ripemd160", 
&php_hash_ripemd160_ops);
+   php_hash_register_algo("ripemd256", 
&php_hash_ripemd256_ops);
+   php_hash_register_algo("ripemd320", 
&php_hash_ripemd320_ops);
php_hash_register_algo("whirlpool", 
&php_hash_whirlpool_ops);
php_hash_register_algo("tiger128,3",&php_hash_3tiger128_ops);
php_hash_register_algo("tiger160,3",&php_hash_3tiger160_ops);
http://cvs.php.net/viewvc.cgi/php-src/ext/hash/hash_md.c?r1=1.6.2.4&r2=1.6.2.4.2.1&diff_format=u
Index: php-src/ext/hash/hash_md.c
diff -u php-src/ext/hash/hash_md.c:1.6.2.4 
php-src/ext/hash/hash_md.c:1.6.2.4.2.1
--- php-src/ext/hash/hash_md.c:1.6.2.4  Sun Jan  1 12:50:07 2006
+++ php-src/ext/hash/hash_md.c  Wed Nov 15 20:06:09 2006
@@ -16,7 +16,7 @@
   +--+
 */
 
-/* $Id: hash_md.c,v 1.6.2.4 2006/01/01 12:50:07 sniper Exp $ */
+/* $Id: hash_md.c,v 1.6.2.4.2.1 2006/11/15 20:06:09 pollita Exp $ */
 
 #include "php_hash.h"
 #include "php_hash_md.h"
@@ -39,6 +39,15 @@
sizeof(PHP_MD4_CTX)
 };
 
+php_hash_ops php_hash_md2_ops = {
+   (php_hash_init_func_t) PHP_MD2Init,
+   (php_hash_update_func_t) PHP_MD2Update,
+   (php_hash_final_func_t) PHP_MD2Final,
+   16,
+   16,
+   sizeof(PHP_MD2_CTX)
+};
+
 /* MD common stuff */
 
 static unsigned char PADDING[64] =
@@ -579,6 +588,95 @@
 }
 /* }}} */
 
+/* MD2 */
+
+static unsigned char MD2_S[256] = {
+41,  46,  67, 201, 162, 216, 124,   1,  61,  54,  84, 161, 236, 240,   
6,  19,
+98, 167,   5, 243, 192, 199, 115, 140, 152, 147,  43, 217, 188,  76, 
130, 202,
+30, 155,  87,  60, 253, 212, 224,  22, 103,  66, 111,  24, 138,  23, 
229,  18,
+   190,  78, 196, 214, 218, 158, 222,  73, 160, 251, 245, 142, 187,  47, 
238, 122,
+   169, 104, 121, 145,  21, 178,   7,  63, 148, 194,  16, 137,  11,  34,  
95,  33,
+   128, 127,  93, 154,  90, 144,  50,  39,  53,  62, 204, 231, 191, 247, 
151,   3,
+   255,  25,  48, 179,  72, 165, 181, 209, 215,  94, 146,  42, 172,  86, 
170, 198,
+79, 184,  56, 210, 150, 164, 125, 182, 118, 252, 107, 226, 156, 116,   
4, 241,
+69, 157, 112,  89, 100, 113, 135,  32, 134,  91, 207, 101, 230,  45, 
168,   2,
+27,  96,  37, 173, 174, 176, 185, 246,  28,  70,  97, 105,  52,  64, 
126,  15,
+85,  71, 163,  35, 221,  81, 175,  58, 195,  92, 249, 206, 186, 197, 
234,  38,
+44,  83,  13, 110, 133,  40, 132,   9, 211, 223, 205, 244,  65, 129,  
77,  82,
+   106, 220,  55, 200, 108, 193, 171, 250,  36, 225, 123,   8,  12, 189, 
177,  74,
+   120, 136, 149, 139, 227,  99, 232, 109, 233, 203, 213, 254,  59,   0,  
29,  57,
+   242, 239, 183,  14, 102,  88, 208, 228, 166, 119, 114, 248, 235, 117,  
75,  10,
+49,  68,  80, 180, 143, 237,  31,  26, 219, 153, 141,  51, 159,  17, 
131,  20 };
+
+PHP_HASH_API void PHP_MD2Init(PHP_MD2_CTX *context)
+{
+   memset(context, 0, sizeof(PHP_MD2_CTX));
+}
+
+static void MD2_Transform(PHP_MD2_CTX *context, const unsigned char *block)
+{
+   unsigned char i,j,t = 0;
+
+   for(i = 0; i < 16; i++) {
+   context->state[16+i] = block[i];
+   context->state[32+i] = (context->state[16+i] ^ 
context->state[i]);
+   }
+
+   for(i = 0; i < 18; i++) {
+   

[PHP-CVS] cvs: php-src(PHP_5_2) /ext/zip/lib zip_close.c zip_open.c zip_source_file.c

2006-11-15 Thread Pierre-Alain Joye
pajoye  Wed Nov 15 19:14:02 2006 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/zip/libzip_close.c zip_open.c zip_source_file.c 
  Log:
  #9278 and #39506, force the binary mode for the zip operation only. At least 
I do not have to set/restore it in each function.
  
http://cvs.php.net/viewvc.cgi/php-src/ext/zip/lib/zip_close.c?r1=1.1.2.3&r2=1.1.2.4&diff_format=u
Index: php-src/ext/zip/lib/zip_close.c
diff -u php-src/ext/zip/lib/zip_close.c:1.1.2.3 
php-src/ext/zip/lib/zip_close.c:1.1.2.4
--- php-src/ext/zip/lib/zip_close.c:1.1.2.3 Sat Nov 11 19:06:56 2006
+++ php-src/ext/zip/lib/zip_close.c Wed Nov 15 19:14:02 2006
@@ -548,6 +548,9 @@
free(temp);
return NULL;
 }
+#ifdef PHP_WIN32
+   _setmode(_fileno(tfp), _O_BINARY );
+#endif
 
 *outp = tfp;
 return temp;
http://cvs.php.net/viewvc.cgi/php-src/ext/zip/lib/zip_open.c?r1=1.1.2.2&r2=1.1.2.3&diff_format=u
Index: php-src/ext/zip/lib/zip_open.c
diff -u php-src/ext/zip/lib/zip_open.c:1.1.2.2 
php-src/ext/zip/lib/zip_open.c:1.1.2.3
--- php-src/ext/zip/lib/zip_open.c:1.1.2.2  Wed Nov 15 16:24:24 2006
+++ php-src/ext/zip/lib/zip_open.c  Wed Nov 15 19:14:02 2006
@@ -75,10 +75,6 @@
return NULL;
 }
 
-#ifdef PHP_WIN32 
-   _fmode = _O_BINARY;
-#endif
-
 if (flags & ZIP_OVERWRITE || stat(fn, &st) != 0) {
if ((flags & ZIP_CREATE) || (flags & ZIP_OVERWRITE)) {
if ((za=_zip_new(&error)) == NULL) {
@@ -104,7 +100,6 @@
return NULL;
 }
 
-
 /* ZIP_CREATE gets ignored if file exists and not ZIP_EXCL,
just like open() */
if ((fp=fopen(fn, "rb")) == NULL) {
@@ -112,6 +107,10 @@
return NULL;
}
 
+#ifdef PHP_WIN32
+   _setmode(_fileno(fp), _O_BINARY );
+#endif
+
 clearerr(fp);
 fseek(fp, 0, SEEK_END);
 len = ftell(fp);
http://cvs.php.net/viewvc.cgi/php-src/ext/zip/lib/zip_source_file.c?r1=1.1&r2=1.1.2.1&diff_format=u
Index: php-src/ext/zip/lib/zip_source_file.c
diff -u php-src/ext/zip/lib/zip_source_file.c:1.1 
php-src/ext/zip/lib/zip_source_file.c:1.1.2.1
--- php-src/ext/zip/lib/zip_source_file.c:1.1   Mon Jul 24 16:58:58 2006
+++ php-src/ext/zip/lib/zip_source_file.c   Wed Nov 15 19:14:02 2006
@@ -62,6 +62,10 @@
return NULL;
 }
 
+#ifdef PHP_WIN32
+   _setmode(_fileno(fp), _O_BINARY );
+#endif
+
 if ((zs=zip_source_filep(za, fp, start, len)) == NULL) {
fclose(fp);
return NULL;

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



[PHP-CVS] cvs: php-src /ext/iconv iconv.c /ext/iconv/tests bug37773.phpt

2006-11-15 Thread Ilia Alshanetsky
iliaa   Wed Nov 15 18:35:18 2006 UTC

  Modified files:  
/php-src/ext/iconv  iconv.c 
/php-src/ext/iconv/testsbug37773.phpt 
  Log:
  MFB: Fixed bug #37773 (iconv_substr() gives "Unknown error" when string
  length = 1").
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/iconv/iconv.c?r1=1.146&r2=1.147&diff_format=u
Index: php-src/ext/iconv/iconv.c
diff -u php-src/ext/iconv/iconv.c:1.146 php-src/ext/iconv/iconv.c:1.147
--- php-src/ext/iconv/iconv.c:1.146 Sun Oct  8 13:34:22 2006
+++ php-src/ext/iconv/iconv.c   Wed Nov 15 18:35:18 2006
@@ -18,7 +18,7 @@
+--+
  */
 
-/* $Id: iconv.c,v 1.146 2006/10/08 13:34:22 bjori Exp $ */
+/* $Id: iconv.c,v 1.147 2006/11/15 18:35:18 iliaa Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -809,7 +809,9 @@
}
}
 
-   _php_iconv_appendl(pretval, buf, sizeof(buf), cd2);
+   if (_php_iconv_appendl(pretval, buf, sizeof(buf), cd2) 
!= PHP_ICONV_ERR_SUCCESS) {
+   break;
+   }
--len;
}
 
@@ -827,10 +829,6 @@
 
case E2BIG:
break;
-
-   default:
-   err = PHP_ICONV_ERR_UNKNOWN;
-   break;
}
 #endif
if (err == PHP_ICONV_ERR_SUCCESS) {
http://cvs.php.net/viewvc.cgi/php-src/ext/iconv/tests/bug37773.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/ext/iconv/tests/bug37773.phpt
diff -u /dev/null php-src/ext/iconv/tests/bug37773.phpt:1.2
--- /dev/null   Wed Nov 15 18:35:18 2006
+++ php-src/ext/iconv/tests/bug37773.phpt   Wed Nov 15 18:35:18 2006
@@ -0,0 +1,10 @@
+--TEST--
+Bug #37773 (iconv_substr() gives "Unknown error" when string length = 1")
+--SKIPIF--
+
+--FILE--
+
+--EXPECT--
+string(1) "x"
\ 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_2) / NEWS /ext/iconv iconv.c /ext/iconv/tests bug37773.phpt

2006-11-15 Thread Ilia Alshanetsky
iliaa   Wed Nov 15 18:34:57 2006 UTC

  Added files: (Branch: PHP_5_2)
/php-src/ext/iconv/testsbug37773.phpt 

  Modified files:  
/php-srcNEWS 
/php-src/ext/iconv  iconv.c 
  Log:
  Fixed bug #37773 (iconv_substr() gives "Unknown error" when string length =
  1").
  
  
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.364&r2=1.2027.2.547.2.365&diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.364 php-src/NEWS:1.2027.2.547.2.365
--- php-src/NEWS:1.2027.2.547.2.364 Wed Nov 15 16:05:11 2006
+++ php-src/NEWSWed Nov 15 18:34:56 2006
@@ -81,6 +81,8 @@
   (Dmitry)
 - Fixed bug #38456 (Apache2 segfaults when virtual() is called in .php
   ErrorDocument). (Ilia)
+- Fixed bug #37773 (iconv_substr() gives "Unknown error" when string length = 
1").
+  (Ilia)
 - Fixed bug #36975 (natcasesort() causes array_pop() to misbehave). (Hannes)
 - Fixed bug #36812 (pg_execute() modifies input array). (Ilia)
 - Fixed bug #36644 (possible crash in variant_date_from_timestamp()). (Ilia)
http://cvs.php.net/viewvc.cgi/php-src/ext/iconv/iconv.c?r1=1.124.2.8.2.7&r2=1.124.2.8.2.8&diff_format=u
Index: php-src/ext/iconv/iconv.c
diff -u php-src/ext/iconv/iconv.c:1.124.2.8.2.7 
php-src/ext/iconv/iconv.c:1.124.2.8.2.8
--- php-src/ext/iconv/iconv.c:1.124.2.8.2.7 Tue Sep 12 17:26:34 2006
+++ php-src/ext/iconv/iconv.c   Wed Nov 15 18:34:57 2006
@@ -18,7 +18,7 @@
+--+
  */
 
-/* $Id: iconv.c,v 1.124.2.8.2.7 2006/09/12 17:26:34 tony2001 Exp $ */
+/* $Id: iconv.c,v 1.124.2.8.2.8 2006/11/15 18:34:57 iliaa Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -744,7 +744,9 @@
}
}
 
-   _php_iconv_appendl(pretval, buf, sizeof(buf), cd2);
+   if (_php_iconv_appendl(pretval, buf, sizeof(buf), cd2) 
!= PHP_ICONV_ERR_SUCCESS) {
+   break;
+   }
--len;
}
 
@@ -762,10 +764,6 @@
 
case E2BIG:
break;
-
-   default:
-   err = PHP_ICONV_ERR_UNKNOWN;
-   break;
}
 #endif
if (err == PHP_ICONV_ERR_SUCCESS) {

http://cvs.php.net/viewvc.cgi/php-src/ext/iconv/tests/bug37773.phpt?view=markup&rev=1.1
Index: php-src/ext/iconv/tests/bug37773.phpt
+++ php-src/ext/iconv/tests/bug37773.phpt

-- 
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_2) /ext/zip/lib zip_open.c

2006-11-15 Thread Dmitry Stogov
Hi Pierre,

I think that changing global behavior (_fmode = _O_BINARY;) is not a good
idea.
May be this code should be removed from CGI and CLI too.

May be we have a bug somewhere and _O_BINARY is not passed to open().

Do you think the bug is in CRT?
What VC version do you use?

Dmitry.

> -Original Message-
> From: Pierre [mailto:[EMAIL PROTECTED] 
> Sent: Wednesday, November 15, 2006 8:41 PM
> To: Dmitry Stogov
> Cc: Pierre-Alain Joye; php-cvs@lists.php.net; Wez Furlong
> Subject: Re: [PHP-CVS] cvs: php-src(PHP_5_2) /ext/zip/lib zip_open.c
> 
> 
> On 11/15/06, Dmitry Stogov <[EMAIL PROTECTED]> wrote:
> > I am not sure in this patch, because it changes the whole process 
> > behavior. May be you need add character "b" into 'mode' 
> then you open 
> > zip archive?
> 
> Please check:
> 
> http://news.php.net/php.internals/26606
> 
> Can we discuss the issue there?
> 
> --Pierre
> 

-- 
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_2) /ext/zip/lib zip_open.c

2006-11-15 Thread Pierre

On 11/15/06, Dmitry Stogov <[EMAIL PROTECTED]> wrote:

I am not sure in this patch, because it changes the whole process behavior.
May be you need add character "b" into 'mode' then you open zip archive?


Please check:

http://news.php.net/php.internals/26606

Can we discuss the issue there?

--Pierre

--
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/standard/tests/general_functions type.phpt ZendEngine2 zend_operators.c

2006-11-15 Thread Antony Dovgal
tony2001Wed Nov 15 17:29:08 2006 UTC

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

  Modified files:  
/ZendEngine2zend_operators.c 
  Log:
  fix leak appearing when converting object to NULL
  add test
  
  http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_operators.c?r1=1.208.2.4.2.10&r2=1.208.2.4.2.11&diff_format=u
Index: ZendEngine2/zend_operators.c
diff -u ZendEngine2/zend_operators.c:1.208.2.4.2.10 
ZendEngine2/zend_operators.c:1.208.2.4.2.11
--- ZendEngine2/zend_operators.c:1.208.2.4.2.10 Tue Oct  3 17:54:51 2006
+++ ZendEngine2/zend_operators.cWed Nov 15 17:29:08 2006
@@ -17,7 +17,7 @@
+--+
 */
 
-/* $Id: zend_operators.c,v 1.208.2.4.2.10 2006/10/03 17:54:51 tony2001 Exp $ */
+/* $Id: zend_operators.c,v 1.208.2.4.2.11 2006/11/15 17:29:08 tony2001 Exp $ */
 
 #include 
 
@@ -447,6 +447,7 @@
return;
}
*op = *org;
+   FREE_ZVAL(org);
}
}
 

http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/general_functions/type.phpt?view=markup&rev=1.1
Index: php-src/ext/standard/tests/general_functions/type.phpt
+++ php-src/ext/standard/tests/general_functions/type.phpt
--TEST--
gettype(), settype() and friends
--FILE--

--EXPECTF-- 
string(5) "array"
string(6) "string"
string(5) "array"
string(7) "integer"
string(6) "double"
string(4) "NULL"
string(7) "boolean"
string(6) "string"
string(12) "unknown type"
string(8) "resource"
string(6) "object"
bool(true)
NULL
bool(true)
NULL
bool(true)
NULL
bool(true)
NULL
bool(true)
NULL
bool(true)
NULL
bool(true)
NULL
bool(true)
NULL
bool(true)
NULL
bool(true)
NULL
bool(true)
NULL
bool(true)
int(1)
bool(true)
int(0)
bool(true)
int(1)
bool(true)
int(1)
bool(true)
int(2)
bool(true)
int(0)
bool(true)
int(0)
bool(true)
int(0)
bool(true)
int(%d)
bool(true)
int(%d)
string(54) "Object of class stdClass could not be converted to int"
bool(true)
int(%d)
bool(true)
float(1)
bool(true)
float(0)
bool(true)
float(1)
bool(true)
float(1)
bool(true)
float(2)
bool(true)
float(0)
bool(true)
float(0)
bool(true)
float(0)
bool(true)
float(%d)
bool(true)
float(%d)
string(57) "Object of class stdClass could not be converted to double"
bool(true)
float(%d)
bool(true)
bool(true)
bool(true)
bool(true)
bool(true)
bool(true)
bool(true)
bool(true)
bool(true)
bool(true)
bool(true)
bool(false)
bool(true)
bool(false)
bool(true)
bool(true)
bool(true)
bool(true)
bool(true)
bool(true)
bool(true)
bool(true)
string(42) "settype(): Cannot convert to resource type"
bool(false)
array(3) {
  [0]=>
  int(1)
  [1]=>
  int(2)
  [2]=>
  int(3)
}
string(42) "settype(): Cannot convert to resource type"
bool(false)
string(14) "another string"
string(42) "settype(): Cannot convert to resource type"
bool(false)
array(3) {
  [0]=>
  int(2)
  [1]=>
  int(3)
  [2]=>
  int(4)
}
string(42) "settype(): Cannot convert to resource type"
bool(false)
int(1)
string(42) "settype(): Cannot convert to resource type"
bool(false)
float(2)
string(42) "settype(): Cannot convert to resource type"
bool(false)
NULL
string(42) "settype(): Cannot convert to resource type"
bool(false)
bool(false)
string(42) "settype(): Cannot convert to resource type"
bool(false)
string(11) "some string"
string(42) "settype(): Cannot convert to resource type"
bool(false)
resource(%d) of type (Unknown)
string(42) "settype(): Cannot convert to resource type"
bool(false)
resource(%d) of type (stream)
string(42) "settype(): Cannot convert to resource type"
bool(false)
object(stdClass)#%d (0) {
}
bool(true)
array(3) {
  [0]=>
  int(1)
  [1]=>
  int(2)
  [2]=>
  int(3)
}
bool(true)
array(1) {
  [0]=>
  string(14) "another string"
}
bool(true)
array(3) {
  [0]=>
  int(2)
  [1]=>
  int(3)
  [2]=>
  int(4)
}
bool(true)
array(1) {
  [0]=>
  int(1)
}
bool(true)
array(1) {
  [0]=>
  float(2)
}
bool(true)
array(0) {
}
bool(true)
array(1) {
  [0]=>
  bool(false)
}
bool(true)
array(1) {
  [0]=>
  string(11) "some string"
}
bool(true)
array(1) {
  [0]=>
  resource(%d) of type (Unknown)
}
bool(true)
array(1) {
  [0]=>
  resource(%d) of type (stream)
}
bool(true)
array(0) {
}
bool(true)
object(stdClass)#%d (3) {
  [0]=>
  int(1)
  [1]=>
  int(2)
  [2]=>
  int(3)
}
bool(true)
object(stdClass)#%d (1) {
  ["scalar"]=>
  string(14) "another string"
}
bool(true)
object(stdClass)#%d (3) {
  [0]=>
  int(2)
  [1]=>
  int(3)
  [2]=>
  int(4)
}
bool(true)
object(stdClass)#%d (1) {
  ["scalar"]=>
  int(1)
}
bool(true)
object(stdClass)#%d (1) {
  ["scalar"]=>
  float(2)
}
bool(true)
object(stdClass)#%d (0) {
}
bool(true)
object(stdClass)#%d (1) {
  ["scalar"]=>
  bool(false)
}
bool(true)
object(stdClass)#%d (1) {
  ["scalar"]=>
  string(11) "some string"
}
bool(true)
object(stdClass)#%d (1) {
  ["scalar"]=>
  resource(%d) of type (Unknown)
}
bool(true)
object(stdClass)#%d (1) {
 

[PHP-CVS] cvs: php-src /ext/standard/tests/general_functions type.phpt ZendEngine2 zend_operators.c

2006-11-15 Thread Antony Dovgal
tony2001Wed Nov 15 17:28:56 2006 UTC

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

  Modified files:  
/ZendEngine2zend_operators.c 
  Log:
  fix leak appearing when converting object to NULL
  add test
  
  http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_operators.c?r1=1.258&r2=1.259&diff_format=u
Index: ZendEngine2/zend_operators.c
diff -u ZendEngine2/zend_operators.c:1.258 ZendEngine2/zend_operators.c:1.259
--- ZendEngine2/zend_operators.c:1.258  Fri Oct 13 14:52:19 2006
+++ ZendEngine2/zend_operators.cWed Nov 15 17:28:56 2006
@@ -17,7 +17,7 @@
+--+
 */
 
-/* $Id: zend_operators.c,v 1.258 2006/10/13 14:52:19 andrei Exp $ */
+/* $Id: zend_operators.c,v 1.259 2006/11/15 17:28:56 tony2001 Exp $ */
 
 #include 
 
@@ -498,6 +498,7 @@
return;
}
*op = *org;
+   FREE_ZVAL(org);
}
}
 

http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/general_functions/type.phpt?view=markup&rev=1.1
Index: php-src/ext/standard/tests/general_functions/type.phpt
+++ php-src/ext/standard/tests/general_functions/type.phpt
--TEST--
gettype(), settype() and friends
--FILE--

--EXPECTF-- 
string(5) "array"
string(6) "string"
string(5) "array"
string(7) "integer"
string(6) "double"
string(4) "NULL"
string(7) "boolean"
string(6) "string"
string(12) "unknown type"
string(8) "resource"
string(6) "object"
bool(true)
NULL
bool(true)
NULL
bool(true)
NULL
bool(true)
NULL
bool(true)
NULL
bool(true)
NULL
bool(true)
NULL
bool(true)
NULL
bool(true)
NULL
bool(true)
NULL
bool(true)
NULL
bool(true)
int(1)
bool(true)
int(0)
bool(true)
int(1)
bool(true)
int(1)
bool(true)
int(2)
bool(true)
int(0)
bool(true)
int(0)
bool(true)
int(0)
bool(true)
int(%d)
bool(true)
int(%d)
string(54) "Object of class stdClass could not be converted to int"
bool(true)
int(%d)
bool(true)
float(1)
bool(true)
float(0)
bool(true)
float(1)
bool(true)
float(1)
bool(true)
float(2)
bool(true)
float(0)
bool(true)
float(0)
bool(true)
float(0)
bool(true)
float(%d)
bool(true)
float(%d)
string(57) "Object of class stdClass could not be converted to double"
bool(true)
float(%d)
bool(true)
bool(true)
bool(true)
bool(true)
bool(true)
bool(true)
bool(true)
bool(true)
bool(true)
bool(true)
bool(true)
bool(false)
bool(true)
bool(false)
bool(true)
bool(true)
bool(true)
bool(true)
bool(true)
bool(true)
bool(true)
bool(true)
string(42) "settype(): Cannot convert to resource type"
bool(false)
array(3) {
  [0]=>
  int(1)
  [1]=>
  int(2)
  [2]=>
  int(3)
}
string(42) "settype(): Cannot convert to resource type"
bool(false)
string(14) "another string"
string(42) "settype(): Cannot convert to resource type"
bool(false)
array(3) {
  [0]=>
  int(2)
  [1]=>
  int(3)
  [2]=>
  int(4)
}
string(42) "settype(): Cannot convert to resource type"
bool(false)
int(1)
string(42) "settype(): Cannot convert to resource type"
bool(false)
float(2)
string(42) "settype(): Cannot convert to resource type"
bool(false)
NULL
string(42) "settype(): Cannot convert to resource type"
bool(false)
bool(false)
string(42) "settype(): Cannot convert to resource type"
bool(false)
string(11) "some string"
string(42) "settype(): Cannot convert to resource type"
bool(false)
resource(%d) of type (Unknown)
string(42) "settype(): Cannot convert to resource type"
bool(false)
resource(%d) of type (stream)
string(42) "settype(): Cannot convert to resource type"
bool(false)
object(stdClass)#%d (0) {
}
bool(true)
array(3) {
  [0]=>
  int(1)
  [1]=>
  int(2)
  [2]=>
  int(3)
}
bool(true)
array(1) {
  [0]=>
  string(14) "another string"
}
bool(true)
array(3) {
  [0]=>
  int(2)
  [1]=>
  int(3)
  [2]=>
  int(4)
}
bool(true)
array(1) {
  [0]=>
  int(1)
}
bool(true)
array(1) {
  [0]=>
  float(2)
}
bool(true)
array(0) {
}
bool(true)
array(1) {
  [0]=>
  bool(false)
}
bool(true)
array(1) {
  [0]=>
  string(11) "some string"
}
bool(true)
array(1) {
  [0]=>
  resource(%d) of type (Unknown)
}
bool(true)
array(1) {
  [0]=>
  resource(%d) of type (stream)
}
bool(true)
array(0) {
}
bool(true)
object(stdClass)#%d (3) {
  [0]=>
  int(1)
  [1]=>
  int(2)
  [2]=>
  int(3)
}
bool(true)
object(stdClass)#%d (1) {
  ["scalar"]=>
  string(14) "another string"
}
bool(true)
object(stdClass)#%d (3) {
  [0]=>
  int(2)
  [1]=>
  int(3)
  [2]=>
  int(4)
}
bool(true)
object(stdClass)#%d (1) {
  ["scalar"]=>
  int(1)
}
bool(true)
object(stdClass)#%d (1) {
  ["scalar"]=>
  float(2)
}
bool(true)
object(stdClass)#%d (0) {
}
bool(true)
object(stdClass)#%d (1) {
  ["scalar"]=>
  bool(false)
}
bool(true)
object(stdClass)#%d (1) {
  ["scalar"]=>
  string(11) "some string"
}
bool(true)
object(stdClass)#%d (1) {
  ["scalar"]=>
  resource(%d) of type (Unknown)
}
bool(true)
object(stdClass)#%d (1) {
  ["scalar"]=>
  resource(%d) of type (stream)
}
bool(true)
object(stdClass)#%d (0)

[PHP-CVS] cvs: php-src(PHP_5_2) /ext/standard/tests/file disk.phpt filestat.phpt /ext/standard/tests/general_functions getrusage.phpt head.phpt /ext/standard/tests/strings metaphone.phpt soundex.php

2006-11-15 Thread Antony Dovgal
tony2001Wed Nov 15 17:27:03 2006 UTC

  Added files: (Branch: PHP_5_2)
/php-src/ext/standard/tests/strings uuencode.phpt soundex.phpt 
metaphone.phpt 
/php-src/ext/standard/tests/general_functions   head.phpt 
getrusage.phpt 
/php-src/ext/standard/tests/filefilestat.phpt disk.phpt 
  Log:
  add new tests
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/uuencode.phpt?view=markup&rev=1.1
Index: php-src/ext/standard/tests/strings/uuencode.phpt
+++ php-src/ext/standard/tests/strings/uuencode.phpt
--TEST--
uuencode family tests
--FILE--

--EXPECTF-- 
Warning: convert_uuencode() expects parameter 1 to be string (Unicode or 
binary), array given in %s on line %d
bool(false)

Warning: convert_uudecode() expects parameter 1 to be string (Unicode or 
binary), array given in %s on line %d
bool(false)
bool(false)
bool(false)
string(60) "J?B%`(R0E7B8J*"E??7M03TE5651215=145-$1D=(2DM,.CQ-3D)60UA:
`
"
string(1) "%s"
string(42) "[EMAIL PROTECTED]&*()_}{POIUYTREWQQSDFGHJKL:http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/soundex.phpt?view=markup&rev=1.1
Index: php-src/ext/standard/tests/strings/soundex.phpt
+++ php-src/ext/standard/tests/strings/soundex.phpt
--TEST--
soundex() tests
--FILE--

--EXPECTF-- 
bool(false)
string(4) ""

Warning: soundex() expects parameter 1 to be string, array given in %s on line 
%d
NULL
string(4) "F650"
string(4) "T300"
string(4) "T500"
string(4) "O500"
string(4) "S500"
string(4) "T230"
string(4) "T300"
string(4) "H000"
string(4) "S523"
string(4) "A000"
string(4) "C520"
string(4) "I500"
string(4) "G450"
string(4) "A250"
string(4) "H256"
Done
--UEXPECTF--
bool(false)
string(4) ""

Warning: soundex() expects parameter 1 to be binary string, array given in %s 
on line %d
NULL
string(4) "F650"
string(4) "T300"
string(4) "T500"
string(4) "O500"
string(4) "S500"
string(4) "T230"
string(4) "T300"
string(4) "H000"
string(4) "S523"
string(4) "A000"
string(4) "C520"
string(4) "I500"
string(4) "G450"
string(4) "A250"
string(4) "H256"
Done

http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/metaphone.phpt?view=markup&rev=1.1
Index: php-src/ext/standard/tests/strings/metaphone.phpt
+++ php-src/ext/standard/tests/strings/metaphone.phpt
--TEST--
metaphone() tests
--FILE--

--EXPECTF-- 
Warning: metaphone() expects at least 1 parameter, 0 given in %s on line %d
NULL
string(0) ""
string(0) ""
bool(false)
bool(false)
string(6) "FLTFRS"
string(6) "FLTFRS"
string(26) "0FLFRWRTKRFLNKHTLSLN0KLTR0"
string(56) "BT0XTFHRRHLTNTRTRNTPSNKLWRNRFTBF0MSWPNK0FNRKW0TSFSTLWNKS"
string(69) 
"ANT0NTWSKNFLYNKBKTMRTRW00SPTF0R0FSRNNTBHNTT0WNTRRTWLFNK0TTMRXSBRNTBLK"
string(56) "0NKTWSTSFRS0YKLTPRSFNT0TSTNTMNSF0MNTNSWSTPLTW00FTFLMNLFT"
Done

http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/general_functions/head.phpt?view=markup&rev=1.1
Index: php-src/ext/standard/tests/general_functions/head.phpt
+++ php-src/ext/standard/tests/general_functions/head.phpt
--TEST--
header() and friends
--SKIPIF--

--FILE--

--EXPECTF-- 
NULL
bool(false)
array(0) {
}

Warning: Cannot modify header information - headers already sent by (output 
started at %s:%d) in %s on line %d
NULL

Warning: Cannot modify header information - headers already sent by (output 
started at %s:%d) in %s on line %d
NULL
bool(true)
array(0) {
}

Warning: Cannot modify header information - headers already sent by (output 
started at %s:%d) in %s on line %d
NULL

Warning: Cannot modify header information - headers already sent by (output 
started at %s:%d) in %s on line %d
NULL
bool(true)
array(0) {
}
Done

http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/general_functions/getrusage.phpt?view=markup&rev=1.1
Index: php-src/ext/standard/tests/general_functions/getrusage.phpt
+++ php-src/ext/standard/tests/general_functions/getrusage.phpt
--TEST--
getrusage() tests
--SKIPIF--

--FILE--

--EXPECTF-- 
string(5) "array"
string(5) "array"
string(5) "array"

Warning: getrusage() expects parameter 1 to be long, array given in %s on line 
%d
NULL
Done
--UEXPECTF--
unicode(5) "array"
unicode(5) "array"
unicode(5) "array"

Warning: getrusage() expects parameter 1 to be long, array given in %s on line 
%d
NULL
Done

http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/file/filestat.phpt?view=markup&rev=1.1
Index: php-src/ext/standard/tests/file/filestat.phpt
+++ php-src/ext/standard/tests/file/filestat.phpt
--TEST--
various file stat func tests
--FILE--

--EXPECTF-- 
int(%d)
int(%d)
int(%d)
int(%d)
int(%d)
int(%d)
int(%d)
int(%d)
int(%d)
int(%d)
int(%d)
int(%d)
int(%d)
int(%d)
int(%d)

Warning: fileinode(): stat failed for /no/such/file/or/dir in %s on line %d
bool(false)

Warning: fileowner(): stat failed for /no/such/file/or/dir in %s on line %d
bool(false)

Warning: filegroup(): stat failed for /no/such/file/or/dir in %s on line %d
bool(fa

[PHP-CVS] cvs: php-src /ext/standard/tests/file disk.phpt filestat.phpt /ext/standard/tests/general_functions getrusage.phpt head.phpt /ext/standard/tests/strings metaphone.phpt soundex.phpt uuencod

2006-11-15 Thread Antony Dovgal
tony2001Wed Nov 15 17:26:54 2006 UTC

  Added files: 
/php-src/ext/standard/tests/filedisk.phpt filestat.phpt 
/php-src/ext/standard/tests/general_functions   getrusage.phpt 
head.phpt 
/php-src/ext/standard/tests/strings metaphone.phpt soundex.phpt 
uuencode.phpt 
  Log:
  add new tests
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/file/disk.phpt?view=markup&rev=1.1
Index: php-src/ext/standard/tests/file/disk.phpt
+++ php-src/ext/standard/tests/file/disk.phpt
--TEST--
disk_total_space() and disk_free_space() tests
--SKIPIF--

--FILE--

--EXPECTF-- 
Warning: disk_free_space() expects exactly 1 parameter, 0 given in %s on line %d
NULL

Warning: disk_total_space() expects exactly 1 parameter, 0 given in %s on line 
%d
NULL

Warning: disk_free_space(): No such file or directory in %s on line %d
bool(false)

Warning: disk_total_space(): No such file or directory in %s on line %d
bool(false)
float(%d)
float(%d)

Warning: disk_free_space(): No such file or directory in %s on line %d
bool(false)

Warning: disk_total_space(): No such file or directory in %s on line %d
bool(false)
Done

http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/file/filestat.phpt?view=markup&rev=1.1
Index: php-src/ext/standard/tests/file/filestat.phpt
+++ php-src/ext/standard/tests/file/filestat.phpt
--TEST--
various file stat func tests
--FILE--

--EXPECTF-- 
int(%d)
int(%d)
int(%d)
int(%d)
int(%d)
int(%d)
int(%d)
int(%d)
int(%d)
int(%d)
int(%d)
int(%d)
int(%d)
int(%d)
int(%d)

Warning: fileinode(): stat failed for /no/such/file/or/dir in %s on line %d
bool(false)

Warning: fileowner(): stat failed for /no/such/file/or/dir in %s on line %d
bool(false)

Warning: filegroup(): stat failed for /no/such/file/or/dir in %s on line %d
bool(false)

Warning: fileatime(): stat failed for /no/such/file/or/dir in %s on line %d
bool(false)

Warning: filectime(): stat failed for /no/such/file/or/dir in %s on line %d
bool(false)
Done

http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/general_functions/getrusage.phpt?view=markup&rev=1.1
Index: php-src/ext/standard/tests/general_functions/getrusage.phpt
+++ php-src/ext/standard/tests/general_functions/getrusage.phpt
--TEST--
getrusage() tests
--SKIPIF--

--FILE--

--EXPECTF-- 
string(5) "array"
string(5) "array"
string(5) "array"

Warning: getrusage() expects parameter 1 to be long, array given in %s on line 
%d
NULL
Done
--UEXPECTF--
unicode(5) "array"
unicode(5) "array"
unicode(5) "array"

Warning: getrusage() expects parameter 1 to be long, array given in %s on line 
%d
NULL
Done

http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/general_functions/head.phpt?view=markup&rev=1.1
Index: php-src/ext/standard/tests/general_functions/head.phpt
+++ php-src/ext/standard/tests/general_functions/head.phpt
--TEST--
header() and friends
--SKIPIF--

--FILE--

--EXPECTF-- 
NULL
bool(false)
array(0) {
}

Warning: Cannot modify header information - headers already sent by (output 
started at %s:%d) in %s on line %d
NULL

Warning: Cannot modify header information - headers already sent by (output 
started at %s:%d) in %s on line %d
NULL
bool(true)
array(0) {
}

Warning: Cannot modify header information - headers already sent by (output 
started at %s:%d) in %s on line %d
NULL

Warning: Cannot modify header information - headers already sent by (output 
started at %s:%d) in %s on line %d
NULL
bool(true)
array(0) {
}
Done

http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/metaphone.phpt?view=markup&rev=1.1
Index: php-src/ext/standard/tests/strings/metaphone.phpt
+++ php-src/ext/standard/tests/strings/metaphone.phpt
--TEST--
metaphone() tests
--FILE--

--EXPECTF-- 
Warning: metaphone() expects at least 1 parameter, 0 given in %s on line %d
NULL
string(0) ""
string(0) ""
bool(false)
bool(false)
string(6) "FLTFRS"
string(6) "FLTFRS"
string(26) "0FLFRWRTKRFLNKHTLSLN0KLTR0"
string(56) "BT0XTFHRRHLTNTRTRNTPSNKLWRNRFTBF0MSWPNK0FNRKW0TSFSTLWNKS"
string(69) 
"ANT0NTWSKNFLYNKBKTMRTRW00SPTF0R0FSRNNTBHNTT0WNTRRTWLFNK0TTMRXSBRNTBLK"
string(56) "0NKTWSTSFRS0YKLTPRSFNT0TSTNTMNSF0MNTNSWSTPLTW00FTFLMNLFT"
Done

http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/soundex.phpt?view=markup&rev=1.1
Index: php-src/ext/standard/tests/strings/soundex.phpt
+++ php-src/ext/standard/tests/strings/soundex.phpt
--TEST--
soundex() tests
--FILE--

--EXPECTF-- 
bool(false)
string(4) ""

Warning: soundex() expects parameter 1 to be string, array given in %s on line 
%d
NULL
string(4) "F650"
string(4) "T300"
string(4) "T500"
string(4) "O500"
string(4) "S500"
string(4) "T230"
string(4) "T300"
string(4) "H000"
string(4) "S523"
string(4) "A000"
string(4) "C520"
string(4) "I500"
string(4) "G450"
string(4) "A250"
string(4) "H256"
Done
--UEXPECTF--
bool(false)
string(4) ""

Warning: soundex() expects parameter 1 to be bi

RE: [PHP-CVS] cvs: php-src(PHP_5_2) /ext/zip/lib zip_open.c

2006-11-15 Thread Dmitry Stogov
I am not sure in this patch, because it changes the whole process behavior.
May be you need add character "b" into 'mode' then you open zip archive?

Dmitry.

> -Original Message-
> From: Pierre-Alain Joye [mailto:[EMAIL PROTECTED] 
> Sent: Wednesday, November 15, 2006 7:24 PM
> To: php-cvs@lists.php.net
> Subject: [PHP-CVS] cvs: php-src(PHP_5_2) /ext/zip/lib zip_open.c 
> 
> 
> pajoyeWed Nov 15 16:24:24 2006 UTC
> 
>   Modified files:  (Branch: PHP_5_2)
> /php-src/ext/zip/lib  zip_open.c 
>   Log:
>   #39506 and PECL #9278, should fix the problem for the other 
> SAPI (works for CLI, CGI and embed)
>   see: http://news.php.net/php.internals/26606 for the details
>   
> http://cvs.php.net/viewvc.cgi/php-src/ext/zip/lib/zip_open.c?r
1=1.1.2.1&r2=1.1.2.2&diff_format=u
Index: php-src/ext/zip/lib/zip_open.c
diff -u php-src/ext/zip/lib/zip_open.c:1.1.2.1
php-src/ext/zip/lib/zip_open.c:1.1.2.2
--- php-src/ext/zip/lib/zip_open.c:1.1.2.1  Sun Aug 13 21:09:59 2006
+++ php-src/ext/zip/lib/zip_open.c  Wed Nov 15 16:24:24 2006
@@ -75,6 +75,10 @@
return NULL;
 }
 
+#ifdef PHP_WIN32 
+   _fmode = _O_BINARY;
+#endif
+
 if (flags & ZIP_OVERWRITE || stat(fn, &st) != 0) {
if ((flags & ZIP_CREATE) || (flags & ZIP_OVERWRITE)) {
if ((za=_zip_new(&error)) == NULL) {

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



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

2006-11-15 Thread Michael Wallner
mikeWed Nov 15 17:16:25 2006 UTC

  Modified files:  
/php-srcNEWS 
  Log:
  - mhash news
  
  
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2131&r2=1.2132&diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2131 php-src/NEWS:1.2132
--- php-src/NEWS:1.2131 Mon Nov 13 20:48:18 2006
+++ php-src/NEWSWed Nov 15 17:16:25 2006
@@ -36,7 +36,13 @@
 - Improved cURL: (Ilia)
   . Added CURLINFO_HEADER_OUT constant to facilitate request retrieval.
 - Improved ext/zlib; re-implemented non-file related functionality. (Mike)
-- Improved output layer; see README.NEW-OUTPUT_API for internals. (Mike)
+- Improved output layer; see README.NEW-OUTPUT-API for internals. (Mike)
+- Improved ext/mhash: (Mike)
+  . Added keygen constants.
+  . Added new functions: mhash_keygen_count, mhash_get_keygen_name,
+mhash_keygen_uses_hash, mhash_keygen_uses_salt, mhash_get_keygen_salt_size,
+mhash_keygen.
+
 
 - Added automatic module globals management. (Dmitry)
 - Added "jump label" operator (limited "goto"). (Dmitry, Sara)

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



[PHP-CVS] cvs: php-src /ext/mhash mhash.c php_mhash.h

2006-11-15 Thread Michael Wallner
mikeWed Nov 15 17:16:05 2006 UTC

  Modified files:  
/php-src/ext/mhash  mhash.c php_mhash.h 
  Log:
  - unicode upgrade
  - use current parameter parsing API
  - added keygen constants
  - Added keygen functions: mhash_keygen_count, mhash_get_keygen_name,
mhash_keygen_uses_hash, mhash_keygen_uses_salt, mhash_get_keygen_salt_size,
mhash_keygen
  
  http://cvs.php.net/viewvc.cgi/php-src/ext/mhash/mhash.c?r1=1.52&r2=1.53&diff_format=u
Index: php-src/ext/mhash/mhash.c
diff -u php-src/ext/mhash/mhash.c:1.52 php-src/ext/mhash/mhash.c:1.53
--- php-src/ext/mhash/mhash.c:1.52  Sat Oct  7 22:55:18 2006
+++ php-src/ext/mhash/mhash.c   Wed Nov 15 17:16:04 2006
@@ -16,7 +16,7 @@
|  Nikos Mavroyanopoulos <[EMAIL PROTECTED]> (HMAC, KEYGEN)   |
+--+
  */
-/* $Id: mhash.c,v 1.52 2006/10/07 22:55:18 bjori Exp $ */
+/* $Id: mhash.c,v 1.53 2006/11/15 17:16:04 mike Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -28,17 +28,23 @@
 
 #include "fcntl.h"
 #include "php_mhash.h"
-#include "mhash.h"
 #include "php_ini.h"
 #include "php_globals.h"
 #include "ext/standard/info.h"
 
 zend_function_entry mhash_functions[] = {
+   PHP_FE(mhash_count, NULL)
PHP_FE(mhash_get_block_size, NULL)
PHP_FE(mhash_get_hash_name, NULL)
-   PHP_FE(mhash_keygen_s2k, NULL)
-   PHP_FE(mhash_count, NULL)
+   PHP_FE(mhash_keygen_count, NULL)
+   PHP_FE(mhash_get_keygen_name, NULL)
+   PHP_FE(mhash_keygen_uses_hash, NULL)
+   PHP_FE(mhash_keygen_uses_salt, NULL)
+   PHP_FE(mhash_get_keygen_salt_size, NULL)
+   PHP_FE(mhash_keygen_uses_count, NULL)
PHP_FE(mhash, NULL)
+   PHP_FE(mhash_keygen, NULL)
+   PHP_FE(mhash_keygen_s2k, NULL)
{NULL, NULL, NULL}
 };
 
@@ -57,46 +63,151 @@
 ZEND_GET_MODULE(mhash)
 #endif
 
-/* SALTED S2K uses a fixed salt */
-#define SALT_SIZE 8
+#define NO_ARGS() (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, 
""))
+
+extern const unsigned char *mhash_get_hash_name_static(hashid hash);
+extern const unsigned char *mhash_get_keygen_name_static(keygenid keygen);
+
+/* {{{ int php_mhash */
+int php_mhash(hashid hash, const char *input_str, int input_len, const char 
*key_str, int key_len, char **enc, int *len TSRMLS_DC)
+{
+   size_t pbsize;
+   char *result;
+   MHASH mh;
+   
+   if (key_len) {
+   if (!(pbsize = mhash_get_hash_pblock(hash))) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, "HMAC 
incompatible hash algorithm");
+   return FAILURE;
+   }
+   mh = mhash_hmac_init(hash, (char *) key_str, key_len, pbsize);
+   } else {
+   mh = mhash_init(hash);
+   }
+
+   if (mh == MHASH_FAILED) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, "mhash 
initialization failed");
+   return FAILURE;
+   }
+
+   mhash(mh, input_str, input_len);
+
+   if (key_len) {
+   result = mhash_hmac_end(mh);
+   } else {
+   result = mhash_end(mh);
+   }
+   
+   if (!result) {
+   return FAILURE;
+   }
+   
+   *len = mhash_get_block_size(hash);
+   *enc = estrndup(result, *len);
+   
+   mhash_free(result);
+   
+   return SUCCESS;
+}
+/* }}} */
+
+/* {{{ int php_mhash_keygen */
+int php_mhash_keygen(keygenid type, hashid hash1, hashid hash2, const char 
*pass_str, int pass_len, const char *salt_str, size_t salt_len, char **key, int 
*len, int max_len, int max_count TSRMLS_DC)
+{
+   KEYGEN keygen;
+   
+   if (type < 0 || type > mhash_keygen_count()) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, "unknown keygen 
type %d", type);
+   return FAILURE;
+   }
+   
+   memset(&keygen, 0, sizeof(keygen));
+   
+   if (mhash_keygen_uses_hash_algorithm(type)) {
+   if (hash1 == -1) {
+   hash1 = hash2;
+   }
+   if (hash2 == -1) {
+   hash2 = hash1;
+   }
+   keygen.hash_algorithm[0] = hash1;
+   keygen.hash_algorithm[1] = hash2;
+   }
+   
+   if (mhash_keygen_uses_salt(type)) {
+   if (salt_len <= 0) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s 
requires a salt", mhash_get_keygen_name_static(type));
+   return FAILURE;
+   }
+   keygen.salt = (void *) salt_str;
+   keygen.salt_size = salt_len;
+   }
+   
+   keygen.count = max_count;
+   
+   if (max_len > 0) {
+   *len = max_len;
+   } else {
+   *len = 128;
+   }
+   
+   *key = emalloc(*len + 1);
+   
+   if (mhash_keygen_ext(type, keygen, *key, *len, (void *) pass_str, 
pass_len) < 0) {
+   

[PHP-CVS] cvs: php-src /ext/gettext gettext.c /ext/gettext/tests dcngettext.phpt gettext_basic.phpt gettext_basic_de.phpt /ext/gettext/tests/locale/de/LC_MESSAGES messages.mo messages.po

2006-11-15 Thread Michael Wallner
mikeWed Nov 15 17:14:50 2006 UTC

  Added files: 
/php-src/ext/gettext/tests  gettext_basic_de.phpt 
/php-src/ext/gettext/tests/locale/de/LC_MESSAGESmessages.mo 
messages.po 

  Modified files:  
/php-src/ext/gettextgettext.c 
/php-src/ext/gettext/tests  dcngettext.phpt gettext_basic.phpt 
  Log:
  - unicode upgrade
  # as setlocale() throws an E_STRICT deprecated warning, I guess we'll
see ICU message catalogue support?
  
  http://cvs.php.net/viewvc.cgi/php-src/ext/gettext/gettext.c?r1=1.50&r2=1.51&diff_format=u
Index: php-src/ext/gettext/gettext.c
diff -u php-src/ext/gettext/gettext.c:1.50 php-src/ext/gettext/gettext.c:1.51
--- php-src/ext/gettext/gettext.c:1.50  Tue Sep  5 10:35:53 2006
+++ php-src/ext/gettext/gettext.c   Wed Nov 15 17:14:50 2006
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: gettext.c,v 1.50 2006/09/05 10:35:53 tony2001 Exp $ */
+/* $Id: gettext.c,v 1.51 2006/11/15 17:14:50 mike Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -151,224 +151,175 @@
php_info_print_table_end();
 }
 
-/* {{{ proto string textdomain(string domain)
+/* {{{ proto string textdomain(string domain) U
Set the textdomain to "domain". Returns the current domain */
 PHP_NAMED_FUNCTION(zif_textdomain)
 {
-   zval **domain;
-   char *domain_name, *retval;
-   char *val;
-
-   if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &domain) == 
FAILURE) {
-   WRONG_PARAM_COUNT;
-   }
-   convert_to_string_ex(domain);
-
-   val = Z_STRVAL_PP(domain);
-   if (strcmp(val, "") && strcmp(val, "0")) {
-   domain_name = val;
-   } else {
-   domain_name = NULL;
+   char *domain_str;
+   int domain_len;
+   
+   if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s&", 
&domain_str, &domain_len, ZEND_U_CONVERTER(UG(filesystem_encoding_conv {
+   return;
}
-
-   retval = textdomain(domain_name);
-
-   RETURN_STRING(retval, 1);
+   
+   if (!domain_len || (domain_len == 1 && *domain_str == '0')) {
+   domain_str = NULL;
+   }
+   RETURN_ASCII_STRING(textdomain(domain_str), 1);
 }
 /* }}} */
 
-/* {{{ proto string gettext(string msgid)
+/* {{{ proto binary gettext(string msgid) U
Return the translation of msgid for the current domain, or msgid unaltered 
if a translation does not exist */
 PHP_NAMED_FUNCTION(zif_gettext)
 {
-   zval **msgid;
-   char *msgstr;
-
-   if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &msgid) == 
FAILURE) {
-   WRONG_PARAM_COUNT;
+   char *msgid_str;
+   int msgid_len;
+   
+   if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s&", 
&msgid_str, &msgid_len, UG(ascii_conv))) {
+   return;
}
-   convert_to_string_ex(msgid);
-
-   msgstr = gettext(Z_STRVAL_PP(msgid));
-
-   RETURN_STRING(msgstr, 1);
+   RETURN_STRING(gettext(msgid_str), 1);
 }
 /* }}} */
 
-/* {{{ proto string dgettext(string domain_name, string msgid)
+/* {{{ proto binary dgettext(string domain_name, string msgid) U
Return the translation of msgid for domain_name, or msgid unaltered if a 
translation does not exist */
 PHP_NAMED_FUNCTION(zif_dgettext)
 {
-   zval **domain_name, **msgid;
-   char *msgstr;
-
-   if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &domain_name, 
&msgid) == FAILURE) {
-   WRONG_PARAM_COUNT;
+   char *domain_str, *msgid_str;
+   int domain_len, msgid_len;
+   
+   if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s&s&", 
&domain_str, &domain_len, ZEND_U_CONVERTER(UG(filesystem_encoding_conv)), 
&msgid_str, &msgid_len, UG(ascii_conv))) {
+   return;
}
-   convert_to_string_ex(domain_name);
-   convert_to_string_ex(msgid);
-
-   msgstr = dgettext(Z_STRVAL_PP(domain_name), Z_STRVAL_PP(msgid));
-
-   RETURN_STRING(msgstr, 1);
+   RETURN_STRING(dgettext(domain_str, msgid_str), 1);
 }
 /* }}} */
 
-/* {{{ proto string dcgettext(string domain_name, string msgid, long category)
+/* {{{ proto binary dcgettext(string domain_name, string msgid, int category) U
Return the translation of msgid for domain_name and category, or msgid 
unaltered if a translation does not exist */
 PHP_NAMED_FUNCTION(zif_dcgettext)
 {
-   zval **domain_name, **msgid, **category;
-   char *msgstr;
-
-   if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, &domain_name, 
&msgid, &category) == FAILURE) {
-   WRONG_PARAM_COUNT;
+   char *domain_str, *msgid_str;
+   int domain_len, msgid_len;
+   long category;
+   
+   if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, 
"s&s&l", &domain_str, &domain_len, 
ZEND_U_CONVERTE

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

2006-11-15 Thread Pierre-Alain Joye
pajoye  Wed Nov 15 16:24:24 2006 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/zip/libzip_open.c 
  Log:
  #39506 and PECL #9278, should fix the problem for the other SAPI (works for 
CLI, CGI and embed)
  see: http://news.php.net/php.internals/26606 for the details
  
http://cvs.php.net/viewvc.cgi/php-src/ext/zip/lib/zip_open.c?r1=1.1.2.1&r2=1.1.2.2&diff_format=u
Index: php-src/ext/zip/lib/zip_open.c
diff -u php-src/ext/zip/lib/zip_open.c:1.1.2.1 
php-src/ext/zip/lib/zip_open.c:1.1.2.2
--- php-src/ext/zip/lib/zip_open.c:1.1.2.1  Sun Aug 13 21:09:59 2006
+++ php-src/ext/zip/lib/zip_open.c  Wed Nov 15 16:24:24 2006
@@ -75,6 +75,10 @@
return NULL;
 }
 
+#ifdef PHP_WIN32 
+   _fmode = _O_BINARY;
+#endif
+
 if (flags & ZIP_OVERWRITE || stat(fn, &st) != 0) {
if ((flags & ZIP_CREATE) || (flags & ZIP_OVERWRITE)) {
if ((za=_zip_new(&error)) == NULL) {

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



[PHP-CVS] cvs: php-src /sapi/cgi cgi_main.c

2006-11-15 Thread Dmitry Stogov
dmitry  Wed Nov 15 13:34:05 2006 UTC

  Modified files:  
/php-src/sapi/cgi   cgi_main.c 
  Log:
  Removed unnecessary getenv/putenv calls
  
  
http://cvs.php.net/viewvc.cgi/php-src/sapi/cgi/cgi_main.c?r1=1.304&r2=1.305&diff_format=u
Index: php-src/sapi/cgi/cgi_main.c
diff -u php-src/sapi/cgi/cgi_main.c:1.304 php-src/sapi/cgi/cgi_main.c:1.305
--- php-src/sapi/cgi/cgi_main.c:1.304   Wed Nov 15 11:14:27 2006
+++ php-src/sapi/cgi/cgi_main.c Wed Nov 15 13:34:05 2006
@@ -21,7 +21,7 @@
+--+
 */
 
-/* $Id: cgi_main.c,v 1.304 2006/11/15 11:14:27 dmitry Exp $ */
+/* $Id: cgi_main.c,v 1.305 2006/11/15 13:34:05 dmitry Exp $ */
 
 #include "php.h"
 #include "php_globals.h"
@@ -736,35 +736,19 @@
 
if (CGIG(fix_pathinfo)) {
struct stat st;
+   char *real_path;
char *env_redirect_url = 
sapi_cgibin_getenv("REDIRECT_URL", sizeof("REDIRECT_URL")-1 TSRMLS_CC);
char *env_document_root = 
sapi_cgibin_getenv("DOCUMENT_ROOT", sizeof("DOCUMENT_ROOT")-1 TSRMLS_CC);
-
-   /* save the originals first for anything we change 
later */
-   if (env_path_translated) {
-   _sapi_cgibin_putenv("ORIG_PATH_TRANSLATED", 
env_path_translated TSRMLS_CC);
-   }
-   if (env_path_info) {
-   _sapi_cgibin_putenv("ORIG_PATH_INFO", 
env_path_info TSRMLS_CC);
-   }
-   if (env_script_name) {
-   _sapi_cgibin_putenv("ORIG_SCRIPT_NAME", 
env_script_name TSRMLS_CC);
-   }
-   if (env_script_filename) {
-   _sapi_cgibin_putenv("ORIG_SCRIPT_FILENAME", 
env_script_filename TSRMLS_CC);
-   }
-   if (!env_document_root) {
-   /* ini version of document root */
-   if (!env_document_root) {
-   env_document_root = PG(doc_root);
-   }
-   /* set the document root, this makes a more
-  consistent env for php scripts */
-   if (env_document_root) {
-   env_document_root = 
_sapi_cgibin_putenv("DOCUMENT_ROOT", env_document_root TSRMLS_CC);
-   /* fix docroot */
-   TRANSLATE_SLASHES(env_document_root);
-   }
-   }
+   char *orig_path_translated = env_path_translated;
+   char *orig_path_info = env_path_info;
+   char *orig_script_name = env_script_name;
+   char *orig_script_filename = env_script_filename;
+
+   if (!env_document_root && PG(doc_root)) {
+   env_document_root = 
_sapi_cgibin_putenv("DOCUMENT_ROOT", PG(doc_root) TSRMLS_CC);
+   /* fix docroot */
+   TRANSLATE_SLASHES(env_document_root);
+   }
 
if (env_path_translated != NULL && env_redirect_url != 
NULL) {
/* 
@@ -774,7 +758,7 @@
*/
script_path_translated = env_path_translated;
/* we correct SCRIPT_NAME now in case we don't 
have PATH_INFO */
-   env_script_name = 
_sapi_cgibin_putenv("SCRIPT_NAME", env_redirect_url TSRMLS_CC);
+   env_script_name = env_redirect_url;
}
 
 #ifdef __riscos__
@@ -788,7 +772,8 @@
 * of it by stat'ing back through the '/'
 * this fixes url's like /info.php/test
 */
-   if (script_path_translated && 
stat(script_path_translated, &st) == -1 ) {
+   if (script_path_translated &&
+   (real_path = tsrm_realpath(script_path_translated, 
NULL TSRMLS_CC)) == NULL) {
char *pt = estrdup(script_path_translated);
int len = strlen(pt);
char *ptr;
@@ -815,8 +800,19 @@
int pilen = 
strlen(env_path_info);
char *path_info = env_path_info 
+ pilen - slen;
 
-   env_path_info = 
_sapi_cgibin_putenv("PATH_INFO", path_info TSRMLS_CC);
-   script_path_translated = 
_sapi_cgibin_putenv("SCRIP

[PHP-CVS] cvs: php-src(PHP_5_2) /sapi/cgi cgi_main.c

2006-11-15 Thread Dmitry Stogov
dmitry  Wed Nov 15 13:33:41 2006 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/sapi/cgi   cgi_main.c 
  Log:
  Removed unnecessary getenv/putenv calls
  
  
http://cvs.php.net/viewvc.cgi/php-src/sapi/cgi/cgi_main.c?r1=1.267.2.15.2.17&r2=1.267.2.15.2.18&diff_format=u
Index: php-src/sapi/cgi/cgi_main.c
diff -u php-src/sapi/cgi/cgi_main.c:1.267.2.15.2.17 
php-src/sapi/cgi/cgi_main.c:1.267.2.15.2.18
--- php-src/sapi/cgi/cgi_main.c:1.267.2.15.2.17 Wed Nov 15 11:13:02 2006
+++ php-src/sapi/cgi/cgi_main.c Wed Nov 15 13:33:41 2006
@@ -21,7 +21,7 @@
+--+
 */
 
-/* $Id: cgi_main.c,v 1.267.2.15.2.17 2006/11/15 11:13:02 dmitry Exp $ */
+/* $Id: cgi_main.c,v 1.267.2.15.2.18 2006/11/15 13:33:41 dmitry Exp $ */
 
 #include "php.h"
 #include "php_globals.h"
@@ -762,33 +762,17 @@
char *env_document_root = sapi_cgibin_getenv("DOCUMENT_ROOT", 
sizeof("DOCUMENT_ROOT")-1 TSRMLS_CC);
 
if (CGIG(fix_pathinfo)) {
-
-   /* save the originals first for anything we change 
later */
-   if (env_path_translated) {
-   _sapi_cgibin_putenv("ORIG_PATH_TRANSLATED", 
env_path_translated TSRMLS_CC);
-   }
-   if (env_path_info) {
-   _sapi_cgibin_putenv("ORIG_PATH_INFO", 
env_path_info TSRMLS_CC);
-   }
-   if (env_script_name) {
-   _sapi_cgibin_putenv("ORIG_SCRIPT_NAME", 
env_script_name TSRMLS_CC);
-   }
-   if (env_script_filename) {
-   _sapi_cgibin_putenv("ORIG_SCRIPT_FILENAME", 
env_script_filename TSRMLS_CC);
-   }
-   if (!env_document_root) {
-   /* ini version of document root */
-   if (!env_document_root) {
-   env_document_root = PG(doc_root);
-   }
-   /* set the document root, this makes a more
-  consistent env for php scripts */
-   if (env_document_root) {
-   env_document_root = 
_sapi_cgibin_putenv("DOCUMENT_ROOT", env_document_root TSRMLS_CC);
-   /* fix docroot */
-   TRANSLATE_SLASHES(env_document_root);
-   }
-   }
+   char *real_path;
+   char *orig_path_translated = env_path_translated;
+   char *orig_path_info = env_path_info;
+   char *orig_script_name = env_script_name;
+   char *orig_script_filename = env_script_filename;
+
+   if (!env_document_root && PG(doc_root)) {
+   env_document_root = 
_sapi_cgibin_putenv("DOCUMENT_ROOT", PG(doc_root) TSRMLS_CC);
+   /* fix docroot */
+   TRANSLATE_SLASHES(env_document_root);
+   }
 
if (env_path_translated != NULL && env_redirect_url != 
NULL) {
/* 
@@ -798,7 +782,7 @@
*/
script_path_translated = env_path_translated;
/* we correct SCRIPT_NAME now in case we don't 
have PATH_INFO */
-   env_script_name = 
_sapi_cgibin_putenv("SCRIPT_NAME", env_redirect_url TSRMLS_CC);
+   env_script_name = env_redirect_url;
}
 
 #ifdef __riscos__
@@ -812,7 +796,8 @@
 * of it by stat'ing back through the '/'
 * this fixes url's like /info.php/test
 */
-   if (script_path_translated && 
stat(script_path_translated, &st) == -1 ) {
+   if (script_path_translated &&
+   (real_path = tsrm_realpath(script_path_translated, 
NULL TSRMLS_CC)) == NULL) {
char *pt = estrdup(script_path_translated);
int len = strlen(pt);
char *ptr;
@@ -839,8 +824,19 @@
int pilen = 
strlen(env_path_info);
char *path_info = env_path_info 
+ pilen - slen;
 
-   env_path_info = 
_sapi_cgibin_putenv("PATH_INFO", path_info TSRMLS_CC);
-   script_path_translated = 
_sapi_cgibin_putenv("SCRIPT_FILENAME", pt TSRMLS_CC);
+   if (orig

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

2006-11-15 Thread Rob Richards
rrichards   Wed Nov 15 12:27:32 2006 UTC

  Modified files:  
/php-src/ext/xmlxml.c 
  Log:
  mark more functions unicode compatible
  
http://cvs.php.net/viewvc.cgi/php-src/ext/xml/xml.c?r1=1.168&r2=1.169&diff_format=u
Index: php-src/ext/xml/xml.c
diff -u php-src/ext/xml/xml.c:1.168 php-src/ext/xml/xml.c:1.169
--- php-src/ext/xml/xml.c:1.168 Wed Nov 15 12:08:12 2006
+++ php-src/ext/xml/xml.c   Wed Nov 15 12:27:32 2006
@@ -18,7 +18,7 @@
+--+
  */
 
-/* $Id: xml.c,v 1.168 2006/11/15 12:08:12 rrichards Exp $ */
+/* $Id: xml.c,v 1.169 2006/11/15 12:27:32 rrichards Exp $ */
 
 #define IS_EXT_MODULE
 
@@ -1231,7 +1231,7 @@
 }
 /* }}} */
 
-/* {{{ proto int xml_set_element_handler(resource parser, string shdl, string 
ehdl) 
+/* {{{ proto int xml_set_element_handler(resource parser, string shdl, string 
ehdl) U
Set up start and end element handlers */
 PHP_FUNCTION(xml_set_element_handler)
 {
@@ -1252,7 +1252,7 @@
 }
 /* }}} */
 
-/* {{{ proto int xml_set_character_data_handler(resource parser, string hdl) 
+/* {{{ proto int xml_set_character_data_handler(resource parser, string hdl) U
Set up character data handler */
 PHP_FUNCTION(xml_set_character_data_handler)
 {
@@ -1271,7 +1271,7 @@
 }
 /* }}} */
 
-/* {{{ proto int xml_set_processing_instruction_handler(resource parser, 
string hdl) 
+/* {{{ proto int xml_set_processing_instruction_handler(resource parser, 
string hdl) U
Set up processing instruction (PI) handler */
 PHP_FUNCTION(xml_set_processing_instruction_handler)
 {
@@ -1290,7 +1290,7 @@
 }
 /* }}} */
 
-/* {{{ proto int xml_set_default_handler(resource parser, string hdl) 
+/* {{{ proto int xml_set_default_handler(resource parser, string hdl) U
Set up default handler */
 PHP_FUNCTION(xml_set_default_handler)
 {
@@ -1308,7 +1308,7 @@
 }
 /* }}} */
 
-/* {{{ proto int xml_set_unparsed_entity_decl_handler(resource parser, string 
hdl) 
+/* {{{ proto int xml_set_unparsed_entity_decl_handler(resource parser, string 
hdl) U
Set up unparsed entity declaration handler */
 PHP_FUNCTION(xml_set_unparsed_entity_decl_handler)
 {
@@ -1327,7 +1327,7 @@
 }
 /* }}} */
 
-/* {{{ proto int xml_set_notation_decl_handler(resource parser, string hdl) 
+/* {{{ proto int xml_set_notation_decl_handler(resource parser, string hdl) U
Set up notation declaration handler */
 PHP_FUNCTION(xml_set_notation_decl_handler)
 {
@@ -1345,7 +1345,7 @@
 }
 /* }}} */
 
-/* {{{ proto int xml_set_external_entity_ref_handler(resource parser, string 
hdl) 
+/* {{{ proto int xml_set_external_entity_ref_handler(resource parser, string 
hdl) U
Set up external entity reference handler */
 PHP_FUNCTION(xml_set_external_entity_ref_handler)
 {
@@ -1363,7 +1363,7 @@
 }
 /* }}} */
 
-/* {{{ proto int xml_set_start_namespace_decl_handler(resource parser, string 
hdl) 
+/* {{{ proto int xml_set_start_namespace_decl_handler(resource parser, string 
hdl) U
Set up character data handler */
 PHP_FUNCTION(xml_set_start_namespace_decl_handler)
 {
@@ -1382,7 +1382,7 @@
 }
 /* }}} */
 
-/* {{{ proto int xml_set_end_namespace_decl_handler(resource parser, string 
hdl) 
+/* {{{ proto int xml_set_end_namespace_decl_handler(resource parser, string 
hdl) U
Set up character data handler */
 PHP_FUNCTION(xml_set_end_namespace_decl_handler)
 {
@@ -1658,7 +1658,7 @@
 }
 /* }}} */
 
-/* {{{ proto string utf8_encode(string data) 
+/* {{{ proto string utf8_encode(string data) U
Encodes an ISO-8859-1 string to UTF-8 */
 PHP_FUNCTION(utf8_encode)
 {
@@ -1690,7 +1690,7 @@
 }
 /* }}} */
 
-/* {{{ proto string utf8_decode(string data) 
+/* {{{ proto string utf8_decode(string data) U
Converts a UTF-8 encoded string to ISO-8859-1 */
 PHP_FUNCTION(utf8_decode)
 {

-- 
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/standard/tests/file fwrite.phpt

2006-11-15 Thread Antony Dovgal
tony2001Wed Nov 15 12:11:17 2006 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/standard/tests/filefwrite.phpt 
  Log:
  fix test on AIX
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/file/fwrite.phpt?r1=1.1.2.2&r2=1.1.2.3&diff_format=u
Index: php-src/ext/standard/tests/file/fwrite.phpt
diff -u php-src/ext/standard/tests/file/fwrite.phpt:1.1.2.2 
php-src/ext/standard/tests/file/fwrite.phpt:1.1.2.3
--- php-src/ext/standard/tests/file/fwrite.phpt:1.1.2.2 Tue Nov 14 21:59:57 2006
+++ php-src/ext/standard/tests/file/fwrite.phpt Wed Nov 15 12:11:17 2006
@@ -15,7 +15,7 @@
 
 $fp = fopen($filename, "w");
 var_dump(fwrite($fp, "data", -1));
-var_dump(fwrite($fp, "data", 100));
+var_dump(fwrite($fp, "data", 10));
 fclose($fp);
 
 var_dump(fwrite($fp, "data", -1));

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



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

2006-11-15 Thread Antony Dovgal
tony2001Wed Nov 15 12:11:07 2006 UTC

  Modified files:  
/php-src/ext/standard/tests/filefwrite.phpt 
  Log:
  fix test on AIX
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/file/fwrite.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/ext/standard/tests/file/fwrite.phpt
diff -u php-src/ext/standard/tests/file/fwrite.phpt:1.1 
php-src/ext/standard/tests/file/fwrite.phpt:1.2
--- php-src/ext/standard/tests/file/fwrite.phpt:1.1 Tue Nov 14 21:59:02 2006
+++ php-src/ext/standard/tests/file/fwrite.phpt Wed Nov 15 12:11:07 2006
@@ -15,7 +15,7 @@
 
 $fp = fopen($filename, "w");
 var_dump(fwrite($fp, b"data", -1));
-var_dump(fwrite($fp, b"data", 100));
+var_dump(fwrite($fp, b"data", 10));
 fclose($fp);
 
 var_dump(fwrite($fp, b"data", -1));

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



[PHP-CVS] cvs: php-src /ext/xml xml.c /ext/xml/tests bug25666.phpt bug26528.phpt bug32001.phpt bug35447.phpt xml006.phpt xml009.phpt

2006-11-15 Thread Rob Richards
rrichards   Wed Nov 15 12:08:12 2006 UTC

  Modified files:  
/php-src/ext/xmlxml.c 
/php-src/ext/xml/tests  bug25666.phpt bug26528.phpt bug32001.phpt 
bug35447.phpt xml006.phpt xml009.phpt 
  Log:
  add unicode support so Andrei finally stops asking me about it
  update tests
  http://cvs.php.net/viewvc.cgi/php-src/ext/xml/xml.c?r1=1.167&r2=1.168&diff_format=u
Index: php-src/ext/xml/xml.c
diff -u php-src/ext/xml/xml.c:1.167 php-src/ext/xml/xml.c:1.168
--- php-src/ext/xml/xml.c:1.167 Sun Oct  8 13:34:24 2006
+++ php-src/ext/xml/xml.c   Wed Nov 15 12:08:12 2006
@@ -18,7 +18,7 @@
+--+
  */
 
-/* $Id: xml.c,v 1.167 2006/10/08 13:34:24 bjori Exp $ */
+/* $Id: xml.c,v 1.168 2006/11/15 12:08:12 rrichards Exp $ */
 
 #define IS_EXT_MODULE
 
@@ -285,18 +285,19 @@
 static zval *_xml_string_zval(const char *str)
 {
zval *ret;
-   int len = strlen(str);
+   TSRMLS_FETCH();
+
MAKE_STD_ZVAL(ret);
 
-   Z_TYPE_P(ret) = IS_STRING;
-   Z_STRLEN_P(ret) = len;
-   Z_STRVAL_P(ret) = estrndup(str, len);
+   ZVAL_UTF8_STRING(ret, (char *)str, ZSTR_DUPLICATE);
return ret;
 }
 
 static zval *_xml_xmlchar_zval(const XML_Char *s, int len, const XML_Char 
*encoding)
 {
zval *ret;
+   TSRMLS_FETCH();
+
MAKE_STD_ZVAL(ret);

if (s == NULL) {
@@ -306,8 +307,14 @@
if (len == 0) {
len = _xml_xmlcharlen(s);
}
-   Z_TYPE_P(ret) = IS_STRING;
-   Z_STRVAL_P(ret) = xml_utf8_decode(s, len, &Z_STRLEN_P(ret), encoding);
+
+   if (UG(unicode)) {
+   ZVAL_UTF8_STRINGL(ret, (char *)s, len, ZSTR_DUPLICATE);
+   } else {
+   Z_TYPE_P(ret) = IS_STRING;
+   Z_STRVAL_P(ret) = xml_utf8_decode(s, len, &Z_STRLEN_P(ret), 
encoding);
+   }
+
return ret;
 }
 /* }}} */
@@ -428,12 +435,12 @@
zval **method;
zval **obj;
 
-   if (Z_TYPE_P(handler) == IS_STRING) {
-   php_error_docref(NULL TSRMLS_CC, E_WARNING, 
"Unable to call handler %s()", Z_STRVAL_P(handler));
+   if (Z_TYPE_P(handler) == IS_STRING || Z_TYPE_P(handler) 
== IS_UNICODE) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, 
"Unable to call handler %R()", Z_TYPE_P(handler), Z_UNIVAL_P(handler));
} else if (zend_hash_index_find(Z_ARRVAL_P(handler), 0, 
(void **) &obj) == SUCCESS &&
   
zend_hash_index_find(Z_ARRVAL_P(handler), 1, (void **) &method) == SUCCESS &&
   Z_TYPE_PP(obj) == IS_OBJECT &&
-  Z_TYPE_PP(method) == IS_STRING) {
+  (Z_TYPE_PP(method) == IS_STRING || 
Z_TYPE_PP(method) == IS_UNICODE)) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, 
"Unable to call handler %v::%R()", Z_OBJCE_PP(obj)->name, Z_TYPE_PP(method), 
Z_UNIVAL_PP(method));
} else 
php_error_docref(NULL TSRMLS_CC, E_WARNING, 
"Unable to call handler");
@@ -562,11 +569,15 @@
char *newbuf = emalloc(len + 1);
unsigned short c;
char (*decoder)(unsigned short) = NULL;
-   xml_encoding *enc = xml_get_encoding(encoding);
+   xml_encoding *enc = NULL;
 
*newlen = 0;
-   if (enc) {
-   decoder = enc->decoding_function;
+
+   if (encoding) {
+   enc = xml_get_encoding(encoding);
+   if (enc) {
+   decoder = enc->decoding_function;
+   }
}
if (decoder == NULL) {
/* If the target encoding was unknown, or no decoder function
@@ -661,7 +672,13 @@
char *newstr;
int out_len;
 
-   newstr = xml_utf8_decode(tag, strlen(tag), &out_len, 
parser->target_encoding);
+   TSRMLS_FETCH();
+
+   if (UG(unicode)) {
+   newstr = xml_utf8_decode(tag, strlen(tag), &out_len, NULL);
+   } else {
+   newstr = xml_utf8_decode(tag, strlen(tag), &out_len, 
parser->target_encoding);
+   }
 
if (parser->case_folding) {
php_strtoupper(newstr, out_len);
@@ -682,6 +699,8 @@
zval *retval, *args[3];
 
if (parser) {
+   TSRMLS_FETCH();
+
parser->level++;
 
tag_name = _xml_decode_tag(parser, name);
@@ -694,9 +713,13 @@
 
while (attributes && *attributes) {
att = _xml_decode_tag(parser, attributes[0]);
-   val = xml_utf8_decode(attributes[1], 
strlen(attributes[1]), &val_len, parser->target_encoding);
+   if (UG(unicode)) {
+   

[PHP-CVS] cvs: php-src /sapi/cgi cgi_main.c

2006-11-15 Thread Dmitry Stogov
dmitry  Wed Nov 15 11:14:27 2006 UTC

  Modified files:  
/php-src/sapi/cgi   cgi_main.c 
  Log:
  Fixed wrong ext/filter behavior. It might not to register FastCGI environment 
variables and make memory leaks.
  
  
http://cvs.php.net/viewvc.cgi/php-src/sapi/cgi/cgi_main.c?r1=1.303&r2=1.304&diff_format=u
Index: php-src/sapi/cgi/cgi_main.c
diff -u php-src/sapi/cgi/cgi_main.c:1.303 php-src/sapi/cgi/cgi_main.c:1.304
--- php-src/sapi/cgi/cgi_main.c:1.303   Tue Nov 14 10:32:11 2006
+++ php-src/sapi/cgi/cgi_main.c Wed Nov 15 11:14:27 2006
@@ -21,7 +21,7 @@
+--+
 */
 
-/* $Id: cgi_main.c,v 1.303 2006/11/14 10:32:11 dmitry Exp $ */
+/* $Id: cgi_main.c,v 1.304 2006/11/15 11:14:27 dmitry Exp $ */
 
 #include "php.h"
 #include "php_globals.h"
@@ -476,13 +476,14 @@
uint var_len;
char **val;
ulong idx;
+   int filter_arg = (array_ptr == 
PG(http_globals)[TRACK_VARS_ENV])?PARSE_ENV:PARSE_SERVER;
 
for (zend_hash_internal_pointer_reset_ex(&request->env, &pos);
 zend_hash_get_current_key_ex(&request->env, &var, 
&var_len, &idx, 0, &pos) == HASH_KEY_IS_STRING &&
 zend_hash_get_current_data_ex(&request->env, (void **) 
&val, &pos) == SUCCESS;
 zend_hash_move_forward_ex(&request->env, &pos)) {
-   int new_val_len;
-   if (sapi_module.input_filter(PARSE_SERVER, var.s, val, 
strlen(*val), &new_val_len TSRMLS_CC)) {
+   unsigned int new_val_len;
+   if (sapi_module.input_filter(filter_arg, var.s, val, 
strlen(*val), &new_val_len TSRMLS_CC)) {
php_register_variable_safe(var.s, *val, 
new_val_len, array_ptr TSRMLS_CC);
}
}
@@ -491,7 +492,7 @@
 
 static void sapi_cgi_register_variables(zval *track_vars_array TSRMLS_DC)
 {
-   int new_val_len;
+   unsigned int new_val_len;
char *val = SG(request_info).request_uri ? SG(request_info).request_uri 
: "";
/* In CGI mode, we consider the environment to be a part of the server
 * variables

-- 
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) /sapi/cgi cgi_main.c

2006-11-15 Thread Dmitry Stogov
dmitry  Wed Nov 15 11:13:03 2006 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/sapi/cgi   cgi_main.c 
  Log:
  Fixed wrong ext/filter behavior. It didn't register FastCGI environment 
variables and made memory leaks.
  
  
http://cvs.php.net/viewvc.cgi/php-src/sapi/cgi/cgi_main.c?r1=1.267.2.15.2.16&r2=1.267.2.15.2.17&diff_format=u
Index: php-src/sapi/cgi/cgi_main.c
diff -u php-src/sapi/cgi/cgi_main.c:1.267.2.15.2.16 
php-src/sapi/cgi/cgi_main.c:1.267.2.15.2.17
--- php-src/sapi/cgi/cgi_main.c:1.267.2.15.2.16 Tue Nov 14 10:31:47 2006
+++ php-src/sapi/cgi/cgi_main.c Wed Nov 15 11:13:02 2006
@@ -21,7 +21,7 @@
+--+
 */
 
-/* $Id: cgi_main.c,v 1.267.2.15.2.16 2006/11/14 10:31:47 dmitry Exp $ */
+/* $Id: cgi_main.c,v 1.267.2.15.2.17 2006/11/15 11:13:02 dmitry Exp $ */
 
 #include "php.h"
 #include "php_globals.h"
@@ -498,6 +498,7 @@
char *var, **val;
uint var_len;
ulong idx;
+   int filter_arg = (array_ptr == 
PG(http_globals)[TRACK_VARS_ENV])?PARSE_ENV:PARSE_SERVER;
 
/* turn off magic_quotes while importing environment variables 
*/
PG(magic_quotes_gpc) = 0;
@@ -505,8 +506,8 @@
 zend_hash_get_current_key_ex(&request->env, &var, 
&var_len, &idx, 0, &pos) == HASH_KEY_IS_STRING &&
 zend_hash_get_current_data_ex(&request->env, (void **) 
&val, &pos) == SUCCESS;
 zend_hash_move_forward_ex(&request->env, &pos)) {
-   int new_val_len;
-   if (sapi_module.input_filter(PARSE_SERVER, var, val, 
strlen(*val), &new_val_len TSRMLS_CC)) {
+   unsigned int new_val_len;
+   if (sapi_module.input_filter(filter_arg, var, val, 
strlen(*val), &new_val_len TSRMLS_CC)) {
php_register_variable_safe(var, *val, 
new_val_len, array_ptr TSRMLS_CC);
}
}
@@ -517,7 +518,7 @@
 
 static void sapi_cgi_register_variables(zval *track_vars_array TSRMLS_DC)
 {
-   int new_val_len;
+   unsigned int new_val_len;
char *val = SG(request_info).request_uri ? SG(request_info).request_uri 
: "";
/* In CGI mode, we consider the environment to be a part of the server
 * variables

-- 
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/standard/tests/file symlink.phpt

2006-11-15 Thread Antony Dovgal
tony2001Wed Nov 15 11:27:26 2006 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/standard/tests/filesymlink.phpt 
  Log:
  fix test
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/file/symlink.phpt?r1=1.1.2.2&r2=1.1.2.3&diff_format=u
Index: php-src/ext/standard/tests/file/symlink.phpt
diff -u php-src/ext/standard/tests/file/symlink.phpt:1.1.2.2 
php-src/ext/standard/tests/file/symlink.phpt:1.1.2.3
--- php-src/ext/standard/tests/file/symlink.phpt:1.1.2.2Tue Nov 14 
22:23:45 2006
+++ php-src/ext/standard/tests/file/symlink.phptWed Nov 15 11:27:26 2006
@@ -5,7 +5,7 @@
 if (substr(PHP_OS, 0, 3) == 'WIN') {
 die('skip no symlinks on Windows');
 }
-?
+?>
 --FILE--
 http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



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

2006-11-15 Thread Antony Dovgal
tony2001Wed Nov 15 11:27:10 2006 UTC

  Modified files:  
/php-src/ext/standard/tests/filesymlink.phpt 
  Log:
  fix test
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/file/symlink.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/ext/standard/tests/file/symlink.phpt
diff -u php-src/ext/standard/tests/file/symlink.phpt:1.1 
php-src/ext/standard/tests/file/symlink.phpt:1.2
--- php-src/ext/standard/tests/file/symlink.phpt:1.1Tue Nov 14 22:23:23 2006
+++ php-src/ext/standard/tests/file/symlink.phptWed Nov 15 11:27:10 2006
@@ -5,7 +5,7 @@
 if (substr(PHP_OS, 0, 3) == 'WIN') {
 die('skip no symlinks on Windows');
 }
-?
+?>
 --FILE--
 
 --EXPECTF--
 bool(true)
-%s(%d) "%ssymlink.dat"
+string(%d) "%ssymlink.dat"
 int(%d)
 
 Warning: readlink(): No such file or directory in %s on line %d
@@ -71,12 +66,21 @@
 Warning: link(): No such file or directory in %s on line %d
 bool(false)
 
-Warning: symlink(): No such file or directory in %s on line %d
+Warning: symlink(): File exists in %s on line %d
 bool(false)
 
-Warning: link(): No such file or directory in %s on line %d
+Warning: link(): %s in %s on line %d
 bool(false)
 
+Warning: readlink(): Invalid argument in %s on line %d
+bool(false)
+int(%d)
+Done
+--UEXPECTF--
+bool(true)
+unicode(%d) "%ssymlink.dat"
+int(%d)
+
 Warning: readlink(): No such file or directory in %s on line %d
 bool(false)
 
@@ -85,8 +89,19 @@
 
 Warning: symlink(): File exists in %s on line %d
 bool(false)
+bool(true)
+
+Warning: symlink(): File exists in %s on line %d
+bool(false)
+bool(true)
+
+Warning: link(): No such file or directory in %s on line %d
+bool(false)
+
+Warning: symlink(): File exists in %s on line %d
+bool(false)
 
-Warning: link(): File exists in %s on line %d
+Warning: link(): %s in %s on line %d
 bool(false)
 
 Warning: readlink(): Invalid argument in %s on line %d

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



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

2006-11-15 Thread Antony Dovgal
tony2001Wed Nov 15 10:48:30 2006 UTC

  Modified files:  
/php-src/ext/standard/tests/filefstat.phpt 
  Log:
  fix test
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/file/fstat.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/ext/standard/tests/file/fstat.phpt
diff -u php-src/ext/standard/tests/file/fstat.phpt:1.1 
php-src/ext/standard/tests/file/fstat.phpt:1.2
--- php-src/ext/standard/tests/file/fstat.phpt:1.1  Tue Nov 14 21:59:02 2006
+++ php-src/ext/standard/tests/file/fstat.phpt  Wed Nov 15 10:48:30 2006
@@ -16,57 +16,57 @@
 --EXPECTF--
 array(26) {
   [0]=>
-  int(%d)
+  int(%i)
   [1]=>
-  int(%d)
+  int(%i)
   [2]=>
-  int(%d)
+  int(%i)
   [3]=>
-  int(%d)
+  int(%i)
   [4]=>
-  int(%d)
+  int(%i)
   [5]=>
-  int(%d)
+  int(%i)
   [6]=>
-  int(%d)
+  int(%i)
   [7]=>
-  int(%d)
+  int(%i)
   [8]=>
-  int(%d)
+  int(%i)
   [9]=>
-  int(%d)
+  int(%i)
   [10]=>
-  int(%d)
+  int(%i)
   [11]=>
-  int(%d)
+  int(%i)
   [12]=>
-  int(%d)
+  int(%i)
   ["dev"]=>
-  int(%d)
+  int(%i)
   ["ino"]=>
-  int(%d)
+  int(%i)
   ["mode"]=>
-  int(%d)
+  int(%i)
   ["nlink"]=>
-  int(%d)
+  int(%i)
   ["uid"]=>
-  int(%d)
+  int(%i)
   ["gid"]=>
-  int(%d)
+  int(%i)
   ["rdev"]=>
-  int(%d)
+  int(%i)
   ["size"]=>
-  int(%d)
+  int(%i)
   ["atime"]=>
-  int(%d)
+  int(%i)
   ["mtime"]=>
-  int(%d)
+  int(%i)
   ["ctime"]=>
-  int(%d)
+  int(%i)
   ["blksize"]=>
-  int(%d)
+  int(%i)
   ["blocks"]=>
-  int(%d)
+  int(%i)
 }
 
 Warning: fstat(): %d is not a valid stream resource in %s on line %d
@@ -75,57 +75,57 @@
 --UEXPECTF--
 array(26) {
   [0]=>
-  int(%d)
+  int(%i)
   [1]=>
-  int(%d)
+  int(%i)
   [2]=>
-  int(%d)
+  int(%i)
   [3]=>
-  int(%d)
+  int(%i)
   [4]=>
-  int(%d)
+  int(%i)
   [5]=>
-  int(%d)
+  int(%i)
   [6]=>
-  int(%d)
+  int(%i)
   [7]=>
-  int(%d)
+  int(%i)
   [8]=>
-  int(%d)
+  int(%i)
   [9]=>
-  int(%d)
+  int(%i)
   [10]=>
-  int(%d)
+  int(%i)
   [11]=>
-  int(%d)
+  int(%i)
   [12]=>
-  int(%d)
+  int(%i)
   [u"dev"]=>
-  int(%d)
+  int(%i)
   [u"ino"]=>
-  int(%d)
+  int(%i)
   [u"mode"]=>
-  int(%d)
+  int(%i)
   [u"nlink"]=>
-  int(%d)
+  int(%i)
   [u"uid"]=>
-  int(%d)
+  int(%i)
   [u"gid"]=>
-  int(%d)
+  int(%i)
   [u"rdev"]=>
-  int(%d)
+  int(%i)
   [u"size"]=>
-  int(%d)
+  int(%i)
   [u"atime"]=>
-  int(%d)
+  int(%i)
   [u"mtime"]=>
-  int(%d)
+  int(%i)
   [u"ctime"]=>
-  int(%d)
+  int(%i)
   [u"blksize"]=>
-  int(%d)
+  int(%i)
   [u"blocks"]=>
-  int(%d)
+  int(%i)
 }
 
 Warning: fstat(): %d is not a valid stream resource in %s on line %d

-- 
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/standard/tests/file fstat.phpt

2006-11-15 Thread Antony Dovgal
tony2001Wed Nov 15 10:47:26 2006 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/standard/tests/filefstat.phpt 
  Log:
  fix test
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/file/fstat.phpt?r1=1.1.2.2&r2=1.1.2.3&diff_format=u
Index: php-src/ext/standard/tests/file/fstat.phpt
diff -u php-src/ext/standard/tests/file/fstat.phpt:1.1.2.2 
php-src/ext/standard/tests/file/fstat.phpt:1.1.2.3
--- php-src/ext/standard/tests/file/fstat.phpt:1.1.2.2  Tue Nov 14 21:59:57 2006
+++ php-src/ext/standard/tests/file/fstat.phpt  Wed Nov 15 10:47:26 2006
@@ -16,57 +16,57 @@
 --EXPECTF--
 array(26) {
   [0]=>
-  int(%d)
+  int(%i)
   [1]=>
-  int(%d)
+  int(%i)
   [2]=>
-  int(%d)
+  int(%i)
   [3]=>
-  int(%d)
+  int(%i)
   [4]=>
-  int(%d)
+  int(%i)
   [5]=>
-  int(%d)
+  int(%i)
   [6]=>
-  int(%d)
+  int(%i)
   [7]=>
-  int(%d)
+  int(%i)
   [8]=>
-  int(%d)
+  int(%i)
   [9]=>
-  int(%d)
+  int(%i)
   [10]=>
-  int(%d)
+  int(%i)
   [11]=>
-  int(%d)
+  int(%i)
   [12]=>
-  int(%d)
+  int(%i)
   ["dev"]=>
-  int(%d)
+  int(%i)
   ["ino"]=>
-  int(%d)
+  int(%i)
   ["mode"]=>
-  int(%d)
+  int(%i)
   ["nlink"]=>
-  int(%d)
+  int(%i)
   ["uid"]=>
-  int(%d)
+  int(%i)
   ["gid"]=>
-  int(%d)
+  int(%i)
   ["rdev"]=>
-  int(%d)
+  int(%i)
   ["size"]=>
-  int(%d)
+  int(%i)
   ["atime"]=>
-  int(%d)
+  int(%i)
   ["mtime"]=>
-  int(%d)
+  int(%i)
   ["ctime"]=>
-  int(%d)
+  int(%i)
   ["blksize"]=>
-  int(%d)
+  int(%i)
   ["blocks"]=>
-  int(%d)
+  int(%i)
 }
 
 Warning: fstat(): %d is not a valid stream resource in %s on line %d

-- 
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_2) /ext/date/lib parse_tz.c

2006-11-15 Thread Antony Dovgal

On 11/15/2006 11:25 AM, Derick Rethans wrote:

On Sat, 11 Nov 2006, Antony Dovgal wrote:


On 11/11/2006 01:27 AM, Hannes Magnusson wrote:
> Hi Nuno
> 
> This patch causes ext/date/tests/timezones.phpt to segfault...


This patch seems to fix it, though I'm not sure it's sane.


Did you fix this yet Nuno?


Yes, he did.

--
Wbr, 
Antony Dovgal


--
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_2) /ext/date/lib parse_tz.c

2006-11-15 Thread Derick Rethans
On Fri, 10 Nov 2006, Nuno Lopes wrote:

> nlopess   Fri Nov 10 23:27:11 2006 UTC
> 
>   Modified files:  (Branch: PHP_5_2)
> /php-src/ext/date/lib parse_tz.c 
>   Log:
>   fix the bug I introduced previously, sorry
>   anyway, convert the recursive version of the binary search to an iterative 
> one

I'd appreciate if you pass this sorta things by me first.

regards,
Derick

-- 
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_2) /ext/date/lib parse_tz.c

2006-11-15 Thread Derick Rethans
On Sat, 11 Nov 2006, Antony Dovgal wrote:

> On 11/11/2006 01:27 AM, Hannes Magnusson wrote:
> > Hi Nuno
> > 
> > This patch causes ext/date/tests/timezones.phpt to segfault...
> 
> This patch seems to fix it, though I'm not sure it's sane.

Did you fix this yet Nuno?

regards,
Derick

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