[PHP-CVS] cvs: php4(PHP_4_3) /ext/mcrypt mcrypt.c /ext/mcrypt/tests bug21039.phpt

2002-12-16 Thread Derick Rethans
derick  Mon Dec 16 04:03:12 2002 EDT

  Added files: (Branch: PHP_4_3)
/php4/ext/mcrypt/tests  bug21039.phpt 

  Modified files:  
/php4/ext/mcryptmcrypt.c 
  Log:
  - Fix bug #21039
  #- This is somewhat of a hack, and thus I will not merge it to HEAD, as
  #  I've lots of other commits waiting for that. 
  
  
Index: php4/ext/mcrypt/mcrypt.c
diff -u php4/ext/mcrypt/mcrypt.c:1.77.4.1 php4/ext/mcrypt/mcrypt.c:1.77.4.2
--- php4/ext/mcrypt/mcrypt.c:1.77.4.1   Fri Nov 29 10:57:39 2002
+++ php4/ext/mcrypt/mcrypt.cMon Dec 16 04:03:09 2002
@@ -16,7 +16,7 @@
|  Derick Rethans [EMAIL PROTECTED]  |
+--+
  */
-/* $Id: mcrypt.c,v 1.77.4.1 2002/11/29 15:57:39 derick Exp $ */
+/* $Id: mcrypt.c,v 1.77.4.2 2002/12/16 09:03:09 derick Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -182,6 +182,13 @@
WRONG_PARAM_COUNT; 
 \
}
 
+#define MCRYPT_CHECK_PARAM_COUNT_EX(a,b)  
+ \
+   if (argc  (a) || argc  (b)) {
+ \
+   zend_get_parameters_ex(1, mcryptind); 
+ \
+   zend_list_delete (Z_LVAL_PP(mcryptind));\
+   WRONG_PARAM_COUNT; 
+ \
+   }
+
 #define MCRYPT_GET_CRYPT_ARGS 
 \
switch (argc) {
 \
case 5:
 \
@@ -455,7 +462,7 @@
int result = 0;

argc = ZEND_NUM_ARGS();
-   MCRYPT_CHECK_PARAM_COUNT (3,3)
+   MCRYPT_CHECK_PARAM_COUNT_EX (3,3)

zend_get_parameters_ex(3, mcryptind, key, iv);
ZEND_FETCH_RESOURCE (td, MCRYPT, mcryptind, -1, MCrypt, le_mcrypt);  
 
@@ -530,7 +537,7 @@
int block_size, data_size;

argc = ZEND_NUM_ARGS();
-   MCRYPT_CHECK_PARAM_COUNT (2,2)
+   MCRYPT_CHECK_PARAM_COUNT_EX (2,2)

zend_get_parameters_ex(2, mcryptind, data);
ZEND_FETCH_RESOURCE (td, MCRYPT, mcryptind, -1, MCrypt, le_mcrypt);
@@ -571,7 +578,7 @@
int block_size, data_size;

argc = ZEND_NUM_ARGS();
-   MCRYPT_CHECK_PARAM_COUNT (2,2)
+   MCRYPT_CHECK_PARAM_COUNT_EX (2,2)

zend_get_parameters_ex(2, mcryptind, data);
ZEND_FETCH_RESOURCE (td, MCRYPT, mcryptind, -1, MCrypt, le_mcrypt);  
 

Index: php4/ext/mcrypt/tests/bug21039.phpt
+++ php4/ext/mcrypt/tests/bug21039.phpt



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




[PHP-CVS] cvs: php4(PHP_4_3) / NEWS

2002-12-16 Thread Derick Rethans
derick  Mon Dec 16 04:10:17 2002 EDT

  Modified files:  (Branch: PHP_4_3)
/php4   NEWS 
  Log:
  - Update NEWS
  
  
Index: php4/NEWS
diff -u php4/NEWS:1.1247.2.25 php4/NEWS:1.1247.2.26
--- php4/NEWS:1.1247.2.25   Thu Dec 12 09:39:07 2002
+++ php4/NEWS   Mon Dec 16 04:10:17 2002
@@ -5,7 +5,6 @@
 - ATTENTION! make install will *by default* install the CLI SAPI binary in 
   {PREFIX}/bin/php. If you don't disable the CGI binary, it will be
   installed as {PREFIX}/bin/php-cgi.
-- Fixed bug #20936 (openssl_pkey_get was broken). ([EMAIL PROTECTED], Wez)
 - Removed extensions: (Jan, Jani, Sebastian)
   . ext/aspell
   . ext/ccvs
@@ -16,6 +15,9 @@
 - Moved extensions to PECL (http://pear.php.net/): (James, Derick)
   . ext/vpopmail
   . ext/cybermut
+- Fixed bug #21039 (crash when not supplying an IV to mcrypt_generit_init).
+  (Derick)
+- Fixed bug #20936 (openssl_pkey_get was broken). ([EMAIL PROTECTED], Wez)
 - Fixed bug #20927 (wordwrap crash). (Ilia)
 - Fixed bug #20796 (when register_globals is on  arrays with same names are
   passed via get/post/cookie the data inside $_GET/$_POST/$_COOKIE can would be



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




[PHP-CVS] cvs: php4(PHP_4_3) / NEWS

2002-12-16 Thread Derick Rethans
derick  Mon Dec 16 04:11:16 2002 EDT

  Modified files:  (Branch: PHP_4_3)
/php4   NEWS 
  Log:
  - Fix typo
  
  
Index: php4/NEWS
diff -u php4/NEWS:1.1247.2.26 php4/NEWS:1.1247.2.27
--- php4/NEWS:1.1247.2.26   Mon Dec 16 04:10:17 2002
+++ php4/NEWS   Mon Dec 16 04:11:15 2002
@@ -15,7 +15,7 @@
 - Moved extensions to PECL (http://pear.php.net/): (James, Derick)
   . ext/vpopmail
   . ext/cybermut
-- Fixed bug #21039 (crash when not supplying an IV to mcrypt_generit_init).
+- Fixed bug #21039 (crash when not supplying an IV to mcrypt_generic_init).
   (Derick)
 - Fixed bug #20936 (openssl_pkey_get was broken). ([EMAIL PROTECTED], Wez)
 - Fixed bug #20927 (wordwrap crash). (Ilia)



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




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

2002-12-16 Thread Marcus Boerger
helly   Mon Dec 16 04:58:50 2002 EDT

  Modified files:  
/php4/ext/exif  exif.c 
  Log:
  change mbstring detection
  
  
Index: php4/ext/exif/exif.c
diff -u php4/ext/exif/exif.c:1.130 php4/ext/exif/exif.c:1.131
--- php4/ext/exif/exif.c:1.130  Sun Dec 15 13:49:07 2002
+++ php4/ext/exif/exif.cMon Dec 16 04:58:49 2002
@@ -17,7 +17,7 @@
+--+
  */
 
-/* $Id: exif.c,v 1.130 2002/12/15 18:49:07 helly Exp $ */
+/* $Id: exif.c,v 1.131 2002/12/16 09:58:49 helly Exp $ */
 
 /*  ToDos
  *
@@ -58,9 +58,11 @@
 #include ext/standard/php_image.h
 #include ext/standard/info.h 
 
-#if defined(HAVE_MBSTRING)  !defined(COMPILE_DL_MBSTRING)
+#if HAVE_MBSTRING
+#if !defined(COMPILE_DL_MBSTRING) 
 #define EXIF_USE_MBSTRING 1
 #endif
+#endif
 
 #ifdef EXIF_USE_MBSTRING
 #include ext/mbstring/mbstring.h
@@ -93,7 +95,7 @@
 };
 /* }}} */
 
-#define EXIF_VERSION 1.4 $Id: exif.c,v 1.130 2002/12/15 18:49:07 helly Exp $
+#define EXIF_VERSION 1.4 $Id: exif.c,v 1.131 2002/12/16 09:58:49 helly Exp $
 
 /* {{{ PHP_MINFO_FUNCTION
  */



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




[PHP-CVS] cvs: php4 /ext/exif exif.c /ext/exif/tests exif002.phpt exif003.phpt exif004.phpt exif005.phpt exif006.phpt

2002-12-16 Thread Marcus Boerger
helly   Mon Dec 16 09:48:00 2002 EDT

  Modified files:  
/php4/ext/exif  exif.c 
/php4/ext/exif/testsexif002.phpt exif003.phpt exif004.phpt 
exif005.phpt exif006.phpt 
  Log:
  -Add constant that shows whether or not exif uses mbstring.
  -Fix tests
  
  
Index: php4/ext/exif/exif.c
diff -u php4/ext/exif/exif.c:1.131 php4/ext/exif/exif.c:1.132
--- php4/ext/exif/exif.c:1.131  Mon Dec 16 04:58:49 2002
+++ php4/ext/exif/exif.cMon Dec 16 09:47:59 2002
@@ -17,7 +17,7 @@
+--+
  */
 
-/* $Id: exif.c,v 1.131 2002/12/16 09:58:49 helly Exp $ */
+/* $Id: exif.c,v 1.132 2002/12/16 14:47:59 helly Exp $ */
 
 /*  ToDos
  *
@@ -58,10 +58,10 @@
 #include ext/standard/php_image.h
 #include ext/standard/info.h 
 
-#if HAVE_MBSTRING
-#if !defined(COMPILE_DL_MBSTRING) 
+#if HAVE_MBSTRING  !defined(COMPILE_DL_MBSTRING) 
 #define EXIF_USE_MBSTRING 1
-#endif
+#else
+#define EXIF_USE_MBSTRING 0
 #endif
 
 #ifdef EXIF_USE_MBSTRING
@@ -95,7 +95,7 @@
 };
 /* }}} */
 
-#define EXIF_VERSION 1.4 $Id: exif.c,v 1.131 2002/12/16 09:58:49 helly Exp $
+#define EXIF_VERSION 1.4 $Id: exif.c,v 1.132 2002/12/16 14:47:59 helly Exp $
 
 /* {{{ PHP_MINFO_FUNCTION
  */
@@ -181,6 +181,7 @@
 {
ZEND_INIT_MODULE_GLOBALS(exif, php_exif_init_globals, NULL);
REGISTER_INI_ENTRIES();
+   REGISTER_LONG_CONSTANT(EXIF_USE_MBSTRING, EXIF_USE_MBSTRING, CONST_CS | 
+CONST_PERSISTENT); 
return SUCCESS;
 }
 /* }}} */
Index: php4/ext/exif/tests/exif002.phpt
diff -u php4/ext/exif/tests/exif002.phpt:1.1 php4/ext/exif/tests/exif002.phpt:1.2
--- php4/ext/exif/tests/exif002.phpt:1.1Fri Oct 25 06:59:52 2002
+++ php4/ext/exif/tests/exif002.phptMon Dec 16 09:48:00 2002
@@ -13,9 +13,9 @@
   test2.jpg is the same image but contains Exif/Comment information and a
 copy of test1.jpg as a thumbnail.
 */
-$infile = './ext/exif/tests/test1.jpg';
+$infile = dirname(__FILE__).'./test1.jpg';
 echo md5_file($infile).'_'.filesize($infile);
-$thumb = exif_thumbnail('./ext/exif/tests/test2.jpg');
+$thumb = exif_thumbnail(dirname(__FILE__).'./test2.jpg');
 echo  == ;
 echo md5($thumb).'_'.strlen($thumb);
 echo \n;
Index: php4/ext/exif/tests/exif003.phpt
diff -u php4/ext/exif/tests/exif003.phpt:1.2 php4/ext/exif/tests/exif003.phpt:1.3
--- php4/ext/exif/tests/exif003.phpt:1.2Thu Nov 14 16:43:49 2002
+++ php4/ext/exif/tests/exif003.phptMon Dec 16 09:48:00 2002
@@ -4,6 +4,7 @@
 ?php 
if (!extension_loaded('exif')) die('skip exif extension not available');
if (!extension_loaded('mbstring')) die('skip mbstring extension not 
available');
+   if (!EXIF_USE_MBSTRING) die ('skip mbstring loaded by dl');
 ?
 --INI--
 output_handler=
@@ -18,7 +19,7 @@
 copy of test1.jpg as a thumbnail.
   test3.jpg is the same as test2.jpg but with a UNICODE UserComment: 
Auml;Ouml;Uuml;szlig;auml;ouml;uuml;
 */
-var_dump(exif_read_data('./ext/exif/tests/test3.jpg','',true,false));
+var_dump(exif_read_data(dirname(__FILE__).'./test3.jpg','',true,false));
 ?
 --EXPECTF--
 array(5) {
Index: php4/ext/exif/tests/exif004.phpt
diff -u php4/ext/exif/tests/exif004.phpt:1.2 php4/ext/exif/tests/exif004.phpt:1.3
--- php4/ext/exif/tests/exif004.phpt:1.2Thu Nov 14 16:45:01 2002
+++ php4/ext/exif/tests/exif004.phptMon Dec 16 09:48:00 2002
@@ -4,6 +4,7 @@
 ?php 
if (!extension_loaded('exif')) die('skip exif extension not available');
if (!extension_loaded('mbstring')) die('skip mbstring extension not 
available');
+   if (!EXIF_USE_MBSTRING) die ('skip mbstring loaded by dl');
 ?
 --INI--
 output_handler=
@@ -16,7 +17,7 @@
 /*
   test4.jpg is a 1*1 image that contains Exif tags written by WindowsXP
 */
-$image  = exif_read_data('./ext/exif/tests/test4.jpg','',true,false);
+$image  = exif_read_data(dirname(__FILE__).'./test4.jpg','',true,false);
 echo var_dump($image['WINXP']);
 ?
 --EXPECT--
Index: php4/ext/exif/tests/exif005.phpt
diff -u php4/ext/exif/tests/exif005.phpt:1.3 php4/ext/exif/tests/exif005.phpt:1.4
--- php4/ext/exif/tests/exif005.phpt:1.3Thu Nov 14 16:45:01 2002
+++ php4/ext/exif/tests/exif005.phptMon Dec 16 09:48:00 2002
@@ -10,7 +10,7 @@
 /* Do not change this test it is a REATME.TESTING example.
  * test5.jpg is a 1*1 image that contains an Exif section with ifd = 0009h
  */
-$image  = exif_read_data('./ext/exif/tests/test5.jpg','',true,false);
+$image  = exif_read_data(dirname(__FILE__).'./test5.jpg','',true,false);
 var_dump($image['IFD0']);
 ?
 --EXPECT--
Index: php4/ext/exif/tests/exif006.phpt
diff -u php4/ext/exif/tests/exif006.phpt:1.1 php4/ext/exif/tests/exif006.phpt:1.2
--- php4/ext/exif/tests/exif006.phpt:1.1Tue Nov 26 21:31:25 2002
+++ php4/ext/exif/tests/exif006.phptMon Dec 16 09:48:00 2002
@@ -14,7 +14,7 @@
 copy of test1.jpg as a thumbnail.
   test6.jpg is the same as test2.jpg but with 

[PHP-CVS] cvs: php4(PHP_4_3) /ext/exif/tests exif002.phpt exif003.phpt exif004.phpt exif005.phpt

2002-12-16 Thread Marcus Boerger
helly   Mon Dec 16 09:55:27 2002 EDT

  Modified files:  (Branch: PHP_4_3)
/php4/ext/exif/testsexif002.phpt exif003.phpt exif004.phpt 
exif005.phpt 
  Log:
  MFH: that silly dot
  
  
Index: php4/ext/exif/tests/exif002.phpt
diff -u php4/ext/exif/tests/exif002.phpt:1.1.2.1 
php4/ext/exif/tests/exif002.phpt:1.1.2.2
--- php4/ext/exif/tests/exif002.phpt:1.1.2.1Mon Dec 16 09:48:20 2002
+++ php4/ext/exif/tests/exif002.phptMon Dec 16 09:55:26 2002
@@ -13,9 +13,9 @@
   test2.jpg is the same image but contains Exif/Comment information and a
 copy of test1.jpg as a thumbnail.
 */
-$infile = dirname(__FILE__).'./test1.jpg';
+$infile = dirname(__FILE__).'/test1.jpg';
 echo md5_file($infile).'_'.filesize($infile);
-$thumb = exif_thumbnail(dirname(__FILE__).'./test2.jpg');
+$thumb = exif_thumbnail(dirname(__FILE__).'/test2.jpg');
 echo  == ;
 echo md5($thumb).'_'.strlen($thumb);
 echo \n;
Index: php4/ext/exif/tests/exif003.phpt
diff -u php4/ext/exif/tests/exif003.phpt:1.1.2.2 
php4/ext/exif/tests/exif003.phpt:1.1.2.3
--- php4/ext/exif/tests/exif003.phpt:1.1.2.2Mon Dec 16 09:48:20 2002
+++ php4/ext/exif/tests/exif003.phptMon Dec 16 09:55:26 2002
@@ -19,7 +19,7 @@
 copy of test1.jpg as a thumbnail.
   test3.jpg is the same as test2.jpg but with a UNICODE UserComment: 
Auml;Ouml;Uuml;szlig;auml;ouml;uuml;
 */
-var_dump(exif_read_data(dirname(__FILE__).'./test3.jpg','',true,false));
+var_dump(exif_read_data(dirname(__FILE__).'/test3.jpg','',true,false));
 ?
 --EXPECTF--
 array(5) {
Index: php4/ext/exif/tests/exif004.phpt
diff -u php4/ext/exif/tests/exif004.phpt:1.1.2.2 
php4/ext/exif/tests/exif004.phpt:1.1.2.3
--- php4/ext/exif/tests/exif004.phpt:1.1.2.2Mon Dec 16 09:48:20 2002
+++ php4/ext/exif/tests/exif004.phptMon Dec 16 09:55:26 2002
@@ -17,7 +17,7 @@
 /*
   test4.jpg is a 1*1 image that contains Exif tags written by WindowsXP
 */
-$image  = exif_read_data(dirname(__FILE__).'./test4.jpg','',true,false);
+$image  = exif_read_data(dirname(__FILE__).'/test4.jpg','',true,false);
 echo var_dump($image['WINXP']);
 ?
 --EXPECT--
Index: php4/ext/exif/tests/exif005.phpt
diff -u php4/ext/exif/tests/exif005.phpt:1.2.2.2 
php4/ext/exif/tests/exif005.phpt:1.2.2.3
--- php4/ext/exif/tests/exif005.phpt:1.2.2.2Mon Dec 16 09:48:20 2002
+++ php4/ext/exif/tests/exif005.phptMon Dec 16 09:55:26 2002
@@ -10,7 +10,7 @@
 /* Do not change this test it is a REATME.TESTING example.
  * test5.jpg is a 1*1 image that contains an Exif section with ifd = 0009h
  */
-$image  = exif_read_data(dirname(__FILE__).'./test5.jpg','',true,false);
+$image  = exif_read_data(dirname(__FILE__).'/test5.jpg','',true,false);
 var_dump($image['IFD0']);
 ?
 --EXPECT--



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




[PHP-CVS] cvs: php4 /ext/exif/tests exif006.phpt

2002-12-16 Thread Marcus Boerger
helly   Mon Dec 16 10:04:15 2002 EDT

  Modified files:  
/php4/ext/exif/testsexif006.phpt 
  Log:
  Add version check since this will be available since php 4.4.
  
  
Index: php4/ext/exif/tests/exif006.phpt
diff -u php4/ext/exif/tests/exif006.phpt:1.3 php4/ext/exif/tests/exif006.phpt:1.4
--- php4/ext/exif/tests/exif006.phpt:1.3Mon Dec 16 09:54:35 2002
+++ php4/ext/exif/tests/exif006.phptMon Dec 16 10:04:12 2002
@@ -1,11 +1,14 @@
 --TEST--
 Check for exif_read_data, magic_quotes_runtime
 --SKIPIF--
-?php if (!extension_loaded('exif')) print 'skip exif extension not available';?
+?php 
+   if (!extension_loaded('exif')) die('skip exif extension not available');
+   if (version_compare(PHP_VERSION, 4.4.0-dev, )) die('skip PHP 4.4 
+required');
+?
 --INI--
 output_handler=
 zlib.output_compression=0
-magic_quotes_runtime=1
+magic_quotes_runtime=On
 --FILE--
 ?php
 /*
@@ -14,6 +17,7 @@
 copy of test1.jpg as a thumbnail.
   test6.jpg is the same as test2.jpg but with a UNICODE UserComment: 
Auml;Ouml;Uuml;szlig;auml;ouml;uuml;
 */
+print_r(ini_get(magic_quotes_runtime));
 var_dump(exif_read_data(dirname(__FILE__).'/test6.jpg','',true,false));
 ?
 --EXPECTF--



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




[PHP-CVS] cvs: php4 /ext/exif/tests exif006.phpt

2002-12-16 Thread Marcus Boerger
helly   Mon Dec 16 10:19:58 2002 EDT

  Modified files:  
/php4/ext/exif/testsexif006.phpt 
  Log:
  fix test
  
  
Index: php4/ext/exif/tests/exif006.phpt
diff -u php4/ext/exif/tests/exif006.phpt:1.4 php4/ext/exif/tests/exif006.phpt:1.5
--- php4/ext/exif/tests/exif006.phpt:1.4Mon Dec 16 10:04:12 2002
+++ php4/ext/exif/tests/exif006.phptMon Dec 16 10:19:57 2002
@@ -8,7 +8,7 @@
 --INI--
 output_handler=
 zlib.output_compression=0
-magic_quotes_runtime=On
+magic_quotes_runtime=1
 --FILE--
 ?php
 /*
@@ -17,7 +17,6 @@
 copy of test1.jpg as a thumbnail.
   test6.jpg is the same as test2.jpg but with a UNICODE UserComment: 
Auml;Ouml;Uuml;szlig;auml;ouml;uuml;
 */
-print_r(ini_get(magic_quotes_runtime));
 var_dump(exif_read_data(dirname(__FILE__).'/test6.jpg','',true,false));
 ?
 --EXPECTF--



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




[PHP-CVS] cvs: php4(PHP_4_3) /main main.c

2002-12-16 Thread Ilia Alshanetsky
iliaa   Mon Dec 16 10:44:20 2002 EDT

  Modified files:  (Branch: PHP_4_3)
/php4/main  main.c 
  Log:
  MFH
  
  
Index: php4/main/main.c
diff -u php4/main/main.c:1.512.2.4 php4/main/main.c:1.512.2.5
--- php4/main/main.c:1.512.2.4  Thu Dec  5 17:15:01 2002
+++ php4/main/main.cMon Dec 16 10:44:06 2002
@@ -18,7 +18,7 @@
+--+
 */
 
-/* $Id: main.c,v 1.512.2.4 2002/12/05 22:15:01 helly Exp $ */
+/* $Id: main.c,v 1.512.2.5 2002/12/16 15:44:06 iliaa Exp $ */
 
 /* {{{ includes
  */
@@ -168,15 +168,36 @@
  */
 static void php_disable_functions(TSRMLS_D)
 {
-   char *func;
-   char *new_value_dup = strdup(INI_STR(disable_functions)); /* This is an 
intentional leak,
-  
  * it's not a big deal as it's process-wide
-  
  */
-
-   func = strtok(new_value_dup, , );
-   while (func) {
-   zend_disable_function(func, strlen(func) TSRMLS_CC);
-   func = strtok(NULL, , );
+   char *s = NULL;
+   char *e = INI_STR(disable_functions);
+   char p;
+
+   if (!*e) {
+   return;
+   }
+
+   while (*e) {
+   switch (*e) {
+   case ' ':
+   case ',':
+   if (s) {
+   p = *e;
+   *e = '\0';
+   zend_disable_function(s, e-s TSRMLS_CC);
+   *e = p;
+   s = NULL;
+   }
+   break;
+   default:
+   if (!s) {
+   s = e;
+   }
+   break;
+   }
+   e++;
+   }
+   if (s) {
+   zend_disable_function(s, e-s TSRMLS_CC);
}
 }
 /* }}} */



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




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

2002-12-16 Thread Marcus Boerger
helly   Mon Dec 16 10:53:47 2002 EDT

  Modified files:  
/php4/ext/exif  exif.c 
  Log:
  fix compiler definition tests
  
  
Index: php4/ext/exif/exif.c
diff -u php4/ext/exif/exif.c:1.132 php4/ext/exif/exif.c:1.133
--- php4/ext/exif/exif.c:1.132  Mon Dec 16 09:47:59 2002
+++ php4/ext/exif/exif.cMon Dec 16 10:53:46 2002
@@ -17,7 +17,7 @@
+--+
  */
 
-/* $Id: exif.c,v 1.132 2002/12/16 14:47:59 helly Exp $ */
+/* $Id: exif.c,v 1.133 2002/12/16 15:53:46 helly Exp $ */
 
 /*  ToDos
  *
@@ -64,7 +64,7 @@
 #define EXIF_USE_MBSTRING 0
 #endif
 
-#ifdef EXIF_USE_MBSTRING
+#if EXIF_USE_MBSTRING
 #include ext/mbstring/mbstring.h
 #endif
 
@@ -95,7 +95,7 @@
 };
 /* }}} */
 
-#define EXIF_VERSION 1.4 $Id: exif.c,v 1.132 2002/12/16 14:47:59 helly Exp $
+#define EXIF_VERSION 1.4 $Id: exif.c,v 1.133 2002/12/16 15:53:46 helly Exp $
 
 /* {{{ PHP_MINFO_FUNCTION
  */
@@ -132,7 +132,7 @@
 
 ZEND_API ZEND_INI_MH(OnUpdateEncode)
 {
-#ifdef EXIF_USE_MBSTRING
+#if EXIF_USE_MBSTRING
if (new_value  strlen(new_value)  !php_mb_check_encoding_list(new_value 
TSRMLS_CC)) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, Illegal encoding ignored: 
'%s', new_value);
return FAILURE;
@@ -143,7 +143,7 @@
 
 ZEND_API ZEND_INI_MH(OnUpdateDecode)
 {
-#ifdef EXIF_USE_MBSTRING
+#if EXIF_USE_MBSTRING
if (!php_mb_check_encoding_list(new_value TSRMLS_CC)) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, Illegal encoding ignored: 
'%s', new_value);
return FAILURE;
@@ -2582,7 +2582,7 @@
 {
int   a;
 
-#ifdef EXIF_USE_MBSTRING
+#if EXIF_USE_MBSTRING
char  *decode;
size_t len;;
 #endif
@@ -2594,7 +2594,7 @@
*pszEncoding = estrdup((const char*)szValuePtr);
szValuePtr = szValuePtr+8;
ByteCount -= 8;
-#ifdef EXIF_USE_MBSTRING
+#if EXIF_USE_MBSTRING
/* First try to detect BOM: ZERO WIDTH NOBREAK SPACE (FEFF 16) 
 * since we have no encoding support for the BOM yet we skip 
that.
 */
@@ -2627,7 +2627,7 @@
*pszEncoding = estrdup((const char*)szValuePtr);
szValuePtr = szValuePtr+8;
ByteCount -= 8;
-#ifdef EXIF_USE_MBSTRING
+#if EXIF_USE_MBSTRING
if (ImageInfo-motorola_intel) {
*pszInfoPtr = php_mb_convert_encoding(szValuePtr, 
ByteCount, ImageInfo-encode_jis, ImageInfo-decode_jis_be, len TSRMLS_CC);
} else {
@@ -2666,7 +2666,7 @@
xp_field-tag = tag;
 
/* Copy the comment */
-#ifdef EXIF_USE_MBSTRING
+#if EXIF_USE_MBSTRING
 /*  What if MS supports big-endian with XP? */
 /* if (ImageInfo-motorola_intel) {
xp_field-value = php_mb_convert_encoding(szValuePtr, ByteCount, 
ImageInfo-encode_unicode, ImageInfo-decode_unicode_be, xp_field-size TSRMLS_CC);



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




[PHP-CVS] cvs: php4(PHP_4_3) /ext/exif exif.c

2002-12-16 Thread Marcus Boerger
helly   Mon Dec 16 12:53:15 2002 EDT

  Modified files:  (Branch: PHP_4_3)
/php4/ext/exif  exif.c 
  Log:
  MFH
  
  
Index: php4/ext/exif/exif.c
diff -u php4/ext/exif/exif.c:1.118.2.10 php4/ext/exif/exif.c:1.118.2.11
--- php4/ext/exif/exif.c:1.118.2.10 Mon Dec 16 10:54:04 2002
+++ php4/ext/exif/exif.cMon Dec 16 12:53:15 2002
@@ -17,7 +17,7 @@
+--+
  */
 
-/* $Id: exif.c,v 1.118.2.10 2002/12/16 15:54:04 helly Exp $ */
+/* $Id: exif.c,v 1.118.2.11 2002/12/16 17:53:15 helly Exp $ */
 
 /*  ToDos
  *
@@ -95,7 +95,7 @@
 };
 /* }}} */
 
-#define EXIF_VERSION 1.4 $Id: exif.c,v 1.118.2.10 2002/12/16 15:54:04 helly Exp $
+#define EXIF_VERSION 1.4 $Id: exif.c,v 1.118.2.11 2002/12/16 17:53:15 helly Exp $
 
 /* {{{ PHP_MINFO_FUNCTION
  */
@@ -2514,7 +2514,7 @@
 
 /* {{{ exif_process_string_raw
  * Copy a string in Exif header to a character string returns length of allocated 
buffer if any. */
-#ifndef EXIF_USE_MBSTRING
+#if !EXIF_USE_MBSTRING
 static int exif_process_string_raw(char **result, char *value, size_t byte_count) {
/* we cannot use strlcpy - here the problem is that we have to copy NUL
 * chars up to byte_count, we also have to add a single NUL character to



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




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

2002-12-16 Thread Sergey Kartashoff
gluke   Mon Dec 16 14:17:09 2002 EDT

  Modified files:  
/php4/ext/mnogosearch   php_mnogo.c 
  Log:
  - mnogosearch extension updated to compile with mnogosearch-3.2.8
  
  
Index: php4/ext/mnogosearch/php_mnogo.c
diff -u php4/ext/mnogosearch/php_mnogo.c:1.67 php4/ext/mnogosearch/php_mnogo.c:1.68
--- php4/ext/mnogosearch/php_mnogo.c:1.67   Sun Nov 24 14:36:45 2002
+++ php4/ext/mnogosearch/php_mnogo.cMon Dec 16 14:17:09 2002
@@ -1,5 +1,5 @@
 /* $Source: /usr/repository/php4/ext/mnogosearch/php_mnogo.c,v $ */
-/* $Id: php_mnogo.c,v 1.67 2002/11/24 19:36:45 gluke Exp $ */
+/* $Id: php_mnogo.c,v 1.68 2002/12/16 19:17:09 gluke Exp $ */
 
 /*
+--+
@@ -468,7 +468,9 @@
UdmVarListReplaceStr(Env-Vars,DBAddr,dbaddr);

if(UDM_OK!=UdmDBSetAddr(Env-db,dbaddr,UDM_OPEN_MODE_READ)){
sprintf(Env-errstr,Invalid DBAddr: '%s',dbaddr);
+#if UDM_VERSION_ID = 30207
Env-errcode=1;
+#endif
php_error(E_WARNING,%s(): Invalid DBAddr, 
get_active_function_name(TSRMLS_C));
RETURN_FALSE;
}
@@ -519,7 +521,9 @@
UdmVarListReplaceStr(Env-Vars,DBAddr,dbaddr);

if(UDM_OK!=UdmDBSetAddr(Env-db,dbaddr,UDM_OPEN_MODE_READ)){
sprintf(Env-errstr,Invalid DBAddr: '%s',dbaddr);
+#if UDM_VERSION_ID = 30207
Env-errcode=1;
+#endif
php_error(E_WARNING,%s(): Invalid DBAddr, 
get_active_function_name(TSRMLS_C));
RETURN_FALSE;
}
@@ -999,6 +1003,8 @@
case UDM_PARAM_VARDIR:
 #if UDM_VERSION_ID  30200

udm_snprintf(Agent-Conf-vardir,sizeof(Agent-Conf-vardir)-1,%s%s,val,UDMSLASHSTR);
+#elif UDM_VERSION_ID = 30208
+   UdmVarListReplaceStr(Agent-Conf-Vars,Vardir,val);
 #elif UDM_VERSION_ID = 30204
UdmVarListReplaceStr(Agent-Conf-Vars,Vardir,val);

snprintf(Agent-Conf-vardir,sizeof(Agent-Conf-vardir)-1,%s%s,val,UDMSLASHSTR);
@@ -1717,8 +1723,10 @@
Agent-Conf-WordParam.min_word_len=atoi(val);
} else if (!strcasecmp(var,MaxWordLen)) {
Agent-Conf-WordParam.max_word_len=atoi(val);
+#if UDM_VERSION_ID = 30207
} else if (!strcasecmp(var,VarDir)) {

snprintf(Agent-Conf-vardir,sizeof(Agent-Conf-vardir)-1,%s%s,val,UDMSLASHSTR);
+#endif
}
 
RETURN_TRUE;
@@ -2171,7 +2179,13 @@
break;
}
ZEND_FETCH_RESOURCE(Agent, UDM_AGENT *, yyagent, -1, mnoGoSearch-Agent, 
le_link);
-#if UDM_VERSION_ID = 30204
+#if UDM_VERSION_ID = 30208
+   if (UdmEnvErrMsg(Agent-Conf)  strlen(UdmEnvErrMsg(Agent-Conf))) {
+   RETURN_LONG(1);
+   } else {
+   RETURN_LONG(0);
+   }
+#elif UDM_VERSION_ID = 30204
RETURN_LONG(UdmEnvErrCode(Agent-Conf));
 #else
RETURN_LONG(UdmDBErrorCode(Agent-db));



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




[PHP-CVS] cvs: php4 /ext/mssql config.m4 php_mssql.c php_mssql.h

2002-12-16 Thread Frank M. Kromann
fmk Mon Dec 16 17:26:50 2002 EDT

  Added files: 
/php4/ext/mssql config.m4 

  Modified files:  
/php4/ext/mssql php_mssql.c php_mssql.h 
  Log:
  Allow the native MSSQL extension to be compiled with FreeTDS on *nix platforms.
  This will make the whole MSSAL API available on these platforms.
  @Allow compilation of mssql extension on *nix.
  
  
Index: php4/ext/mssql/php_mssql.c
diff -u php4/ext/mssql/php_mssql.c:1.90 php4/ext/mssql/php_mssql.c:1.91
--- php4/ext/mssql/php_mssql.c:1.90 Tue Dec  3 14:19:15 2002
+++ php4/ext/mssql/php_mssql.c  Mon Dec 16 17:26:49 2002
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: php_mssql.c,v 1.90 2002/12/03 19:19:15 fmk Exp $ */
+/* $Id: php_mssql.c,v 1.91 2002/12/16 22:26:49 fmk Exp $ */
 
 #ifdef COMPILE_DL_MSSQL
 #define HAVE_MSSQL 1
@@ -442,24 +442,30 @@
RETURN_FALSE;
}

-   dbprocerrhandle(mssql.login, (DBERRHANDLE_PROC) php_mssql_error_handler);
-   dbprocmsghandle(mssql.login, (DBMSGHANDLE_PROC) php_mssql_message_handler);
+   DBERRHANDLE(mssql.login, (EHANDLEFUNC) php_mssql_error_handler);
+   DBMSGHANDLE(mssql.login, (MHANDLEFUNC) php_mssql_message_handler);
 
+#ifndef HAVE_FREETDS
if (MS_SQL_G(secure_connection) == 1){
DBSETLSECURE(mssql.login);
}
else {
+#endif
if (user) {
DBSETLUSER(mssql.login,user);
}
if (passwd) {
DBSETLPWD(mssql.login,passwd);
}
+#ifndef HAVE_FREETDS
}
+#endif
DBSETLAPP(mssql.login,MS_SQL_G(appname));
mssql.valid = 1;
 
+#ifndef HAVE_FREETDS
DBSETLVERSION(mssql.login, DBVER60);
+#endif
 /* DBSETLTIME(mssql.login, TIMEOUT_INFINITE); */
 
if (!MS_SQL_G(allow_persistent)) {
@@ -492,7 +498,7 @@
RETURN_FALSE;
}
 
-   if (dbsetopt(mssql.link, DBBUFFER, 2)==FAIL) {
+   if (DBSETOPT(mssql.link, DBBUFFER, 2)==FAIL) {
efree(hashed_details);
dbfreelogin(mssql.login);
dbclose(mssql.link);
@@ -501,7 +507,7 @@
 
if (MS_SQL_G(textlimit) != -1) {
sprintf(buffer, %li, MS_SQL_G(textlimit));
-   if (dbsetopt(mssql.link, DBTEXTLIMIT, buffer)==FAIL) {
+   if (DBSETOPT(mssql.link, DBTEXTLIMIT, buffer)==FAIL) {
efree(hashed_details);
dbfreelogin(mssql.login);
RETURN_FALSE;
@@ -554,7 +560,7 @@
 #if BROKEN_MSSQL_PCONNECTS
log_error(PHP/MS SQL:  Reconnect 
successful!,php_rqst-server);
 #endif
-   if (dbsetopt(mssql_ptr-link, DBBUFFER, 2)==FAIL) {
+   if (DBSETOPT(mssql_ptr-link, DBBUFFER, 2)==FAIL) {
 #if BROKEN_MSSQL_PCONNECTS
log_error(PHP/MS SQL:  Unable to set required 
options,php_rqst-server);
 #endif
@@ -605,7 +611,7 @@
RETURN_FALSE;
}
 
-   if (dbsetopt(mssql.link, DBBUFFER,2)==FAIL) {
+   if (DBSETOPT(mssql.link, DBBUFFER,2)==FAIL) {
efree(hashed_details);
dbfreelogin(mssql.login);
dbclose(mssql.link);
@@ -614,7 +620,7 @@
 
if (MS_SQL_G(textlimit) != -1) {
sprintf(buffer, %li, MS_SQL_G(textlimit));
-   if (dbsetopt(mssql.link, DBTEXTLIMIT, buffer)==FAIL) {
+   if (DBSETOPT(mssql.link, DBTEXTLIMIT, buffer)==FAIL) {
efree(hashed_details);
dbfreelogin(mssql.login);
RETURN_FALSE;
@@ -1108,7 +1114,11 @@
 * 1)  Being able to fire up another query without explicitly reading all rows
 * 2)  Having numrows accessible
 */
+#ifdef HAVE_FREETDS
+   if ((num_fields = dbnumcols(mssql_ptr-link)) = 0) {
+#else
if ((num_fields = dbnumcols(mssql_ptr-link)) = 0  
!dbdataready(mssql_ptr-link)) {
+#endif
RETURN_TRUE;
}
 
@@ -1172,8 +1182,10 @@
}
 
ZEND_FETCH_RESOURCE(result, mssql_result *, mssql_result_index, -1, MS 
SQL-result, le_result);
+#ifndef HAVE_FREETDS
if (dbdataready(result-mssql_ptr-link))
dbresults(result-mssql_ptr-link);
+#endif
zend_list_delete(Z_LVAL_PP(mssql_result_index));
RETURN_TRUE;
 }
@@ -1996,7 +2008,7 @@
 
/* no call to dbrpcparam if RETVAL */
if ( strcmp(RETVAL,Z_STRVAL_PP(param_name))!=0 ) {