diff --git a/CHANGELOG-2.6.md b/CHANGELOG-2.6.md index 8d179c384c..e466668f8f 100644 --- a/CHANGELOG-2.6.md +++ b/CHANGELOG-2.6.md @@ -7,6 +7,55 @@ in 2.6 minor versions. To get the diff for a specific change, go to https://github.com/symfony/symfony/commit/XXX where XXX is the change hash To get the diff between two versions, go to https://github.com/symfony/symfony/compare/v2.6.0...v2.6.1 +* 2.6.10 (2015-07-13) + + * bug #15248 Added 'default' color (jaytaph) + * bug #15243 Reload the session after regenerating its id (jakzal) + * bug #15202 [Security] allow to use `method` in XML configs (xabbuh) + * bug #15218 [Twig][Bridge] replaced `extends` with `use` in bootstrap_3_horizontal_layout.html.twig (MatTheCat) + * bug #15223 [Finder] Command::addAtIndex() fails with Command instance argument (thunderer) + * bug #15220 [DependencyInjection] Freeze also FrozenParameterBag::remove (lyrixx) + * bug #15110 Add a way to reset the singleton (dawehner) + * bug #15115 [Validator] always evaluate binary format when changed (xabbuh) + * bug #15163 Update DateTimeToArrayTransformer.php (zhil) + * bug #15150 [Translation] Azerbaijani language pluralization rule is wrong (shehi) + * bug #15159 Towards 100% HHVM compat (nicolas-grekas) + * bug #15146 Towards 100% HHVM compat (nicolas-grekas) + * bug #15069 [Form] Fixed: Data mappers always receive forms indexed by their names (webmozart) + * bug #15137 [Security] Initialize SwitchUserEvent::targetUser on attemptExitUser (Rvanlaak, xabbuh) + * bug #15126 [Validator] Fix BC for Validator's validate method (michalmarcinkowski) + * bug #15083 [DependencyInjection] Fail when dumping a Definition with no class nor factory (nicolas-grekas) + * bug #15127 [Validator] fix validation for Maestro UK card numbers (xabbuh) + * bug #15128 DbalLogger: Small nonutf8 array fix (vpetrovych, weaverryan) + * bug #15048 [Translation][Form][choice] empty_value shouldn't be translated when it has an empty value (Restless-ET) + * bug #15117 [Form] fixed sending non array data on submit to ResizeListener (BruceWouaigne) + * bug #15102 [Translation][debug cmd] fixed failing tests. (aitboudad) + * bug #13750 [DependencyInjection] Fixed decoration of service for service with parent (hason) + * bug #15086 Fixed the regexp for the validator of Maestro-based credit/debit cards (javiereguiluz) + * bug #15058 [Console] Fix STDERR output text on IBM iSeries OS400 (johnkary) + * bug #14853 [Validator] more strict e-mail validation regex (xabbuh) + * bug #15065 [Form] Fixed: remove quoted strings from Intl date formats (e.g. es_ES full pattern) (webmozart) + * bug #15039 [Translation][update cmd] taken account into bundle overrides path. (aitboudad) + * bug #15038 [Translation][debug cmd] taken account into bundle overrides path. (aitboudad) + * bug #14964 [bugfix][MonologBridge] WebProcessor: passing $extraFields to BaseWebProcessor (MacDada) + * bug #15036 [VarDumper] Fix dump output for better readability (nicolas-grekas) + * bug #15027 [Form] Fixed: Filter non-integers when selecting entities by int ID (webmozart, nicolas-grekas) + * bug #15000 [Debug] Fix fatal-errors handling on HHVM (nicolas-grekas) + * bug #14999 [Debug] Fix fatal-errors handling on HHVM (nicolas-grekas, digitalkaoz) + * bug #14959 [Debug+VarDumper] Fix handling of PHP7 "Throwable" exceptions (nicolas-grekas) + * bug #15010 [Debug] Fix log level of stacked errors (nicolas-grekas) + * bug #15017 [VarDumper] Fix uninitialized id in HtmlDumper (nicolas-grekas) + * bug #14980 Fixed fluent interface (jaytaph) + * bug #14974 [Security][Translation] #14920 update translations (vincentaubert) + * bug #14930 Bug #14836 [HttpFoundation] Moves default JSON encoding assignment fr… (Incognito) + * bug #14897 Allow new lines in Messages translated with transchoice() (replacement for #14867) (azine) + * bug #14895 [Form] Support DateTimeImmutable in transform() (c960657) + * bug #14891 without this change allways the legacy code get called (dominikzogg) + * bug #14859 Improve the config validation in TwigBundle (stof) + * bug #14785 [BrowserKit] Fix bug when uri starts with http. (amouhzi) + * bug #14807 [Security][Acl] enforce string identifiers (xabbuh) + * bug #14808 [WebProfilerBundle][logger] added missing deprecation message. (aitboudad) + * 2.6.9 (2015-05-30) * bug #14777 Avoid using the app global variable in the profiler templates (stof) diff --git a/src/Symfony/Component/HttpFoundation/Response.php b/src/Symfony/Component/HttpFoundation/Response.php index dc7203a8d1..17fb98102b 100644 --- a/src/Symfony/Component/HttpFoundation/Response.php +++ b/src/Symfony/Component/HttpFoundation/Response.php @@ -1242,7 +1242,7 @@ class Response { $status = ob_get_status(true); $level = count($status); - $flags = PHP_VERSION_ID >= 50400 ? PHP_OUTPUT_HANDLER_REMOVABLE | ($flush ? PHP_OUTPUT_HANDLER_FLUSHABLE : PHP_OUTPUT_HANDLER_CLEANABLE) : -1; + $flags = defined('PHP_OUTPUT_HANDLER_REMOVABLE') ? PHP_OUTPUT_HANDLER_REMOVABLE | ($flush ? PHP_OUTPUT_HANDLER_FLUSHABLE : PHP_OUTPUT_HANDLER_CLEANABLE) : -1; while ($level-- > $targetLevel && ($s = $status[$level]) && (!isset($s['del']) ? !isset($s['flags']) || $flags === ($s['flags'] & $flags) : $s['del'])) { if ($flush) { diff --git a/src/Symfony/Component/PropertyAccess/PropertyAccessor.php b/src/Symfony/Component/PropertyAccess/PropertyAccessor.php index a6ee7c07b2..b68d0c2ad8 100644 --- a/src/Symfony/Component/PropertyAccess/PropertyAccessor.php +++ b/src/Symfony/Component/PropertyAccess/PropertyAccessor.php @@ -88,7 +88,7 @@ class PropertyAccessor implements PropertyAccessorInterface $this->writeProperty($objectOrArray, $property, $value); } - if ($propertyValues[$i][self::IS_REF]) { + if ($propertyValues[$i][self::IS_REF] && is_object($objectOrArray)) { return; } @@ -149,7 +149,7 @@ class PropertyAccessor implements PropertyAccessorInterface } } - if ($propertyValues[$i][self::IS_REF]) { + if ($propertyValues[$i][self::IS_REF] && is_object($objectOrArray)) { return true; } } diff --git a/src/Symfony/Component/PropertyAccess/Tests/Fixtures/TestClassIsWritable.php b/src/Symfony/Component/PropertyAccess/Tests/Fixtures/TestClassIsWritable.php new file mode 100644 index 0000000000..d07c7c0fa8 --- /dev/null +++ b/src/Symfony/Component/PropertyAccess/Tests/Fixtures/TestClassIsWritable.php @@ -0,0 +1,27 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\PropertyAccess\Tests\Fixtures; + +class TestClassIsWritable +{ + protected $value; + + public function getValue() + { + return $this->value; + } + + public function __construct($value) + { + $this->value = $value; + } +} \ No newline at end of file diff --git a/src/Symfony/Component/PropertyAccess/Tests/Fixtures/TestClassSetValue.php b/src/Symfony/Component/PropertyAccess/Tests/Fixtures/TestClassSetValue.php new file mode 100644 index 0000000000..638afee6af --- /dev/null +++ b/src/Symfony/Component/PropertyAccess/Tests/Fixtures/TestClassSetValue.php @@ -0,0 +1,32 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\PropertyAccess\Tests\Fixtures; + +class TestClassSetValue +{ + protected $value; + + public function getValue() + { + return $this->value; + } + + public function setValue($value) + { + $this->value = $value; + } + + public function __construct($value) + { + $this->value = $value; + } +} \ No newline at end of file diff --git a/src/Symfony/Component/PropertyAccess/Tests/PropertyAccessorTest.php b/src/Symfony/Component/PropertyAccess/Tests/PropertyAccessorTest.php index 6fe2d2dfbf..a9f7834305 100644 --- a/src/Symfony/Component/PropertyAccess/Tests/PropertyAccessorTest.php +++ b/src/Symfony/Component/PropertyAccess/Tests/PropertyAccessorTest.php @@ -16,6 +16,8 @@ use Symfony\Component\PropertyAccess\Tests\Fixtures\TestClass; use Symfony\Component\PropertyAccess\Tests\Fixtures\TestClassMagicCall; use Symfony\Component\PropertyAccess\Tests\Fixtures\TestClassMagicGet; use Symfony\Component\PropertyAccess\Tests\Fixtures\Ticket5775Object; +use Symfony\Component\PropertyAccess\Tests\Fixtures\TestClassSetValue; +use Symfony\Component\PropertyAccess\Tests\Fixtures\TestClassIsWritable; class PropertyAccessorTest extends \PHPUnit_Framework_TestCase { @@ -446,4 +448,45 @@ class PropertyAccessorTest extends \PHPUnit_Framework_TestCase $this->propertyAccessor->setValue($obj, 'publicProperty[foo][bar]', 'Updated'); $this->assertSame('Updated', $obj->publicProperty['foo']['bar']); } -} + + public function getReferenceChainObjectsForSetValue() + { + return array( + array(array('a' => array('b' => array('c' => 'old-value'))), '[a][b][c]', 'new-value'), + array(new TestClassSetValue(new TestClassSetValue('old-value')), 'value.value', 'new-value'), + array(new TestClassSetValue(array('a' => array('b' => array('c' => new TestClassSetValue('old-value'))))), 'value[a][b][c].value', 'new-value'), + array(new TestClassSetValue(array('a' => array('b' => 'old-value'))), 'value[a][b]', 'new-value'), + array(new \ArrayIterator(array('a' => array('b' => array('c' => 'old-value')))), '[a][b][c]', 'new-value'), + ); + + } + + /** + * @dataProvider getReferenceChainObjectsForSetValue + */ + public function testSetValueForReferenceChainIssue($object, $path, $value) + { + $this->propertyAccessor->setValue($object, $path, $value); + + $this->assertEquals($value, $this->propertyAccessor->getValue($object, $path)); + } + + public function getReferenceChainObjectsForIsWritable() + { + return array( + array(new TestClassIsWritable(array('a' => array('b' => 'old-value'))), 'value[a][b]', false), + array(new TestClassIsWritable(new \ArrayIterator(array('a' => array('b' => 'old-value')))), 'value[a][b]', true), + array(new TestClassIsWritable(array('a' => array('b' => array('c' => new TestClassSetValue('old-value'))))), 'value[a][b][c].value', true), + ); + + } + + /** + * @dataProvider getReferenceChainObjectsForIsWritable + */ + public function testIsWritableForReferenceChainIssue($object, $path, $value) + { + $this->assertEquals($value, $this->propertyAccessor->isWritable($object, $path)); + } + +} \ No newline at end of file