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:
Fabien Potencier 2012-01-23 09:41:28 +01:00
parent 9eaaca0651
commit c819d84d69
3 changed files with 0 additions and 22 deletions

View File

@ -32,7 +32,6 @@ To get the diff between two versions, go to https://github.com/symfony/symfony/c
### 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 kernel.event_subscriber tag
* added a way to create relative symlinks when running assets:install command (--relative option)

View File

@ -106,14 +106,6 @@ class HttpKernel extends BaseHttpKernel
'comment' => '',
), $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'])) {
$options['alt'] = array($options['alt']);
}

View File

@ -219,17 +219,4 @@ class HttpKernelTest extends \PHPUnit_Framework_TestCase
$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())));
}
}