Permalink
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...
2 parents d55698c + 9b021c6 commit 171797e818a83575e137bdde4e58e3da394ea522 @fabpot fabpot committed Jan 8, 2013
Showing with 2 additions and 1 deletion.
  1. +1 −0 Tests/TokenizerTest.php
  2. +1 −1 Tokenizer.php
View
@@ -34,6 +34,7 @@ public function testTokenizeWithQuotedStrings()
{
$this->assertEquals('foo[class=foo bar ]', $this->tokensToString($this->tokenizer->tokenize('foo[class="foo bar"]')), '->tokenize() lexes an input string and returns an array of tokens');
$this->assertEquals("foo[class=foo Abar ]", $this->tokensToString($this->tokenizer->tokenize('foo[class="foo \\65 bar"]')), '->tokenize() lexes an input string and returns an array of tokens');
+ $this->assertEquals("img[alt= ]", $this->tokensToString($this->tokenizer->tokenize('img[alt=""]')), '->tokenize() lexes an input string and returns an array of tokens');
}
/**
View
@@ -129,7 +129,7 @@ private function tokenizeEscapedString($s, $pos)
}
$result = substr($s, $start, $next - $start);
- if ('\\' === $result[strlen($result) - 1]) {
+ if (strlen($result) > 0 && '\\' === $result[strlen($result) - 1]) {
// next quote character is escaped
$pos = $next + 1;
continue;

0 comments on commit 171797e

Please sign in to comment.