Browse Source

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 9 năm trước cách đây
mục cha
commit
b957d1c4a6
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  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.');
         }