Revert "[FrameworkBundle] removed the possibility to pass a non-scalar attributes when calling render() to make the call works with or without a reverse proxy (closes #2941)"
This reverts commit 254e49b47c
.
This commit is contained in:
parent
9eaaca0651
commit
c819d84d69
@ -32,7 +32,6 @@ To get the diff between two versions, go to https://github.com/symfony/symfony/c
|
|||||||
|
|
||||||
### FrameworkBundle
|
### FrameworkBundle
|
||||||
|
|
||||||
* [BC BREAK] removed the possibility to pass a non-scalar attributes when calling render() to make the call works with or without a reverse proxy
|
|
||||||
* added a router:match command
|
* added a router:match command
|
||||||
* added kernel.event_subscriber tag
|
* added kernel.event_subscriber tag
|
||||||
* added a way to create relative symlinks when running assets:install command (--relative option)
|
* added a way to create relative symlinks when running assets:install command (--relative option)
|
||||||
|
@ -106,14 +106,6 @@ class HttpKernel extends BaseHttpKernel
|
|||||||
'comment' => '',
|
'comment' => '',
|
||||||
), $options);
|
), $options);
|
||||||
|
|
||||||
// enforce all attribute values to be scalars to be sure that the same
|
|
||||||
// render() call will work with or without a reverse proxy
|
|
||||||
foreach ($options['attributes'] as $key => $value) {
|
|
||||||
if (!is_scalar($value)) {
|
|
||||||
throw new \InvalidArgumentException(sprintf('Unable to render the "%s" controller as the "%s" attribute is not a scalar.', $controller, $key));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!is_array($options['alt'])) {
|
if (!is_array($options['alt'])) {
|
||||||
$options['alt'] = array($options['alt']);
|
$options['alt'] = array($options['alt']);
|
||||||
}
|
}
|
||||||
|
@ -219,17 +219,4 @@ class HttpKernelTest extends \PHPUnit_Framework_TestCase
|
|||||||
|
|
||||||
$this->assertEquals('Foo', ob_get_clean());
|
$this->assertEquals('Foo', ob_get_clean());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @expectedException \InvalidArgumentException
|
|
||||||
*/
|
|
||||||
public function testRenderOnlyAllowScalarAttributes()
|
|
||||||
{
|
|
||||||
$dispatcher = new EventDispatcher();
|
|
||||||
$resolver = $this->getMock('Symfony\\Component\\HttpKernel\\Controller\\ControllerResolverInterface');
|
|
||||||
$container = $this->getMock('Symfony\Component\DependencyInjection\ContainerInterface');
|
|
||||||
$kernel = new HttpKernel($dispatcher, $container, $resolver);
|
|
||||||
|
|
||||||
$kernel->render('/', array('attributes' => array('foo' => new \stdClass())));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user