merged branch shieldo/fix_exception_in_encoder_factory (PR #4621)

Commits
-------

d4b0a9c [Security] fixed exception message in EncoderFactory

Discussion
----------

[Security] fixed exception message in EncoderFactory

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: n/a
Todo: n/a
License of the code: MIT
Documentation PR: n/a

In ``EncoderFactory``, fixed the exception message so it uses the class of the provided user (string or object), rather than the class key for whatever happens to be the last loaded encoder.

---------------------------------------------------------------------------

by travisbot at 2012-06-20T11:19:21Z

This pull request [passes](http://travis-ci.org/symfony/symfony/builds/1663813) (merged d4b0a9ca into 092b5dde).
This commit is contained in:
Fabien Potencier 2012-06-20 21:14:01 +02:00
commit 3c0867b337

View File

@ -44,7 +44,7 @@ class EncoderFactory implements EncoderFactoryInterface
return $this->encoders[$class];
}
throw new \RuntimeException(sprintf('No encoder has been configured for account "%s".', is_object($class) ? get_class($user) : $class));
throw new \RuntimeException(sprintf('No encoder has been configured for account "%s".', is_object($user) ? get_class($user) : $user));
}
/**