Skip to content

Commit 4b9645f

Browse files
Merge branch '3.0' into 3.1
* 3.0: (25 commits) Fix merge [HttpFoundation] Use UPSERT for sessions stored in PgSql >= 9.5 [Console] fixed PHPDoc [travis] HHVM 3.12 LTS Fix feature detection for IE [Form] Fixed collapsed choice attributes [Console] added explanation of messages usage in a progress bar force enabling the external XML entity loaders [Yaml] properly count skipped comment lines [WebProfilerBundle] Fix invalid CSS style Added progressive jpeg to mime types guesser [Yaml] Fix wrong line number when comments are inserted in the middle of a block. Fixed singular of committee Do not inject web debug toolbar on attachments bumped Symfony version to 3.0.8 updated VERSION for 3.0.7 updated CHANGELOG for 3.0.7 bumped Symfony version to 2.8.8 updated VERSION for 2.8.7 updated CHANGELOG for 2.8.7 ... Conflicts: src/Symfony/Component/HttpKernel/Kernel.php src/Symfony/Component/PropertyAccess/StringUtil.php src/Symfony/Component/PropertyAccess/Tests/StringUtilTest.php src/Symfony/Component/Yaml/Parser.php src/Symfony/Component/Yaml/Tests/ParserTest.php
2 parents 4ed3bcc + 7dd8e60 commit 4b9645f

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

Loader/XmlFileLoader.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,9 @@ public function validateSchema(\DOMDocument $dom)
484484
EOF
485485
;
486486

487+
$disableEntities = libxml_disable_entity_loader(false);
487488
$valid = @$dom->schemaValidateSource($source);
489+
libxml_disable_entity_loader($disableEntities);
488490

489491
foreach ($tmpfiles as $tmpfile) {
490492
@unlink($tmpfile);

Tests/Loader/XmlFileLoaderTest.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,19 @@ public function testParseFile()
8484
$this->assertInstanceOf('DOMDocument', $xml, '->parseFileToDOM() returns an SimpleXMLElement object');
8585
}
8686

87+
public function testLoadWithExternalEntitiesDisabled()
88+
{
89+
$disableEntities = libxml_disable_entity_loader(true);
90+
91+
$containerBuilder = new ContainerBuilder();
92+
$loader = new XmlFileLoader($containerBuilder, new FileLocator(self::$fixturesPath.'/xml'));
93+
$loader->load('services2.xml');
94+
95+
libxml_disable_entity_loader($disableEntities);
96+
97+
$this->assertTrue(count($containerBuilder->getParameterBag()->all()) > 0, 'Parameters can be read from the config file.');
98+
}
99+
87100
public function testLoadParameters()
88101
{
89102
$container = new ContainerBuilder();

0 commit comments

Comments
 (0)