diff --git a/src/Symfony/Bundle/DoctrineBundle/Command/EnsureProductionSettingsDoctrineCommand.php b/src/Symfony/Bundle/DoctrineBundle/Command/EnsureProductionSettingsDoctrineCommand.php index 1ff8cb08eeec..33163ddf4ca3 100644 --- a/src/Symfony/Bundle/DoctrineBundle/Command/EnsureProductionSettingsDoctrineCommand.php +++ b/src/Symfony/Bundle/DoctrineBundle/Command/EnsureProductionSettingsDoctrineCommand.php @@ -34,13 +34,13 @@ protected function configure() ->setName('doctrine:ensure-production-settings') ->addOption('em', null, InputOption::VALUE_OPTIONAL, 'The entity manager to use for this command.') ->setHelp(<<doctrine:cache:clear-metadata command clears all metadata cache for the default entity manager: +The doctrine:ensure-production-settings command ensures that Doctrine is properly configured for a production environment.: - ./app/console doctrine:cache:clear-metadata + ./app/console doctrine:ensure-production-settings -You can also optionally specify the --em option to specify which entity manager to clear the cache for: +You can also optionally specify the --em option to specify which entity manager to use: - ./app/console doctrine:cache:clear-metadata --em=default + ./app/console doctrine:ensure-production-settings --em=default EOT ); } diff --git a/src/Symfony/Bundle/TwigBundle/TokenParser/TransChoiceTokenParser.php b/src/Symfony/Bundle/TwigBundle/TokenParser/TransChoiceTokenParser.php index dce3d07034f6..c9f4fe6da83f 100644 --- a/src/Symfony/Bundle/TwigBundle/TokenParser/TransChoiceTokenParser.php +++ b/src/Symfony/Bundle/TwigBundle/TokenParser/TransChoiceTokenParser.php @@ -55,7 +55,7 @@ public function parse(\Twig_Token $token) $body = $this->parser->subparse(array($this, 'decideTransChoiceFork'), true); if (!$body instanceof \Twig_Node_Text && !$body instanceof \Twig_Node_Expression) { - throw new \Twig_Error_Syntax('A message must be a simple text', -1); + throw new \Twig_Error_Syntax(sprintf('A message must be a simple text (line %s)', $lineno), -1); } $stream->expect(\Twig_Token::BLOCK_END_TYPE); diff --git a/src/Symfony/Component/Validator/Constraints/EmailValidator.php b/src/Symfony/Component/Validator/Constraints/EmailValidator.php index 0933a39de91f..1532baaf648f 100644 --- a/src/Symfony/Component/Validator/Constraints/EmailValidator.php +++ b/src/Symfony/Component/Validator/Constraints/EmailValidator.php @@ -17,7 +17,6 @@ class EmailValidator extends ConstraintValidator { - const PATTERN = '/^([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})$/i'; public function isValid($value, Constraint $constraint) { @@ -31,7 +30,7 @@ public function isValid($value, Constraint $constraint) $value = (string)$value; - if (!preg_match(self::PATTERN, $value)) { + if (!filter_var($value, FILTER_VALIDATE_EMAIL)) { $this->setMessage($constraint->message, array('{{ value }}' => $value)); return false;