Re: [PHP-CVS] cvs: php-src(PHP_4_3) /ext/gd/libgd gdft.c

2003-11-26 Thread Rasmus Lerdorf
Perhaps not, but Freetype2 won't compile either on those platforms then
and without this patch we don't build at all.

-Rasmus

On Sat, 22 Nov 2003, Jani Taskinen wrote:

>
> Are you absolutely sure this will work within any platform?
> For example, see this bug report:
>
>   http://bugs.php.net/bug.php?id=25281
>
> --Jani
>
> On Sat, 22 Nov 2003, Rasmus Lerdorf wrote:
>
> >rasmus   Fri Nov 21 19:55:29 2003 EDT
> >
> >  Modified files:  (Branch: PHP_4_3)
> >/php-src/ext/gd/libgdgdft.c
> >  Log:
> >  Compile fix
> >
> >
> >Index: php-src/ext/gd/libgd/gdft.c
> >diff -u php-src/ext/gd/libgd/gdft.c:1.11.2.10 php-src/ext/gd/libgd/gdft.c:1.11.2.11
> >--- php-src/ext/gd/libgd/gdft.c:1.11.2.10Tue Jun 17 09:37:57 2003
> >+++ php-src/ext/gd/libgd/gdft.c  Fri Nov 21 19:55:29 2003
> >@@ -60,7 +60,8 @@
> > #else
> >
> > #include "gdcache.h"
> >-#include "freetype/freetype.h"
> >+#include 
> >+#include FT_FREETYPE_H
> > #include "freetype/ftglyph.h"
> >
> > /* number of fonts cached before least recently used is replaced */
> >
> >
>
> --
> 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(PHP_4_3) /ext/gd/libgd gdft.c

2003-11-26 Thread Jani Taskinen

What exactly is that compile error? And on what platform?
This has been like this for a long time, funny that nobody
hasn't complained before?

And it works just fine for me on RH9. :)

--Jani


On Tue, 25 Nov 2003, Rasmus Lerdorf wrote:

>Perhaps not, but Freetype2 won't compile either on those platforms then
>and without this patch we don't build at all.
>
>-Rasmus
>
>On Sat, 22 Nov 2003, Jani Taskinen wrote:
>
>>
>> Are you absolutely sure this will work within any platform?
>> For example, see this bug report:
>>
>>   http://bugs.php.net/bug.php?id=25281
>>
>> --Jani
>>
>> On Sat, 22 Nov 2003, Rasmus Lerdorf wrote:
>>
>> >rasmus  Fri Nov 21 19:55:29 2003 EDT
>> >
>> >  Modified files:  (Branch: PHP_4_3)
>> >/php-src/ext/gd/libgd   gdft.c
>> >  Log:
>> >  Compile fix
>> >
>> >
>> >Index: php-src/ext/gd/libgd/gdft.c
>> >diff -u php-src/ext/gd/libgd/gdft.c:1.11.2.10 php-src/ext/gd/libgd/gdft.c:1.11.2.11
>> >--- php-src/ext/gd/libgd/gdft.c:1.11.2.10   Tue Jun 17 09:37:57 2003
>> >+++ php-src/ext/gd/libgd/gdft.c Fri Nov 21 19:55:29 2003
>> >@@ -60,7 +60,8 @@
>> > #else
>> >
>> > #include "gdcache.h"
>> >-#include "freetype/freetype.h"
>> >+#include 
>> >+#include FT_FREETYPE_H
>> > #include "freetype/ftglyph.h"
>> >
>> > /* number of fonts cached before least recently used is replaced */
>> >
>> >
>>
>> --
>> 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(PHP_4_3) /ext/gd/libgd gdft.c

2003-11-26 Thread Rasmus Lerdorf
On Wed, 26 Nov 2003, Jani Taskinen wrote:
> What exactly is that compile error? And on what platform?
> This has been like this for a long time, funny that nobody
> hasn't complained before?
>
> And it works just fine for me on RH9. :)

i386 Fedora (ie latest freetype2)

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



Re: [PHP-CVS] cvs: php-src(PHP_4_3) /ext/gd/libgd gdft.c

2003-11-26 Thread Rasmus Lerdorf
I guess to answer your question a bit better.  Have a look at the top of
freetype.h (this time from my Debian box - it's not just Fedora):

  #ifndef FT_FREETYPE_H
  #error "`ft2build.h' hasn't been included yet!"
  #error "Please always use macros to include FreeType header files."
  #error "Example:"
  #error "  #include "
  #error "  #include FT_FREETYPE_H"
  #endif

  #ifndef __FREETYPE_H__
  #define __FREETYPE_H__

  #define FREETYPE_MAJOR 2
  #define FREETYPE_MINOR 1
  #define FREETYPE_PATCH 7

  #include 
  #include FT_CONFIG_CONFIG_H
  #include FT_ERRORS_H
  #include FT_TYPES_H

Now, if we are on a platform where we can't #include on a macro, then this
stuff won't compile at all anyway regardless of what we do in PHP.  And
the error we got before that patch is the one the #error at the top there
spits out.

-Rasmus

On Wed, 26 Nov 2003, Jani Taskinen wrote:

>
> What exactly is that compile error? And on what platform?
> This has been like this for a long time, funny that nobody
> hasn't complained before?
>
> And it works just fine for me on RH9. :)
>
> --Jani
>
>
> On Tue, 25 Nov 2003, Rasmus Lerdorf wrote:
>
> >Perhaps not, but Freetype2 won't compile either on those platforms then
> >and without this patch we don't build at all.
> >
> >-Rasmus
> >
> >On Sat, 22 Nov 2003, Jani Taskinen wrote:
> >
> >>
> >> Are you absolutely sure this will work within any platform?
> >> For example, see this bug report:
> >>
> >>   http://bugs.php.net/bug.php?id=25281
> >>
> >> --Jani
> >>
> >> On Sat, 22 Nov 2003, Rasmus Lerdorf wrote:
> >>
> >> >rasmusFri Nov 21 19:55:29 2003 EDT
> >> >
> >> >  Modified files:  (Branch: PHP_4_3)
> >> >/php-src/ext/gd/libgd gdft.c
> >> >  Log:
> >> >  Compile fix
> >> >
> >> >
> >> >Index: php-src/ext/gd/libgd/gdft.c
> >> >diff -u php-src/ext/gd/libgd/gdft.c:1.11.2.10 
> >> >php-src/ext/gd/libgd/gdft.c:1.11.2.11
> >> >--- php-src/ext/gd/libgd/gdft.c:1.11.2.10 Tue Jun 17 09:37:57 2003
> >> >+++ php-src/ext/gd/libgd/gdft.c   Fri Nov 21 19:55:29 2003
> >> >@@ -60,7 +60,8 @@
> >> > #else
> >> >
> >> > #include "gdcache.h"
> >> >-#include "freetype/freetype.h"
> >> >+#include 
> >> >+#include FT_FREETYPE_H
> >> > #include "freetype/ftglyph.h"
> >> >
> >> > /* number of fonts cached before least recently used is replaced */
> >> >
> >> >
> >>
> >> --
> >> 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: spl / php_spl.c spl_array.c spl_array.h

2003-11-26 Thread Marcus Boerger
helly   Wed Nov 26 03:18:27 2003 EDT

  Modified files:  
/splphp_spl.c spl_array.c spl_array.h 
  Log:
  Remove interfaces implemented in engine now
  
Index: spl/php_spl.c
diff -u spl/php_spl.c:1.18 spl/php_spl.c:1.19
--- spl/php_spl.c:1.18  Mon Nov 17 00:32:42 2003
+++ spl/php_spl.c   Wed Nov 26 03:18:26 2003
@@ -210,10 +210,8 @@
 {
array_init(return_value);
 
-   SPL_ADD_CLASS(ArrayAccess);
SPL_ADD_CLASS(ArrayObject);
SPL_ADD_CLASS(ArrayIterator);
-   SPL_ADD_CLASS(ArrayRead);
SPL_ADD_CLASS(DirectoryIterator);
SPL_ADD_CLASS(RecursiveIterator);
SPL_ADD_CLASS(RecursiveIteratorIterator);
Index: spl/spl_array.c
diff -u spl/spl_array.c:1.25 spl/spl_array.c:1.26
--- spl/spl_array.c:1.25Sat Nov 22 15:44:44 2003
+++ spl/spl_array.c Wed Nov 26 03:18:26 2003
@@ -31,29 +31,6 @@
 #include "spl_array.h"
 
 
-static
-ZEND_BEGIN_ARG_INFO(arginfo_one_param, 0)
-   ZEND_ARG_INFO(0, index)
-ZEND_END_ARG_INFO();
-
-static
-ZEND_BEGIN_ARG_INFO(arginfo_two_params, 0)
-   ZEND_ARG_INFO(0, index)
-   ZEND_ARG_INFO(0, value)
-ZEND_END_ARG_INFO();
-
-function_entry spl_funcs_ArrayRead[] = {
-   SPL_ABSTRACT_ME(ArrayRead, get, arginfo_one_param)
-   SPL_ABSTRACT_ME(ArrayRead, exists,  arginfo_one_param)
-   {NULL, NULL, NULL}
-};
-
-function_entry spl_funcs_ArrayAccess[] = {
-   SPL_ABSTRACT_ME(ArrayAccess, set,  arginfo_two_params)
-   SPL_ABSTRACT_ME(ArrayAccess, del,  arginfo_one_param)
-   {NULL, NULL, NULL}
-};
-
 SPL_METHOD(Array, __construct);
 SPL_METHOD(Array, getIterator);
 SPL_METHOD(Array, rewind);
@@ -83,8 +60,6 @@
{NULL, NULL, NULL}
 };
 
-zend_class_entry *   spl_ce_ArrayRead;
-zend_class_entry *   spl_ce_ArrayAccess;
 
 zend_object_handlers spl_handler_ArrayObject;
 zend_class_entry *   spl_ce_ArrayObject;
@@ -310,13 +285,6 @@
 /* {{{ PHP_MINIT_FUNCTION(spl_array) */
 PHP_MINIT_FUNCTION(spl_array)
 {
-#if MBO_0
-   REGISTER_SPL_INTERFACE(ArrayRead);
-
-   REGISTER_SPL_INTERFACE(ArrayAccess);
-   zend_class_implements(spl_ce_ArrayAccess TSRMLS_CC, 1, spl_ce_ArrayRead);
-#endif
-
REGISTER_SPL_STD_CLASS_EX(ArrayObject, spl_array_object_new, 
spl_funcs_ArrayObject);
zend_class_implements(spl_ce_ArrayObject TSRMLS_CC, 1, zend_ce_aggregate);
memcpy(&spl_handler_ArrayObject, zend_get_std_object_handlers(), 
sizeof(zend_object_handlers));
Index: spl/spl_array.h
diff -u spl/spl_array.h:1.6 spl/spl_array.h:1.7
--- spl/spl_array.h:1.6 Mon Nov 17 00:32:43 2003
+++ spl/spl_array.h Wed Nov 26 03:18:26 2003
@@ -22,8 +22,6 @@
 #include "php.h"
 #include "php_spl.h"
 
-extern zend_class_entry *spl_ce_ArrayRead;
-extern zend_class_entry *spl_ce_ArrayAccess;
 extern zend_class_entry *spl_ce_ArrayObject;
 extern zend_class_entry *spl_ce_ArrayIterator;
 


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



[PHP-CVS] cvs: php-src /tests/lang bug21820.phpt

2003-11-26 Thread Marcus Boerger
helly   Wed Nov 26 03:45:43 2003 EDT

  Modified files:  
/php-src/tests/lang bug21820.phpt 
  Log:
  Errro message has changed
  
Index: php-src/tests/lang/bug21820.phpt
diff -u php-src/tests/lang/bug21820.phpt:1.2 php-src/tests/lang/bug21820.phpt:1.3
--- php-src/tests/lang/bug21820.phpt:1.2Sat May  3 13:30:46 2003
+++ php-src/tests/lang/bug21820.phptWed Nov 26 03:45:42 2003
@@ -9,5 +9,5 @@
 echo "$arr['foo']";
 
 ?>
---EXPECTREGEX--
-Parse error: parse error,.*expecting `?T_STRING'? or `?T_VARIABLE'? or 
`?T_NUM_STRING'? in .* on line .*
+--EXPECTF--
+Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING 
or T_VARIABLE or T_NUM_STRING in %sbug21820.php 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 /tests/lang bug26182.phpt

2003-11-26 Thread Marcus Boerger
helly   Wed Nov 26 03:47:58 2003 EDT

  Modified files:  
/php-src/tests/lang bug26182.phpt 
  Log:
  In PHP5 this will create an implicit public property
  
Index: php-src/tests/lang/bug26182.phpt
diff -u php-src/tests/lang/bug26182.phpt:1.1 php-src/tests/lang/bug26182.phpt:1.2
--- php-src/tests/lang/bug26182.phpt:1.1Tue Nov 25 04:20:56 2003
+++ php-src/tests/lang/bug26182.phptWed Nov 26 03:47:58 2003
@@ -22,4 +22,5 @@
 --EXPECT--
 a Object
 (
+[x] => 
 )

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



[PHP-CVS] cvs: php-src /main php_variables.c rfc1867.c

2003-11-26 Thread Derick Rethans
derick  Wed Nov 26 04:53:23 2003 EDT

  Modified files:  
/php-src/main   php_variables.c rfc1867.c 
  Log:
  - Prevent registration of the variable when a zero-length is returned
from the sapi_input_filter.
  
  
Index: php-src/main/php_variables.c
diff -u php-src/main/php_variables.c:1.71 php-src/main/php_variables.c:1.72
--- php-src/main/php_variables.c:1.71   Mon Oct 13 23:49:13 2003
+++ php-src/main/php_variables.cWed Nov 26 04:53:22 2003
@@ -17,7 +17,7 @@
+--+
  */
 
-/* $Id: php_variables.c,v 1.71 2003/10/14 03:49:13 iliaa Exp $ */
+/* $Id: php_variables.c,v 1.72 2003/11/26 09:53:22 derick Exp $ */
 
 #include 
 #include "php.h"
@@ -213,7 +213,9 @@
php_url_decode(var, strlen(var));
val_len = php_url_decode(val, strlen(val));
val_len = sapi_module.input_filter(PARSE_POST, var, &val, 
val_len TSRMLS_CC);
-   php_register_variable_safe(var, val, val_len, array_ptr 
TSRMLS_CC);
+   if (val_len) {
+   php_register_variable_safe(var, val, val_len, 
array_ptr TSRMLS_CC);
+   }
}
var = php_strtok_r(NULL, "&", &strtok_buf);
}
@@ -308,7 +310,9 @@
php_url_decode(var, strlen(var));
val_len = php_url_decode(val, strlen(val));
val_len = sapi_module.input_filter(arg, var, &val, val_len 
TSRMLS_CC);
-   php_register_variable_safe(var, val, val_len, array_ptr 
TSRMLS_CC);
+   if (val_len) {
+   php_register_variable_safe(var, val, val_len, 
array_ptr TSRMLS_CC);
+   }
} else {
php_url_decode(var, strlen(var));
php_register_variable_safe(var, "", 0, array_ptr TSRMLS_CC);
Index: php-src/main/rfc1867.c
diff -u php-src/main/rfc1867.c:1.146 php-src/main/rfc1867.c:1.147
--- php-src/main/rfc1867.c:1.146Wed Nov 12 17:34:58 2003
+++ php-src/main/rfc1867.c  Wed Nov 26 04:53:22 2003
@@ -17,7 +17,7 @@
+--+
  */
 
-/* $Id: rfc1867.c,v 1.146 2003/11/12 22:34:58 sesser Exp $ */
+/* $Id: rfc1867.c,v 1.147 2003/11/26 09:53:22 derick Exp $ */
 
 /*
  *  This product includes software developed by the Apache Group
@@ -881,22 +881,25 @@
if (!filename && param) {
 
char *value = multipart_buffer_read_body(mbuff 
TSRMLS_CC);
+   int   val_len;
 
if (!value) {
value = estrdup("");
}
 
-   sapi_module.input_filter(PARSE_POST, param, &value, 
strlen(value) TSRMLS_CC);
+   val_len = sapi_module.input_filter(PARSE_POST, param, 
&value, strlen(value) TSRMLS_CC);
+   if (val_len) {
 #if HAVE_MBSTRING && !defined(COMPILE_DL_MBSTRING)
-   if (php_mb_encoding_translation(TSRMLS_C)) {
-   php_mb_gpc_stack_variable(param, value, 
&val_list, &len_list, 
-  
   &num_vars, &num_vars_max TSRMLS_CC);
-   } else {
-   safe_php_register_variable(param, value, 
array_ptr, 0 TSRMLS_CC);
-   }
+   if (php_mb_encoding_translation(TSRMLS_C)) {
+   php_mb_gpc_stack_variable(param, 
value, &val_list, &len_list, 
+  
   &num_vars, &num_vars_max TSRMLS_CC);
+   } else {
+   safe_php_register_variable(param, 
value, array_ptr, 0 TSRMLS_CC);
+   }
 #else
-   safe_php_register_variable(param, value, array_ptr, 0 
TSRMLS_CC);
+   safe_php_register_variable(param, value, 
array_ptr, 0 TSRMLS_CC);
 #endif
+   }
if (!strcasecmp(param, "MAX_FILE_SIZE")) {
max_file_size = atol(value);
}

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



[PHP-CVS] cvs: php-src(PHP_4_3) /ext/interbase interbase.c

2003-11-26 Thread Ard Biesheuvel
abies   Wed Nov 26 09:04:57 2003 EDT

  Modified files:  (Branch: PHP_4_3)
/php-src/ext/interbase  interbase.c 
  Log:
  Fix crash bug reported by jani/ilia
  
Index: php-src/ext/interbase/interbase.c
diff -u php-src/ext/interbase/interbase.c:1.91.2.24 
php-src/ext/interbase/interbase.c:1.91.2.25
--- php-src/ext/interbase/interbase.c:1.91.2.24 Fri Nov 14 05:38:41 2003
+++ php-src/ext/interbase/interbase.c   Wed Nov 26 09:04:56 2003
@@ -17,7 +17,7 @@
+--+
  */
 
-/* $Id: interbase.c,v 1.91.2.24 2003/11/14 10:38:41 abies Exp $ */
+/* $Id: interbase.c,v 1.91.2.25 2003/11/26 14:04:56 abies Exp $ */
 
 
 /* TODO: Arrays, roles?
@@ -624,7 +624,7 @@
 
php_info_print_table_start();
php_info_print_table_row(2, "Interbase Support", "enabled");
-   php_info_print_table_row(2, "Revision", "$Revision: 1.91.2.24 $");
+   php_info_print_table_row(2, "Revision", "$Revision: 1.91.2.25 $");
 #ifdef COMPILE_DL_INTERBASE
php_info_print_table_row(2, "Dynamic Module", "yes");
 #endif
@@ -934,9 +934,9 @@
Close an InterBase connection */
 PHP_FUNCTION(ibase_close)
 {
-   zval **link_arg;
+   zval **link_arg = NULL;
ibase_db_link *ib_link;
-   int link_id;
+   int link_id = -1;

RESET_ERRMSG;

@@ -949,7 +949,6 @@
RETURN_FALSE;
}
convert_to_long_ex(link_arg);
-   link_id = Z_LVAL_PP(link_arg);
break;
default:
WRONG_PARAM_COUNT;

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



Re: [PHP-CVS] cvs: php-src /main php_variables.c rfc1867.c

2003-11-26 Thread Rasmus Lerdorf
Are you sure this is a good idea?  An empty string value in a POST has 
always caused the variable to be created and set to an empty string.  With 
this patch you are changing that behaviour.

-Rasmus

On Wed, 26 Nov 2003, Derick Rethans wrote:

> derickWed Nov 26 04:53:23 2003 EDT
> 
>   Modified files:  
> /php-src/main php_variables.c rfc1867.c 
>   Log:
>   - Prevent registration of the variable when a zero-length is returned
> from the sapi_input_filter.
>   
>   
> Index: php-src/main/php_variables.c
> diff -u php-src/main/php_variables.c:1.71 php-src/main/php_variables.c:1.72
> --- php-src/main/php_variables.c:1.71 Mon Oct 13 23:49:13 2003
> +++ php-src/main/php_variables.c  Wed Nov 26 04:53:22 2003
> @@ -17,7 +17,7 @@
> +--+
>   */
>  
> -/* $Id: php_variables.c,v 1.71 2003/10/14 03:49:13 iliaa Exp $ */
> +/* $Id: php_variables.c,v 1.72 2003/11/26 09:53:22 derick Exp $ */
>  
>  #include 
>  #include "php.h"
> @@ -213,7 +213,9 @@
>   php_url_decode(var, strlen(var));
>   val_len = php_url_decode(val, strlen(val));
>   val_len = sapi_module.input_filter(PARSE_POST, var, &val, 
> val_len TSRMLS_CC);
> - php_register_variable_safe(var, val, val_len, array_ptr 
> TSRMLS_CC);
> + if (val_len) {
> + php_register_variable_safe(var, val, val_len, 
> array_ptr TSRMLS_CC);
> + }
>   }
>   var = php_strtok_r(NULL, "&", &strtok_buf);
>   }
> @@ -308,7 +310,9 @@
>   php_url_decode(var, strlen(var));
>   val_len = php_url_decode(val, strlen(val));
>   val_len = sapi_module.input_filter(arg, var, &val, val_len 
> TSRMLS_CC);
> - php_register_variable_safe(var, val, val_len, array_ptr 
> TSRMLS_CC);
> + if (val_len) {
> + php_register_variable_safe(var, val, val_len, 
> array_ptr TSRMLS_CC);
> + }
>   } else {
>   php_url_decode(var, strlen(var));
>   php_register_variable_safe(var, "", 0, array_ptr TSRMLS_CC);
> Index: php-src/main/rfc1867.c
> diff -u php-src/main/rfc1867.c:1.146 php-src/main/rfc1867.c:1.147
> --- php-src/main/rfc1867.c:1.146  Wed Nov 12 17:34:58 2003
> +++ php-src/main/rfc1867.cWed Nov 26 04:53:22 2003
> @@ -17,7 +17,7 @@
> +--+
>   */
>  
> -/* $Id: rfc1867.c,v 1.146 2003/11/12 22:34:58 sesser Exp $ */
> +/* $Id: rfc1867.c,v 1.147 2003/11/26 09:53:22 derick Exp $ */
>  
>  /*
>   *  This product includes software developed by the Apache Group
> @@ -881,22 +881,25 @@
>   if (!filename && param) {
>  
>   char *value = multipart_buffer_read_body(mbuff 
> TSRMLS_CC);
> + int   val_len;
>  
>   if (!value) {
>   value = estrdup("");
>   }
>  
> - sapi_module.input_filter(PARSE_POST, param, &value, 
> strlen(value) TSRMLS_CC);
> + val_len = sapi_module.input_filter(PARSE_POST, param, 
> &value, strlen(value) TSRMLS_CC);
> + if (val_len) {
>  #if HAVE_MBSTRING && !defined(COMPILE_DL_MBSTRING)
> - if (php_mb_encoding_translation(TSRMLS_C)) {
> - php_mb_gpc_stack_variable(param, value, 
> &val_list, &len_list, 
> -
>&num_vars, &num_vars_max TSRMLS_CC);
> - } else {
> - safe_php_register_variable(param, value, 
> array_ptr, 0 TSRMLS_CC);
> - }
> + if (php_mb_encoding_translation(TSRMLS_C)) {
> + php_mb_gpc_stack_variable(param, 
> value, &val_list, &len_list, 
> +
>&num_vars, &num_vars_max TSRMLS_CC);
> + } else {
> + safe_php_register_variable(param, 
> value, array_ptr, 0 TSRMLS_CC);
> + }
>  #else
> - safe_php_register_variable(param, value, array_ptr, 0 
> TSRMLS_CC);
> + safe_php_register_variable(param, value, 
> array_ptr, 0 TSRMLS_CC);
>  #endif
> + }
>   if (!strcasecmp(param, "MAX_FILE_SIZE")) {
>   max_fil

Re: [PHP-CVS] cvs: php-src /main php_variables.c rfc1867.c

2003-11-26 Thread Derick Rethans
On Wed, 26 Nov 2003, Rasmus Lerdorf wrote:

> Are you sure this is a good idea?  An empty string value in a POST has
> always caused the variable to be created and set to an empty string.  With
> this patch you are changing that behaviour.

Ah, I thought they wouldn't be set. I'll cook up another patch then.

Derick

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



[PHP-CVS] cvs: spl / php_spl.c php_spl.h spl_array.c spl_engine.h /tests array.phpt array_access_001.phpt array_access_002.phpt array_iterator.phpt array_object.phpt array_read.phpt foreach.phpt foreach_break.phpt foreach_continue.phpt foreach_non_spl.phpt forward.phpt sequence.phpt

2003-11-26 Thread Marcus Boerger
helly   Wed Nov 26 18:28:36 2003 EDT

  Added files: 
/spl/tests  array_object.phpt 

  Removed files:   
/spl/tests  array.phpt array_access_001.phpt array_access_002.phpt 
array_read.phpt foreach.phpt foreach_break.phpt 
foreach_continue.phpt foreach_non_spl.phpt forward.phpt 
sequence.phpt 

  Modified files:  
/splphp_spl.c php_spl.h spl_array.c spl_engine.h 
/spl/tests  array_iterator.phpt 
  Log:
  Cleanup
  
  Index: spl/php_spl.c
diff -u spl/php_spl.c:1.19 spl/php_spl.c:1.20
--- spl/php_spl.c:1.19  Wed Nov 26 03:18:26 2003
+++ spl/php_spl.c   Wed Nov 26 18:28:34 2003
@@ -62,11 +62,6 @@
 };
 /* }}} */
 
-zend_class_entry *spl_ce_recursive_it;
-zend_class_entry *spl_ce_recursive_it_it;
-zend_class_entry *spl_ce_array_read;
-zend_class_entry *spl_ce_array_access;
-
 /* {{{ spl_functions_none
  */
 function_entry spl_functions_none[] = {
@@ -117,22 +112,6 @@
 {  
SPL_DEBUG(fprintf(stderr, "%s\n", "Shutting down SPL");)
 
-#ifdef SPL_FOREACH
-   ZEND_EXECUTE_HOOK_RESTORE(ZEND_FE_RESET);
-   ZEND_EXECUTE_HOOK_RESTORE(ZEND_FE_FETCH);
-   ZEND_EXECUTE_HOOK_RESTORE(ZEND_SWITCH_FREE);
-#endif
-
-#if defined(SPL_ARRAY_READ) | defined(SPL_ARRAY_WRITE)
-   ZEND_EXECUTE_HOOK_RESTORE(ZEND_FETCH_DIM_R);
-   ZEND_EXECUTE_HOOK_RESTORE(ZEND_FETCH_DIM_W);
-   ZEND_EXECUTE_HOOK_RESTORE(ZEND_FETCH_DIM_RW); 
-#endif
-
-#ifdef SPL_ARRAY_WRITE
-   ZEND_EXECUTE_HOOK_RESTORE(ZEND_ASSIGN_DIM);
-#endif /* SPL_ARRAY_WRITE */
-
return SUCCESS;
 }
 /* }}} */
@@ -141,30 +120,8 @@
  */
 PHP_MINFO_FUNCTION(spl)
 {
-#ifdef SPL_FOREACH
-   char *foreach = "beta";
-#else /* SPL_ARRAY_WRITE */
-   char *foreach = "beta, not hooked";
-#endif
-#ifdef SPL_ARRAY_READ
-   char *array_read = "beta";
-#else /* SPL_ARRAY_WRITE */
-   char *array_read = "beta, not hooked";
-#endif
-#ifdef SPL_ARRAY_WRITE
-   char *array_write = "beta";
-#else /* SPL_ARRAY_WRITE */
-   char *array_write = "beta, not hooked";
-#endif /* SPL_ARRAY_WRITE */
-
php_info_print_table_start();
php_info_print_table_header(2, "SPL support","enabled");
-   php_info_print_table_row(2,"iterator",   foreach);
-   php_info_print_table_row(2,"forward",foreach);
-   php_info_print_table_row(2,"sequence",   foreach);
-   php_info_print_table_row(2,"assoc",  foreach);
-   php_info_print_table_row(2,"ArrayRead", array_read);
-   php_info_print_table_row(2,"ArrayAccess",   array_write);
php_info_print_table_end();
 }
 /* }}} */
Index: spl/php_spl.h
diff -u spl/php_spl.h:1.11 spl/php_spl.h:1.12
--- spl/php_spl.h:1.11  Sun Nov  9 09:05:34 2003
+++ spl/php_spl.h   Wed Nov 26 18:28:34 2003
@@ -42,37 +42,8 @@
 PHP_RSHUTDOWN_FUNCTION(spl);
 PHP_MINFO_FUNCTION(spl);
 
-#define ZEND_EXECUTE_HOOK_PTR(name) \
-   opcode_handler_t handler_ ## name
-
-#define ZEND_EXECUTE_HOOK(name) \
-   spl_globals->handler_ ## name = zend_opcode_handlers[name]; \
-   zend_opcode_handlers[name] = spl_handler_ ## name
-
-#define ZEND_EXECUTE_HOOK_RESTORE(name) \
-   zend_opcode_handlers[name] = SPL_G(handler_ ## name)
-
-#define ZEND_EXECUTE_HOOK_ORIGINAL(name) \
-   return SPL_G(handler_ ## name)(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)
-
-#define ZEND_EXECUTE_HOOK_FUNCTION(name) \
-   int spl_handler_ ## name(ZEND_OPCODE_HANDLER_ARGS)
 
 ZEND_BEGIN_MODULE_GLOBALS(spl)
-#ifdef SPL_FOREACH
-   ZEND_EXECUTE_HOOK_PTR(ZEND_FE_RESET);
-   ZEND_EXECUTE_HOOK_PTR(ZEND_FE_FETCH);
-   ZEND_EXECUTE_HOOK_PTR(ZEND_SWITCH_FREE);
-#endif
-#if defined(SPL_ARRAY_READ) | defined(SPL_ARRAY_WRITE)
-   ZEND_EXECUTE_HOOK_PTR(ZEND_FETCH_DIM_R);
-   ZEND_EXECUTE_HOOK_PTR(ZEND_FETCH_DIM_W);
-   ZEND_EXECUTE_HOOK_PTR(ZEND_FETCH_DIM_RW);
-#endif
-#ifdef SPL_ARRAY_WRITE
-   ZEND_EXECUTE_HOOK_PTR(ZEND_ASSIGN_DIM);
-   ZEND_EXECUTE_HOOK_PTR(ZEND_UNSET_DIM_OBJ);
-#endif
 ZEND_END_MODULE_GLOBALS(spl)
 
 #ifdef ZTS
Index: spl/spl_array.c
diff -u spl/spl_array.c:1.26 spl/spl_array.c:1.27
--- spl/spl_array.c:1.26Wed Nov 26 03:18:26 2003
+++ spl/spl_array.c Wed Nov 26 18:28:34 2003
@@ -303,8 +303,8 @@
 }
 /* }}} */
 
-/* {{{ proto void spl_array::__construct(array|object ar = array())
-   proto void spl_array_it::__construct(array|object ar = array())
+/* {{{ proto void ArrayObject::__construct(array|object ar = array())
+   proto void ArrayIterator::__construct(array|object ar = array())
  Cronstructs a new array iterator from a path. */
 SPL_METHOD(Array, __construct)
 {
@@ -338,7 +338,7 @@
 }
 /* }}} */
 
-/* {{{ proto spl_array_it|NULL ArrayObject::getIterator()
+/* {{{ proto ArrayIterator ArrayObject::getIterator()
Create a new iterator from a ArrayObject instance */
 SPL_METHOD(Array, getIterator)
 {
@@ -381,7 +381,7 @@
 }
 /

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

2003-11-26 Thread Ilia Alshanetsky
iliaa   Wed Nov 26 20:08:47 2003 EDT

  Modified files:  
/php-src/ext/standard   string.c 
  Log:
  Removed dead code.
  
  
Index: php-src/ext/standard/string.c
diff -u php-src/ext/standard/string.c:1.400 php-src/ext/standard/string.c:1.401
--- php-src/ext/standard/string.c:1.400 Wed Oct 29 19:49:33 2003
+++ php-src/ext/standard/string.c   Wed Nov 26 20:08:42 2003
@@ -18,7 +18,7 @@
+--+
  */
 
-/* $Id: string.c,v 1.400 2003/10/30 00:49:33 iliaa Exp $ */
+/* $Id: string.c,v 1.401 2003/11/27 01:08:42 iliaa Exp $ */
 
 /* Synced with php 3.0 revision 1.193 1999-06-16 [ssb] */
 
@@ -862,7 +862,6 @@
 {
zval **arg1 = NULL, **arg2 = NULL, *delim, *arr;
int argc = ZEND_NUM_ARGS();
-   int arg1_separated = 0, arg2_separated = 0, delim_needs_dtor = 0;
 
if (argc < 1 || argc > 2 ||
zend_get_parameters_ex(argc, &arg1, &arg2) == FAILURE) {
@@ -880,19 +879,15 @@
ZVAL_STRINGL(delim, _IMPL_EMPTY, sizeof(_IMPL_EMPTY) - 1, 0);
 
SEPARATE_ZVAL(arg1);
-   arg1_separated = 1;
-   delim_needs_dtor = 1;   
arr = *arg1;
} else {
if (Z_TYPE_PP(arg1) == IS_ARRAY) {
SEPARATE_ZVAL(arg1);
-   arg1_separated = 1;
arr = *arg1;
convert_to_string_ex(arg2);
delim = *arg2;
} else if (Z_TYPE_PP(arg2) == IS_ARRAY) {
SEPARATE_ZVAL(arg2);
-   arg2_separated = 1;
arr = *arg2;
convert_to_string_ex(arg1);
delim = *arg1;
@@ -904,13 +899,7 @@
 
php_implode(delim, arr, return_value);
 
-   if (arg1 != NULL && arg1_separated) {
-   zval_ptr_dtor(arg1);
-   }
-   if (arg2 != NULL && arg2_separated) {
-   zval_ptr_dtor(arg2);
-   }
-   if (delim_needs_dtor) {
+   if (argc == 1) {
FREE_ZVAL(delim);
}
 }

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



[PHP-CVS] cvs: php-src(PHP_4_3) /ext/standard string.c

2003-11-26 Thread Ilia Alshanetsky
iliaa   Wed Nov 26 20:08:53 2003 EDT

  Modified files:  (Branch: PHP_4_3)
/php-src/ext/standard   string.c 
  Log:
  MFH: Removed dead code.
  
  # This fixes memory corruption reported by valgrind.
  
  
Index: php-src/ext/standard/string.c
diff -u php-src/ext/standard/string.c:1.333.2.36 
php-src/ext/standard/string.c:1.333.2.37
--- php-src/ext/standard/string.c:1.333.2.36Sun Sep 28 22:23:52 2003
+++ php-src/ext/standard/string.c   Wed Nov 26 20:08:51 2003
@@ -18,7 +18,7 @@
+--+
  */
 
-/* $Id: string.c,v 1.333.2.36 2003/09/29 02:23:52 moriyoshi Exp $ */
+/* $Id: string.c,v 1.333.2.37 2003/11/27 01:08:51 iliaa Exp $ */
 
 /* Synced with php 3.0 revision 1.193 1999-06-16 [ssb] */
 
@@ -861,7 +861,6 @@
 {
zval **arg1 = NULL, **arg2 = NULL, *delim, *arr;
int argc = ZEND_NUM_ARGS();
-   int arg1_separated = 0, arg2_separated = 0, delim_needs_dtor = 0;
 
if (argc < 1 || argc > 2 ||
zend_get_parameters_ex(argc, &arg1, &arg2) == FAILURE) {
@@ -879,19 +878,15 @@
ZVAL_STRINGL(delim, _IMPL_EMPTY, sizeof(_IMPL_EMPTY) - 1, 0);
 
SEPARATE_ZVAL(arg1);
-   arg1_separated = 1;
-   delim_needs_dtor = 1;   
arr = *arg1;
} else {
if (Z_TYPE_PP(arg1) == IS_ARRAY) {
SEPARATE_ZVAL(arg1);
-   arg1_separated = 1;
arr = *arg1;
convert_to_string_ex(arg2);
delim = *arg2;
} else if (Z_TYPE_PP(arg2) == IS_ARRAY) {
SEPARATE_ZVAL(arg2);
-   arg2_separated = 1;
arr = *arg2;
convert_to_string_ex(arg1);
delim = *arg1;
@@ -903,13 +898,7 @@
 
php_implode(delim, arr, return_value);
 
-   if (arg1 != NULL && arg1_separated) {
-   zval_ptr_dtor(arg1);
-   }
-   if (arg2 != NULL && arg2_separated) {
-   zval_ptr_dtor(arg2);
-   }
-   if (delim_needs_dtor) {
+   if (argc == 1) {
FREE_ZVAL(delim);
}
 }

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