[BUGFIX] Load XML files of Extension Manager properly 96/47196/6
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:45:58 +0000 (10:45 +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/47196
Reviewed-by: Daniel Maier <dani-maier@gmx.de>
Reviewed-by: Mathias Schreiber <mathias.schreiber@wmdb.de>
Tested-by: Mathias Schreiber <mathias.schreiber@wmdb.de>
Tested-by: Stephan GroƟberndt <stephan@grossberndt.de>
Reviewed-by: Susanne Moog <typo3@susannemoog.de>
Reviewed-by: Oliver Hader <oliver.hader@typo3.org>
Tested-by: Oliver Hader <oliver.hader@typo3.org>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/extensionmanager/Classes/Utility/Parser/ExtensionXmlPullParser.php
typo3/sysext/extensionmanager/Classes/Utility/Parser/MirrorXmlPullParser.php

index a28fa37..5672180 100644 (file)
@@ -53,8 +53,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 e49f9d7..5f5b5aa 100644 (file)
@@ -55,8 +55,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) {