Commit 54d0332b authored by Alexander Opitz's avatar Alexander Opitz Committed by Jigal van Hemert
Browse files

[BUGFIX] Read TER XML entity value complete

Improve reading the TER XML file while using the php xml extension.
The character data handler could be called multiple times, so we
shouldn't cut previous data away.

Resolves: #83227
Releases: master, 8.7, 7.6
Change-Id: I9e96ade88da6a4709d1f72cd49fe766758d265fe
Reviewed-on: https://review.typo3.org/54936

Reviewed-by: default avatarStefan Neufeind <typo3.neufeind@speedpartner.de>
Tested-by: default avatarStefan Neufeind <typo3.neufeind@speedpartner.de>
Tested-by: default avatarTYPO3com <no-reply@typo3.com>
Reviewed-by: Jigal van Hemert's avatarJigal van Hemert <jigal.van.hemert@typo3.org>
Tested-by: Jigal van Hemert's avatarJigal van Hemert <jigal.van.hemert@typo3.org>
parent 0b82e698
......@@ -27,11 +27,11 @@ namespace TYPO3\CMS\Extensionmanager\Utility\Parser;
class ExtensionXmlPushParser extends AbstractExtensionXmlParser
{
/**
* Keeps current element to process.
* Keeps current data of element to process.
*
* @var string
*/
protected $element = null;
protected $elementData = '';
/**
* Class constructor.
......@@ -99,7 +99,7 @@ class ExtensionXmlPushParser extends AbstractExtensionXmlParser
$this->version = $attrs['version'];
break;
default:
$this->element = $elementName;
$this->elementData = '';
}
}
......@@ -119,8 +119,54 @@ class ExtensionXmlPushParser extends AbstractExtensionXmlParser
$this->notify();
$this->resetProperties();
break;
default:
$this->element = null;
case 'downloadcounter':
// downloadcounter could be a child node of
// extension or version
if ($this->version == null) {
$this->extensionDownloadCounter = $this->elementData;
} else {
$this->versionDownloadCounter = $this->elementData;
}
break;
case 'title':
$this->title = $this->elementData;
break;
case 'description':
$this->description = $this->elementData;
break;
case 'state':
$this->state = $this->elementData;
break;
case 'reviewstate':
$this->reviewstate = $this->elementData;
break;
case 'category':
$this->category = $this->elementData;
break;
case 'lastuploaddate':
$this->lastuploaddate = $this->elementData;
break;
case 'uploadcomment':
$this->uploadcomment = $this->elementData;
break;
case 'dependencies':
$this->dependencies = $this->convertDependencies($this->elementData);
break;
case 'authorname':
$this->authorname = $this->elementData;
break;
case 'authoremail':
$this->authoremail = $this->elementData;
break;
case 'authorcompany':
$this->authorcompany = $this->elementData;
break;
case 'ownerusername':
$this->ownerusername = $this->elementData;
break;
case 't3xfilemd5':
$this->t3xfilemd5 = $this->elementData;
break;
}
}
......@@ -132,57 +178,6 @@ class ExtensionXmlPushParser extends AbstractExtensionXmlParser
*/
protected function characterData($parser, $data)
{
if (isset($this->element)) {
switch ($this->element) {
case 'downloadcounter':
// downloadcounter could be a child node of
// extension or version
if ($this->version == null) {
$this->extensionDownloadCounter = $data;
} else {
$this->versionDownloadCounter = $data;
}
break;
case 'title':
$this->title = $data;
break;
case 'description':
$this->description .= $data;
break;
case 'state':
$this->state = $data;
break;
case 'reviewstate':
$this->reviewstate = $data;
break;
case 'category':
$this->category = $data;
break;
case 'lastuploaddate':
$this->lastuploaddate = $data;
break;
case 'uploadcomment':
$this->uploadcomment .= $data;
break;
case 'dependencies':
$this->dependencies = $this->convertDependencies($data);
break;
case 'authorname':
$this->authorname = $data;
break;
case 'authoremail':
$this->authoremail = $data;
break;
case 'authorcompany':
$this->authorcompany = $data;
break;
case 'ownerusername':
$this->ownerusername = $data;
break;
case 't3xfilemd5':
$this->t3xfilemd5 = $data;
break;
}
}
$this->elementData .= $data;
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment