[PHP-CVS] svn: /php/php-src/trunk/ext/reflection/ php_reflection.c

2010-08-01 Thread Felipe Pena
felipe   Mon, 02 Aug 2010 01:35:02 +

Revision: http://svn.php.net/viewvc?view=revision&revision=301776

Log:
- Added missing parameter checks for new methods (trunk only)

Changed paths:
U   php/php-src/trunk/ext/reflection/php_reflection.c

Modified: php/php-src/trunk/ext/reflection/php_reflection.c
===
--- php/php-src/trunk/ext/reflection/php_reflection.c   2010-08-02 00:15:55 UTC 
(rev 301775)
+++ php/php-src/trunk/ext/reflection/php_reflection.c   2010-08-02 01:35:02 UTC 
(rev 301776)
@@ -2378,6 +2378,9 @@
reflection_object *intern;
parameter_reference *param;

+   if (zend_parse_parameters_none() == FAILURE) {
+   return;
+   }
GET_REFLECTION_OBJECT_PTR(param);

RETVAL_BOOL(param->arg_info->type_hint == IS_LONG);
@@ -2391,6 +2394,9 @@
reflection_object *intern;
parameter_reference *param;

+   if (zend_parse_parameters_none() == FAILURE) {
+   return;
+   }
GET_REFLECTION_OBJECT_PTR(param);

RETVAL_BOOL(param->arg_info->type_hint == IS_DOUBLE);
@@ -2404,6 +2410,9 @@
reflection_object *intern;
parameter_reference *param;

+   if (zend_parse_parameters_none() == FAILURE) {
+   return;
+   }
GET_REFLECTION_OBJECT_PTR(param);

RETVAL_BOOL(param->arg_info->type_hint == IS_BOOL);
@@ -2417,6 +2426,9 @@
reflection_object *intern;
parameter_reference *param;

+   if (zend_parse_parameters_none() == FAILURE) {
+   return;
+   }
GET_REFLECTION_OBJECT_PTR(param);

RETVAL_BOOL(param->arg_info->type_hint == IS_OBJECT);
@@ -2430,6 +2442,9 @@
reflection_object *intern;
parameter_reference *param;

+   if (zend_parse_parameters_none() == FAILURE) {
+   return;
+   }
GET_REFLECTION_OBJECT_PTR(param);

RETVAL_BOOL(param->arg_info->type_hint == IS_STRING);
@@ -2443,6 +2458,9 @@
reflection_object *intern;
parameter_reference *param;

+   if (zend_parse_parameters_none() == FAILURE) {
+   return;
+   }
GET_REFLECTION_OBJECT_PTR(param);

RETVAL_BOOL(param->arg_info->type_hint == IS_RESOURCE);
@@ -2456,6 +2474,9 @@
reflection_object *intern;
parameter_reference *param;

+   if (zend_parse_parameters_none() == FAILURE) {
+   return;
+   }
GET_REFLECTION_OBJECT_PTR(param);

if (!param->arg_info->type_hint) {

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

[PHP-CVS] svn: /php/php-src/trunk/ NEWS

2010-08-01 Thread Stefan Marr
gron Sun, 01 Aug 2010 20:53:32 +

Revision: http://svn.php.net/viewvc?view=revision&revision=301768

Log:
Added Traits to the NEWS file.
#There doesn't seem to be a consitent ordering,
#so I put it in front of the list, since it is a major language addition. Hope 
thats ok.

Changed paths:
U   php/php-src/trunk/NEWS

Modified: php/php-src/trunk/NEWS
===
--- php/php-src/trunk/NEWS  2010-08-01 18:19:09 UTC (rev 301767)
+++ php/php-src/trunk/NEWS  2010-08-01 20:53:32 UTC (rev 301768)
@@ -30,6 +30,7 @@
 - Added an optimization which saves memory and emalloc/efree calls for empty
   HashTables (Stas, Dmitry)

+- Added support for Traits. (Stefan)
 - Added array dereferencing support. (Felipe)
 - Added DTrace support. (David Soria Parra)
 - Added Tokyo Cabinet abstract DB support to ext/dba. (Michael Maclean)

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

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/NEWS branches/PHP_5_3/ext/wddx/tests/bug52468.phpt branches/PHP_5_3/ext/wddx/wddx.c trunk/ext/wddx/tests/bug52468.phpt trunk/ext/wddx/wddx.c

2010-08-01 Thread Felipe Pena
felipe   Sun, 01 Aug 2010 17:34:09 +

Revision: http://svn.php.net/viewvc?view=revision&revision=301765

Log:
- Fixed bug #52468 (wddx_deserialize corrupts integer field value when left 
empty)

Bug: http://bugs.php.net/52468 (Open) wddx_deserialize corrupts integer field 
value when left empty
  
Changed paths:
U   php/php-src/branches/PHP_5_3/NEWS
A   php/php-src/branches/PHP_5_3/ext/wddx/tests/bug52468.phpt
U   php/php-src/branches/PHP_5_3/ext/wddx/wddx.c
A   php/php-src/trunk/ext/wddx/tests/bug52468.phpt
U   php/php-src/trunk/ext/wddx/wddx.c

Modified: php/php-src/branches/PHP_5_3/NEWS
===
--- php/php-src/branches/PHP_5_3/NEWS   2010-08-01 16:24:42 UTC (rev 301764)
+++ php/php-src/branches/PHP_5_3/NEWS   2010-08-01 17:34:09 UTC (rev 301765)
@@ -6,6 +6,8 @@
 - Fixed bug #52487 (PDO::FETCH_INTO leaks memory). (Felipe)
 - Fixed bug #52484 (__set() ignores setting properties with empty names).
   (Felipe)
+- Fixed bug #52468 (wddx_deserialize corrupts integer field value when left
+  empty). (Felipe)
 - Fixed bug #52436 (Compile error if systems do not have stdint.h)
   (Sriram Natarajan)


Added: php/php-src/branches/PHP_5_3/ext/wddx/tests/bug52468.phpt
===
--- php/php-src/branches/PHP_5_3/ext/wddx/tests/bug52468.phpt   
(rev 0)
+++ php/php-src/branches/PHP_5_3/ext/wddx/tests/bug52468.phpt   2010-08-01 
17:34:09 UTC (rev 301765)
@@ -0,0 +1,20 @@
+--TEST--
+Bug #52468 (wddx_deserialize corrupts integer field value when left empty)
+--FILE--
+my_command";
+
+print_r(wddx_deserialize($message));
+print_r(wddx_deserialize($message));
+
+?>
+--EXPECT--
+Array
+(
+[handle] => 0
+)
+Array
+(
+[handle] => 0
+)


Property changes on: php/php-src/branches/PHP_5_3/ext/wddx/tests/bug52468.phpt
___
Added: svn:keywords
   + Id Rev Revision
Added: svn:eol-style
   + native

Modified: php/php-src/branches/PHP_5_3/ext/wddx/wddx.c
===
--- php/php-src/branches/PHP_5_3/ext/wddx/wddx.c2010-08-01 16:24:42 UTC 
(rev 301764)
+++ php/php-src/branches/PHP_5_3/ext/wddx/wddx.c2010-08-01 17:34:09 UTC 
(rev 301765)
@@ -785,6 +785,7 @@
ALLOC_ZVAL(ent.data);
INIT_PZVAL(ent.data);
Z_TYPE_P(ent.data) = IS_LONG;
+   Z_LVAL_P(ent.data) = 0;
wddx_stack_push((wddx_stack *)stack, &ent, sizeof(st_entry));
} else if (!strcmp(name, EL_BOOLEAN)) {
int i;

Added: php/php-src/trunk/ext/wddx/tests/bug52468.phpt
===
--- php/php-src/trunk/ext/wddx/tests/bug52468.phpt  
(rev 0)
+++ php/php-src/trunk/ext/wddx/tests/bug52468.phpt  2010-08-01 17:34:09 UTC 
(rev 301765)
@@ -0,0 +1,20 @@
+--TEST--
+Bug #52468 (wddx_deserialize corrupts integer field value when left empty)
+--FILE--
+my_command";
+
+print_r(wddx_deserialize($message));
+print_r(wddx_deserialize($message));
+
+?>
+--EXPECT--
+Array
+(
+[handle] => 0
+)
+Array
+(
+[handle] => 0
+)


Property changes on: php/php-src/trunk/ext/wddx/tests/bug52468.phpt
___
Added: svn:keywords
   + Id Rev Revision
Added: svn:eol-style
   + native

Modified: php/php-src/trunk/ext/wddx/wddx.c
===
--- php/php-src/trunk/ext/wddx/wddx.c   2010-08-01 16:24:42 UTC (rev 301764)
+++ php/php-src/trunk/ext/wddx/wddx.c   2010-08-01 17:34:09 UTC (rev 301765)
@@ -785,6 +785,7 @@
ALLOC_ZVAL(ent.data);
INIT_PZVAL(ent.data);
Z_TYPE_P(ent.data) = IS_LONG;
+   Z_LVAL_P(ent.data) = 0;
wddx_stack_push((wddx_stack *)stack, &ent, sizeof(st_entry));
} else if (!strcmp(name, EL_BOOLEAN)) {
int i;

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

[PHP-CVS] svn: /php/php-src/trunk/ext/standard/tests/general_functions/ putenv_error1.phpt putenv_error2.phpt

2010-08-01 Thread Felipe Pena
felipe   Sun, 01 Aug 2010 16:24:42 +

Revision: http://svn.php.net/viewvc?view=revision&revision=301764

Log:
- Removed safe-mode tests

Changed paths:
D   
php/php-src/trunk/ext/standard/tests/general_functions/putenv_error1.phpt
D   
php/php-src/trunk/ext/standard/tests/general_functions/putenv_error2.phpt

Deleted: 
php/php-src/trunk/ext/standard/tests/general_functions/putenv_error1.phpt
===
--- php/php-src/trunk/ext/standard/tests/general_functions/putenv_error1.phpt   
2010-08-01 16:08:45 UTC (rev 301763)
+++ php/php-src/trunk/ext/standard/tests/general_functions/putenv_error1.phpt   
2010-08-01 16:24:42 UTC (rev 301764)
@@ -1,28 +0,0 @@
---TEST--
-putenv() - usage in safe mode with safe_mode_allowed_env_vars set
---CREDITS--
-Brian DeShong 
---INI--
-safe_mode=1
-safe_mode_allowed_env_vars=TESTING_
---SKIPIF--
-
---FILE--
-
-==DONE==
---EXPECTF--
-Warning: Directive 'safe_mode' is deprecated in PHP 5.3 and greater in Unknown 
on line 0
-
-Warning: putenv(): Safe Mode warning: Cannot set environment variable 'FOO' - 
it's not in the allowed list in %s on line %d
-
-Warning: putenv(): Safe Mode warning: Cannot set environment variable 'BAZ' - 
it's not in the allowed list in %s on line %d
-it worked
-it worked
-==DONE==

Deleted: 
php/php-src/trunk/ext/standard/tests/general_functions/putenv_error2.phpt
===
--- php/php-src/trunk/ext/standard/tests/general_functions/putenv_error2.phpt   
2010-08-01 16:08:45 UTC (rev 301763)
+++ php/php-src/trunk/ext/standard/tests/general_functions/putenv_error2.phpt   
2010-08-01 16:24:42 UTC (rev 301764)
@@ -1,22 +0,0 @@
---TEST--
-putenv() - usage in safe mode with safe_mode_protected_env_vars set
---CREDITS--
-Brian DeShong 
---INI--
-safe_mode=1
-safe_mode_protected_env_vars=FOO,BAZ
---SKIPIF--
-
---FILE--
-
-==DONE==
---EXPECTF--
-Warning: Directive 'safe_mode' is deprecated in PHP 5.3 and greater in Unknown 
on line 0
-
-Warning: putenv(): Safe Mode warning: Cannot override protected environment 
variable 'FOO' in %s on line %d
-
-Warning: putenv(): Safe Mode warning: Cannot override protected environment 
variable 'BAZ' in %s on line %d
-==DONE==

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

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/NEWS branches/PHP_5_3/Zend/tests/bug52484.phpt branches/PHP_5_3/Zend/tests/bug52484_2.phpt branches/PHP_5_3/Zend/tests/bug52484_3.phpt branches/PHP_5_3/Ze

2010-08-01 Thread Felipe Pena
felipe   Sun, 01 Aug 2010 13:27:02 +

Revision: http://svn.php.net/viewvc?view=revision&revision=301755

Log:
- Fixed bug #52484 (__set() ignores setting properties with empty names)

Bug: http://bugs.php.net/52484 (Open) __set() ignores setting properties with 
empty names
  
Changed paths:
U   php/php-src/branches/PHP_5_3/NEWS
A   php/php-src/branches/PHP_5_3/Zend/tests/bug52484.phpt
A   php/php-src/branches/PHP_5_3/Zend/tests/bug52484_2.phpt
A   php/php-src/branches/PHP_5_3/Zend/tests/bug52484_3.phpt
U   php/php-src/branches/PHP_5_3/Zend/zend_object_handlers.c
A   php/php-src/trunk/Zend/tests/bug52484.phpt
A   php/php-src/trunk/Zend/tests/bug52484_2.phpt
A   php/php-src/trunk/Zend/tests/bug52484_3.phpt
U   php/php-src/trunk/Zend/zend_object_handlers.c

Modified: php/php-src/branches/PHP_5_3/NEWS
===
--- php/php-src/branches/PHP_5_3/NEWS	2010-08-01 04:03:08 UTC (rev 301754)
+++ php/php-src/branches/PHP_5_3/NEWS	2010-08-01 13:27:02 UTC (rev 301755)
@@ -2,6 +2,8 @@
 |||
 ?? ??? 2010, PHP 5.3.4
 - Fixed bug #52487 (PDO::FETCH_INTO leaks memory). (Felipe)
+- Fixed bug #52484 (__set() ignores setting properties with empty names).
+  (Felipe)
 - Fixed bug #52436 (Compile error if systems do not have stdint.h)
   (Sriram Natarajan)


Added: php/php-src/branches/PHP_5_3/Zend/tests/bug52484.phpt
===
--- php/php-src/branches/PHP_5_3/Zend/tests/bug52484.phpt	(rev 0)
+++ php/php-src/branches/PHP_5_3/Zend/tests/bug52484.phpt	2010-08-01 13:27:02 UTC (rev 301755)
@@ -0,0 +1,19 @@
+--TEST--
+Bug #52484 (__set() ignores setting properties with empty names)
+--FILE--
+$prop);
+	}
+}
+
+$a = new A();
+$prop = null;
+
+unset($a->$prop);
+
+?>
+--EXPECTF--
+Fatal error: Cannot access empty property in %s on line %d


Property changes on: php/php-src/branches/PHP_5_3/Zend/tests/bug52484.phpt
___
Added: svn:keywords
   + Id Rev Revision
Added: svn:eol-style
   + native

Added: php/php-src/branches/PHP_5_3/Zend/tests/bug52484_2.phpt
===
--- php/php-src/branches/PHP_5_3/Zend/tests/bug52484_2.phpt	(rev 0)
+++ php/php-src/branches/PHP_5_3/Zend/tests/bug52484_2.phpt	2010-08-01 13:27:02 UTC (rev 301755)
@@ -0,0 +1,19 @@
+--TEST--
+Bug #52484.2 (__set() ignores setting properties with empty names)
+--FILE--
+$prop = $val;
+	}
+}
+
+$a = new A();
+$prop = null;
+
+$a->$prop = 2;
+
+?>
+--EXPECTF--
+Fatal error: Cannot access empty property in %s on line %d


Property changes on: php/php-src/branches/PHP_5_3/Zend/tests/bug52484_2.phpt
___
Added: svn:keywords
   + Id Rev Revision
Added: svn:eol-style
   + native

Added: php/php-src/branches/PHP_5_3/Zend/tests/bug52484_3.phpt
===
--- php/php-src/branches/PHP_5_3/Zend/tests/bug52484_3.phpt	(rev 0)
+++ php/php-src/branches/PHP_5_3/Zend/tests/bug52484_3.phpt	2010-08-01 13:27:02 UTC (rev 301755)
@@ -0,0 +1,19 @@
+--TEST--
+Bug #52484.3 (__set() ignores setting properties with empty names)
+--FILE--
+$prop);
+	}
+}
+
+$a = new A();
+$prop = null;
+
+var_dump($a->$prop);
+
+?>
+--EXPECTF--
+Fatal error: Cannot access empty property in %s on line %d


Property changes on: php/php-src/branches/PHP_5_3/Zend/tests/bug52484_3.phpt
___
Added: svn:keywords
   + Id Rev Revision
Added: svn:eol-style
   + native

Modified: php/php-src/branches/PHP_5_3/Zend/zend_object_handlers.c
===
--- php/php-src/branches/PHP_5_3/Zend/zend_object_handlers.c	2010-08-01 04:03:08 UTC (rev 301754)
+++ php/php-src/branches/PHP_5_3/Zend/zend_object_handlers.c	2010-08-01 13:27:02 UTC (rev 301755)
@@ -340,7 +340,7 @@
 	property_info = zend_get_property_info(zobj->ce, member, (zobj->ce->__get != NULL) TSRMLS_CC);

 	if (!property_info || zend_hash_quick_find(zobj->properties, property_info->name, property_info->name_length+1, property_info->h, (void **) &retval) == FAILURE) {
-		zend_guard *guard;
+		zend_guard *guard = NULL;

 		if (zobj->ce->__get &&
 		zend_get_property_guard(zobj, property_info, member, &guard) == SUCCESS &&
@@ -373,6 +373,15 @@
 			}
 			zval_ptr_dtor(&object);
 		} else {
+			if (zobj->ce->__get && guard && guard->in_get == 1) {
+if (Z_STRVAL_P(member)[0] == '\0') {
+	if (Z_STRLEN_P(member) == 0) {
+		zend_error(E_ERROR, "Cannot access empty property");
+	} else {
+		zend_error(E_ERROR, "Cannot access property started with '\\0'");
+	}
+}
+			}
 			if