pajoye                                   Fri, 05 Feb 2010 00:37:07 +0000

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

Log:
- Fix #48667 (Implementing Iterator and IteratorAggregate is now restricted..

Bug: http://bugs.php.net/48667 (Closed) "could not implement" - NOT redefining 
functions
      
Changed paths:
    _U  php/php-src/branches/PHP_5_3_2/
    A + php/php-src/branches/PHP_5_3_2/Zend/tests/bug48667_1.phpt
        (from php/php-src/branches/PHP_5_3/Zend/tests/bug48667_1.phpt:r294304)
    A + php/php-src/branches/PHP_5_3_2/Zend/tests/bug48667_2.phpt
        (from php/php-src/branches/PHP_5_3/Zend/tests/bug48667_2.phpt:r294304)
    U   php/php-src/branches/PHP_5_3_2/Zend/zend_interfaces.c
    _U  php/php-src/branches/PHP_5_3_2/ext/tidy/tests/
    _U  
php/php-src/branches/PHP_5_3_2/tests/security/open_basedir_parse_ini_file.phpt


Property changes on: php/php-src/branches/PHP_5_3_2
___________________________________________________________________
Modified: svn:mergeinfo
   - 
/php/php-src/branches/PHP_5_3:292504,292574,292594-292595,292611,292624,292630,292632-292635,292654,292677,292682-292683,292693,292716,292719,292762,292765,292771,292777,292823,293051,293075,293114,293126,293131,293144,293146,293152,293176,293180,293216,293235,293253,293268,293341,293380,293400,293442,293447,293466,293487,293502,293538,293548,293558,293588,293590,293597,293627,293644,293653,293655,293699,293726-293728,293732,293735,293762,293768,293804,293815-293816,293862,293897,293901-293902,293906,293965,293974,293976,293985,293998,294040,294053,294075,294089,294094,294100,294102,294104,294259,294267,294269,294272,294278,294285,294302-294303,294307,294310,294312-294313,294317,294320-294323,294334-294335,294418,294421,294487,294498,294532
/php/php-src/trunk:284726
   + 
/php/php-src/branches/PHP_5_3:292504,292574,292594-292595,292611,292624,292630,292632-292635,292654,292677,292682-292683,292693,292716,292719,292762,292765,292771,292777,292823,293051,293075,293114,293126,293131,293144,293146,293152,293176,293180,293216,293235,293253,293268,293341,293380,293400,293442,293447,293466,293487,293502,293538,293548,293558,293588,293590,293597,293627,293644,293653,293655,293699,293726-293728,293732,293735,293762,293768,293804,293815-293816,293862,293897,293901-293902,293906,293965,293974,293976,293985,293998,294040,294053,294075,294089,294094,294100,294102,294104,294259,294267,294269,294272,294278,294285,294302-294304,294307,294310,294312-294313,294317,294320-294323,294333-294336,294418,294421,294487,294498,294532
/php/php-src/trunk:284726

Copied: php/php-src/branches/PHP_5_3_2/Zend/tests/bug48667_1.phpt (from rev 
294304, php/php-src/branches/PHP_5_3/Zend/tests/bug48667_1.phpt)
===================================================================
--- php/php-src/branches/PHP_5_3_2/Zend/tests/bug48667_1.phpt                   
        (rev 0)
+++ php/php-src/branches/PHP_5_3_2/Zend/tests/bug48667_1.phpt   2010-02-05 
00:37:07 UTC (rev 294549)
@@ -0,0 +1,10 @@
+--TEST--
+Bug #48667 (Implementing both iterator and iteratoraggregate)
+--FILE--
+<?php
+
+abstract class A implements Iterator, IteratorAggregate { }
+
+?>
+--EXPECTF--
+Fatal error: Class A cannot implement both IteratorAggregate and Iterator at 
the same time in %s on line %d

Copied: php/php-src/branches/PHP_5_3_2/Zend/tests/bug48667_2.phpt (from rev 
294304, php/php-src/branches/PHP_5_3/Zend/tests/bug48667_2.phpt)
===================================================================
--- php/php-src/branches/PHP_5_3_2/Zend/tests/bug48667_2.phpt                   
        (rev 0)
+++ php/php-src/branches/PHP_5_3_2/Zend/tests/bug48667_2.phpt   2010-02-05 
00:37:07 UTC (rev 294549)
@@ -0,0 +1,10 @@
+--TEST--
+Bug #48667 (Implementing both iterator and iteratoraggregate)
+--FILE--
+<?php
+
+abstract class A implements IteratorAggregate, Iterator { }
+
+?>
+--EXPECTF--
+Fatal error: Class A cannot implement both Iterator and IteratorAggregate at 
the same time in %s on line %d

Modified: php/php-src/branches/PHP_5_3_2/Zend/zend_interfaces.c
===================================================================
--- php/php-src/branches/PHP_5_3_2/Zend/zend_interfaces.c       2010-02-05 
00:19:32 UTC (rev 294548)
+++ php/php-src/branches/PHP_5_3_2/Zend/zend_interfaces.c       2010-02-05 
00:37:07 UTC (rev 294549)
@@ -353,6 +353,10 @@
                        if (class_type->num_interfaces) {
                                for (i = 0; i < class_type->num_interfaces; 
i++) {
                                        if (class_type->interfaces[i] == 
zend_ce_iterator) {
+                                               zend_error(E_ERROR, "Class %s 
cannot implement both %s and %s at the same time",
+                                                                       
class_type->name,
+                                                                       
interface->name,
+                                                                       
zend_ce_iterator->name);
                                                return FAILURE;
                                        }
                                        if (class_type->interfaces[i] == 
zend_ce_traversable) {
@@ -378,8 +382,14 @@
                if (class_type->type == ZEND_INTERNAL_CLASS) {
                        /* inheritance ensures the class has the necessary 
userland methods */
                        return SUCCESS;
-               } else if (class_type->get_iterator != 
zend_user_it_get_new_iterator) {
+               } else {
                        /* c-level get_iterator cannot be changed */
+                       if (class_type->get_iterator == 
zend_user_it_get_new_iterator) {
+                               zend_error(E_ERROR, "Class %s cannot implement 
both %s and %s at the same time",
+                                                       class_type->name,
+                                                       interface->name,
+                                                       
zend_ce_aggregate->name);
+                       }
                        return FAILURE;
                }
        }


Property changes on: php/php-src/branches/PHP_5_3_2/ext/tidy/tests
___________________________________________________________________
Modified: svn:mergeinfo
   - 
/php/php-src/branches/PHP_5_3/ext/tidy/tests:292562,292566,292571,292574,292635,292716,292719,292765,293146,293152,293176,293180,293216,293235,293253,293380,293400,293442,293447,293466,293487,293502,293538,293548,293558,293588,293590,293597,293627,293644,293653,293655,293699,293726-293728,293732,293735,293762,293768,293804,293815-293816,293862,293897,293901-293902,293906,293965,293976,293985,293998,294040,294053,294075,294089,294094,294100,294102,294104,294259,294267,294269,294272,294278,294285,294302-294303,294307,294310,294312-294313,294317,294320-294323,294334-294335,294418,294421,294487,294498,294532
/php/php-src/trunk/ext/tidy/tests:29815-29816,284726,287798-287941
   + 
/php/php-src/branches/PHP_5_3/ext/tidy/tests:292562,292566,292571,292574,292635,292716,292719,292765,293146,293152,293176,293180,293216,293235,293253,293380,293400,293442,293447,293466,293487,293502,293538,293548,293558,293588,293590,293597,293627,293644,293653,293655,293699,293726-293728,293732,293735,293762,293768,293804,293815-293816,293862,293897,293901-293902,293906,293965,293976,293985,293998,294040,294053,294075,294089,294094,294100,294102,294104,294259,294267,294269,294272,294278,294285,294302-294304,294307,294310,294312-294313,294317,294320-294323,294333-294336,294418,294421,294487,294498,294532
/php/php-src/trunk/ext/tidy/tests:29815-29816,284726,287798-287941


Property changes on: 
php/php-src/branches/PHP_5_3_2/tests/security/open_basedir_parse_ini_file.phpt
___________________________________________________________________
Modified: svn:mergeinfo
   - 
/php/php-src/branches/PHP_5_3/tests/security/open_basedir_parse_ini_file.phpt:292562,292566,292571,292574,292716,293146,293152,293176,293180,293216,293235,293253,293380,293400,293442,293447,293466,293487,293502,293538,293548,293558,293588,293590,293597,293627,293644,293653,293655,293699,293726-293728,293732,293735,293762,293768,293804,293815-293816,293862,293897,293901-293902,293906,293965,293976,293985,293998,294040,294053,294075,294089,294094,294100,294102,294104,294259,294267,294269,294272,294278,294285,294302-294303,294307,294310,294312-294313,294317,294320-294323,294334-294335,294418,294421,294487,294498,294532
/php/php-src/trunk/tests/security/open_basedir_parse_ini_file.phpt:29815-29816,265951
   + 
/php/php-src/branches/PHP_5_3/tests/security/open_basedir_parse_ini_file.phpt:292562,292566,292571,292574,292716,293146,293152,293176,293180,293216,293235,293253,293380,293400,293442,293447,293466,293487,293502,293538,293548,293558,293588,293590,293597,293627,293644,293653,293655,293699,293726-293728,293732,293735,293762,293768,293804,293815-293816,293862,293897,293901-293902,293906,293965,293976,293985,293998,294040,294053,294075,294089,294094,294100,294102,294104,294259,294267,294269,294272,294278,294285,294302-294304,294307,294310,294312-294313,294317,294320-294323,294333-294336,294418,294421,294487,294498,294532
/php/php-src/trunk/tests/security/open_basedir_parse_ini_file.phpt:29815-29816,265951

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

Reply via email to