Quellcode durchsuchen

load xml as string from local file, fixes #3942

If the entity loader is disabled on a system, loading files, even from
the local file system, is considered as external to the running php
process, and thus not allowed by the libxml extension. Reading the file
contents and loading the xml as a string is a valid alternative however.
Rob Bast vor 9 Jahren
Ursprung
Commit
b957d1c4a6
1 geänderte Dateien mit 1 neuen und 1 gelöschten Zeilen
  1. 1 1
      src/Composer/Downloader/PearPackageExtractor.php

+ 1 - 1
src/Composer/Downloader/PearPackageExtractor.php

@@ -137,7 +137,7 @@ class PearPackageExtractor
     private function buildCopyActions($source, array $roles, $vars)
     {
         /** @var $package \SimpleXmlElement */
-        $package = simplexml_load_file($this->combine($source, 'package.xml'));
+        $package = simplexml_load_string(file_get_contents($this->combine($source, 'package.xml')));
         if (false === $package) {
             throw new \RuntimeException('Package definition file is not valid.');
         }