force enabling the external XML entity loaders
This commit is contained in:
parent
b576fe1b85
commit
142b1a4b46
@ -333,7 +333,9 @@ $imports
|
|||||||
EOF
|
EOF
|
||||||
;
|
;
|
||||||
|
|
||||||
|
$disableEntities = libxml_disable_entity_loader(false);
|
||||||
$valid = @$dom->schemaValidateSource($source);
|
$valid = @$dom->schemaValidateSource($source);
|
||||||
|
libxml_disable_entity_loader($disableEntities);
|
||||||
|
|
||||||
foreach ($tmpfiles as $tmpfile) {
|
foreach ($tmpfiles as $tmpfile) {
|
||||||
@unlink($tmpfile);
|
@unlink($tmpfile);
|
||||||
|
@ -83,6 +83,19 @@ class XmlFileLoaderTest extends \PHPUnit_Framework_TestCase
|
|||||||
$this->assertInstanceOf('Symfony\\Component\\DependencyInjection\\SimpleXMLElement', $xml, '->parseFile() returns an SimpleXMLElement object');
|
$this->assertInstanceOf('Symfony\\Component\\DependencyInjection\\SimpleXMLElement', $xml, '->parseFile() returns an SimpleXMLElement object');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function testLoaderTurnsOnEntityLoaderIfNecessary()
|
||||||
|
{
|
||||||
|
$oldValue = libxml_disable_entity_loader(true);
|
||||||
|
|
||||||
|
$containerBuilder = new ContainerBuilder();
|
||||||
|
$loader = new XmlFileLoader($containerBuilder, new FileLocator(self::$fixturesPath.'/xml'));
|
||||||
|
$loader->load('services2.xml');
|
||||||
|
|
||||||
|
libxml_disable_entity_loader($oldValue);
|
||||||
|
|
||||||
|
$this->assertTrue(count($containerBuilder->getParameterBag()->all()) > 0, 'Parameters can be read from the config file.');
|
||||||
|
}
|
||||||
|
|
||||||
public function testLoadParameters()
|
public function testLoadParameters()
|
||||||
{
|
{
|
||||||
$container = new ContainerBuilder();
|
$container = new ContainerBuilder();
|
||||||
|
Reference in New Issue
Block a user