Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch '2.1'

* 2.1:
  [Console] Fix style escaping parsing
  [Console] Make style formatter matching less greedy to avoid having to escape when not needed
  [Bundle] [FrameworkBundle] fixed indentation in esi.xml services file.
  [Component] [Security] fixed PSR-2 coding violation in ClassUtilsTest class.
  [Form] Fixed EntityChoiceList when loading objects with negative integer IDs
  [TwigBundle] There is no CSS visibility of display, should be visible instead
  [Form] corrected source node for a Danish translation
  [DependencyInjection] fixed a bug where the strict flag on references were lost (closes #6607)
  [HttpFoundation] Check if required shell functions for `FileBinaryMimeTypeGuesser` are not disabled
  [CssSelector] added css selector with empty string
  [HttpFoundation] Docblock for Request::isXmlHttpRequest() now points to Wikipedia
  [DependencyInjection] refactored code to avoid logic duplication
  [Form] Deleted references in FormBuilder::getFormConfig() to improve performance
  [HttpFoundation] Update docblock for non-working method

Conflicts:
	src/Symfony/Bundle/TwigBundle/Resources/views/Exception/trace.html.twig
	src/Symfony/Bundle/TwigBundle/Resources/views/Exception/traces.html.twig
  • Loading branch information...
commit d51d04067cced0d3f49b35ff36c77be9b8ebdb68 2 parents a843508 + 37e23a8
@fabpot fabpot authored
View
2  Formatter/OutputFormatter.php
@@ -23,7 +23,7 @@ class OutputFormatter implements OutputFormatterInterface
/**
* The pattern to phrase the format.
*/
- const FORMAT_PATTERN = '#(\\\\?)<(/?)([a-z][a-z0-9_=;-]+)?>((?:(?!\\\\?<).)*)#is';
+ const FORMAT_PATTERN = '#(\\\\?)<(/?)([a-z][a-z0-9_=;-]+)?>((?: [^<\\\\]+ | (?!<(?:/?[a-z]|/>)). | .(?<=\\\\<) )*)#isx';
private $decorated;
private $styles = array();
View
20 Tests/Formatter/OutputFormatterTest.php
@@ -73,6 +73,26 @@ public function testNestedStyles()
);
}
+ public function testStyleMatchingNotGreedy()
+ {
+ $formatter = new OutputFormatter(true);
+
+ $this->assertEquals(
+ "(\033[32m>=2.0,<2.3\033[0m)",
+ $formatter->format('(<info>>=2.0,<2.3</info>)')
+ );
+ }
+
+ public function testStyleEscaping()
+ {
+ $formatter = new OutputFormatter(true);
+
+ $this->assertEquals(
+ "(\033[32mz>=2.0,<a2.3\033[0m)",
+ $formatter->format('(<info>'.$formatter->escape('z>=2.0,<a2.3').'</info>)')
+ );
+ }
+
public function testDeepNestedStyles()
{
$formatter = new OutputFormatter(true);
Please sign in to comment.
Something went wrong with that request. Please try again.