[PHP-CVS] svn: /php/php-src/trunk/ ext/standard/tests/general_functions/bug60227.phpt main/SAPI.c
hirokawa Sun, 06 Nov 2011 11:07:14 + Revision: http://svn.php.net/viewvc?view=revision&revision=318820 Log: fixed bug #60227: header() cannot detect the multi-line header with CR. Bug: https://bugs.php.net/60227 (Open) header() cannot detect the multi-line header with CR(0x0D). Changed paths: A php/php-src/trunk/ext/standard/tests/general_functions/bug60227.phpt U php/php-src/trunk/main/SAPI.c Added: php/php-src/trunk/ext/standard/tests/general_functions/bug60227.phpt === --- php/php-src/trunk/ext/standard/tests/general_functions/bug60227.phpt (rev 0) +++ php/php-src/trunk/ext/standard/tests/general_functions/bug60227.phpt 2011-11-06 11:07:14 UTC (rev 318820) @@ -0,0 +1,20 @@ +--TEST-- +Bug #60227 (header() cannot detect the multi-line header with CR) +--FILE-- + +--EXPECTF-- +Warning: Header may not contain more than a single header, new line detected. in %s on line %d +foo +--EXPECTHEADERS-- +X-Foo1: a +X-Foo2: b +X-Foo3: c +X-Foo4: d + Property changes on: php/php-src/trunk/ext/standard/tests/general_functions/bug60227.phpt ___ Added: svn:keywords + Id Rev Revision Added: svn:eol-style + native Modified: php/php-src/trunk/main/SAPI.c === --- php/php-src/trunk/main/SAPI.c 2011-11-06 07:41:04 UTC (rev 318819) +++ php/php-src/trunk/main/SAPI.c 2011-11-06 11:07:14 UTC (rev 318820) @@ -712,7 +712,7 @@ } else { /* new line safety check */ char *s = header_line, *e = header_line + header_line_len, *p; - while (s < e && (p = memchr(s, '\n', (e - s { + while (s < e && ((p = memchr(s, '\n', (e - s))) || (p = memchr(s, '\r', (e - s) { if (*(p + 1) == ' ' || *(p + 1) == '\t') { s = p + 1; continue; -- 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_4/NEWS branches/PHP_5_4/UPGRADING branches/PHP_5_4/Zend/tests/indirect_method_call_001.phpt branches/PHP_5_4/Zend/tests/indirect_method_call_002.phpt branch
felipe Sun, 06 Nov 2011 13:25:45 + Revision: http://svn.php.net/viewvc?view=revision&revision=318823 Log: - Added class member access on instantiation (e.g. (new foo)->bar()) support Changed paths: U php/php-src/branches/PHP_5_4/NEWS U php/php-src/branches/PHP_5_4/UPGRADING A php/php-src/branches/PHP_5_4/Zend/tests/indirect_method_call_001.phpt A php/php-src/branches/PHP_5_4/Zend/tests/indirect_method_call_002.phpt A php/php-src/branches/PHP_5_4/Zend/tests/indirect_method_call_003.phpt A php/php-src/branches/PHP_5_4/Zend/tests/indirect_method_call_004.phpt A php/php-src/branches/PHP_5_4/Zend/tests/indirect_method_call_005.phpt A php/php-src/branches/PHP_5_4/Zend/tests/indirect_property_access.phpt U php/php-src/branches/PHP_5_4/Zend/zend_language_parser.y A php/php-src/trunk/Zend/tests/indirect_method_call_001.phpt A php/php-src/trunk/Zend/tests/indirect_method_call_002.phpt A php/php-src/trunk/Zend/tests/indirect_method_call_003.phpt A php/php-src/trunk/Zend/tests/indirect_method_call_004.phpt A php/php-src/trunk/Zend/tests/indirect_method_call_005.phpt A php/php-src/trunk/Zend/tests/indirect_property_access.phpt U php/php-src/trunk/Zend/zend_language_parser.y Modified: php/php-src/branches/PHP_5_4/NEWS === --- php/php-src/branches/PHP_5_4/NEWS 2011-11-06 12:13:29 UTC (rev 318822) +++ php/php-src/branches/PHP_5_4/NEWS 2011-11-06 13:25:45 UTC (rev 318823) @@ -3,6 +3,8 @@ ?? ??? 2011, PHP 5.4.0 RC1 - General improvements: . Changed silent conversion of array to string to produce a notice. (Patrick) + . Added class member access on instantiation (e.g. (new foo)->bar()) support. +(Felipe) - CLI SAPI: . Fixed bug #60112 (If URI does not contain a file, index.php is not served). Modified: php/php-src/branches/PHP_5_4/UPGRADING === --- php/php-src/branches/PHP_5_4/UPGRADING 2011-11-06 12:13:29 UTC (rev 318822) +++ php/php-src/branches/PHP_5_4/UPGRADING 2011-11-06 13:25:45 UTC (rev 318823) @@ -461,6 +461,10 @@ $y = "o"; A::{$x.$y.$y}(); +- Class member acces on instantiation: + (new foo)->method() + (new foo)->property + (new foo)[0] === 13. Windows support Added: php/php-src/branches/PHP_5_4/Zend/tests/indirect_method_call_001.phpt === --- php/php-src/branches/PHP_5_4/Zend/tests/indirect_method_call_001.phpt (rev 0) +++ php/php-src/branches/PHP_5_4/Zend/tests/indirect_method_call_001.phpt 2011-11-06 13:25:45 UTC (rev 318823) @@ -0,0 +1,20 @@ +--TEST-- +Testing indirect method call and exceptions +--FILE-- +Inexistent(3); +} catch (Exception $e) { + var_dump($e->getMessage()); // foobar +} + +?> +--EXPECT-- +string(6) "foobar" Added: php/php-src/branches/PHP_5_4/Zend/tests/indirect_method_call_002.phpt === --- php/php-src/branches/PHP_5_4/Zend/tests/indirect_method_call_002.phpt (rev 0) +++ php/php-src/branches/PHP_5_4/Zend/tests/indirect_method_call_002.phpt 2011-11-06 13:25:45 UTC (rev 318823) @@ -0,0 +1,32 @@ +--TEST-- +Indirect method call with chaining +--FILE-- +bar()); // string(3) "foo" +var_dump((new foo())->baz()->x);// string(7) "testing" +var_dump((new foo())->baz()->baz()->bar()); // string(3) "foo" +var_dump((new foo())->xyz()); // NULL +(new foo())->www(); + +?> +--EXPECTF-- +string(3) "foo" +string(7) "testing" +string(3) "foo" +NULL + +Fatal error: Call to undefined method foo::www() in %s on line %d Added: php/php-src/branches/PHP_5_4/Zend/tests/indirect_method_call_003.phpt === --- php/php-src/branches/PHP_5_4/Zend/tests/indirect_method_call_003.phpt (rev 0) +++ php/php-src/branches/PHP_5_4/Zend/tests/indirect_method_call_003.phpt 2011-11-06 13:25:45 UTC (rev 318823) @@ -0,0 +1,23 @@ +--TEST-- +Testing indirect method call +--FILE-- +x; + } + public function setX($val) { + $this->x = $val; + return $this; + } +} + +$X = (new foo)->setX(10)->getX(); +var_dump($X); // int(10) + +?> +--EXPECT-- +int(10) Added: php/php-src/branches/PHP_5_4/Zend/tests/indirect_method_call_004.phpt === --- php/php-src/branches/PHP_5_4/Zend/tests/indirect_method_call_004.phpt (rev 0) +++ php/php-src/branches/PHP_5_4/Zend/tests/indirect_method_call_004.phpt 2011-11-06 13:25:45 UTC (rev 318823) @@ -0,0 +1,26 @@ +--TEST-- +Indirect method call and cloning +--FILE-- +z = new stdclass; + } + public function getZ() { + return $this->z; + } +} + +var_dump(clone (new bar)->z); +var_dump(clone (new bar)->getZ()); + +?> +--EXPE