Merge branch '2.3' into 2.7

* 2.3:
  [Translation] Fix the string casting in the XliffFileLoader

Conflicts:
	src/Symfony/Component/Translation/Loader/XliffFileLoader.php
This commit is contained in:
Nicolas Grekas 2015-08-26 12:49:32 +02:00
commit 7f4f7131dd
2 changed files with 2 additions and 1 deletions

View File

@ -55,7 +55,7 @@ class XliffFileLoader implements LoaderInterface
$source = isset($attributes['resname']) && $attributes['resname'] ? $attributes['resname'] : $translation->source;
// If the xlf file has another encoding specified, try to convert it because
// simple_xml will always return utf-8 encoded values
$target = $this->utf8ToCharset((string) isset($translation->target) ? $translation->target : $source, $encoding);
$target = $this->utf8ToCharset((string) (isset($translation->target) ? $translation->target : $source), $encoding);
$catalogue->set((string) $source, $target, $domain);

View File

@ -25,6 +25,7 @@ class XliffFileLoaderTest extends \PHPUnit_Framework_TestCase
$this->assertEquals('en', $catalogue->getLocale());
$this->assertEquals(array(new FileResource($resource)), $catalogue->getResources());
$this->assertSame(array(), libxml_get_errors());
$this->assertContainsOnly('string', $catalogue->all('domain1'));
}
public function testLoadWithInternalErrorsEnabled()