瀏覽代碼

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 年之前
父節點
當前提交
b957d1c4a6
共有 1 個文件被更改,包括 1 次插入1 次删除
  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.');
         }