[BUGFIX] Load XML files of Extension Manager properly 89/47589/2
authorAndreas Fernandez <a.fernandez@scripting-base.de>
Fri, 11 Mar 2016 14:56:57 +0000 (15:56 +0100)
committerOliver Hader <oliver.hader@typo3.org>
Tue, 12 Apr 2016 08:46:17 +0000 (10:46 +0200)
Since the XEE security fix (I26701fc2ffb5aed7ccbd96c168aef571d012091e),
the XML files in the Extension Manager may are not loaded anymore, depending
on the machine. Change the way how the files are loaded to fix the issue.

Change-Id: I2a3dffd089ed427b965bcbae8aa596c26a81770b
Resolves: #75022
Releases: master, 7.6, 6.2
Reviewed-on: https://review.typo3.org/47589
Reviewed-by: Oliver Hader <oliver.hader@typo3.org>
Tested-by: Oliver Hader <oliver.hader@typo3.org>
typo3/sysext/extensionmanager/Classes/Utility/Parser/ExtensionXmlPullParser.php
typo3/sysext/extensionmanager/Classes/Utility/Parser/MirrorXmlPullParser.php

index 860335b..d3df943 100644 (file)
@@ -57,8 +57,8 @@ class ExtensionXmlPullParser extends AbstractExtensionXmlParser
         if (!(is_object($this->objXml) && get_class($this->objXml) == 'XMLReader')) {
             throw new \TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException('Unable to create XML parser.', 1342640540);
         }
-        if ($this->objXml->open($file, 'utf-8') === false) {
-            throw new \TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException(sprintf('Unable to open file resource %s.', $file));
+        if ($this->objXml->xml(file_get_contents($file), 'utf-8') === false) {
+            throw new \TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException(sprintf('Unable to parse file resource %s.', $file));
         }
         while ($this->objXml->read()) {
             if ($this->objXml->nodeType == \XMLReader::ELEMENT) {
index fed1a3c..2e5abea 100644 (file)
@@ -56,8 +56,8 @@ class MirrorXmlPullParser extends AbstractMirrorXmlParser
         if (!(is_object($this->objXml) && get_class($this->objXml) == 'XMLReader')) {
             throw new \TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException('Unable to create XML parser.', 1342640820);
         }
-        if ($this->objXml->open($file, 'utf-8') === false) {
-            throw new \TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException(sprintf('Unable to open file resource %s.', $file), 1342640893);
+        if ($this->objXml->xml(file_get_contents($file), 'utf-8') === false) {
+            throw new \TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException(sprintf('Unable to parse file resource %s.', $file), 1342640893);
         }
         while ($this->objXml->read()) {
             if ($this->objXml->nodeType == \XMLReader::ELEMENT) {