Skip to content

Commit

Permalink
Fixed null deprecation in Varien/Convert/Parser/Xml/Excel (#4375)
Browse files Browse the repository at this point in the history
  • Loading branch information
kiatng authored Nov 22, 2024
1 parent a156f8f commit 8033a6e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/Varien/Convert/Parser/Xml/Excel.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,19 @@ public function parse()
$dom->loadXML($this->getData());

$worksheets = $dom->getElementsByTagName('Worksheet');

/** @var DOMElement $worksheet */
foreach ($worksheets as $worksheet) {
$wsName = $worksheet->getAttribute('ss:Name');
$rows = $worksheet->getElementsByTagName('Row');
$firstRow = true;
$fieldNames = [];
$wsData = [];
/** @var DOMElement $row */
foreach ($rows as $row) {
$index = 1;
$cells = $row->getElementsByTagName('Cell');
$rowData = [];
/** @var DOMElement $cell */
foreach ($cells as $cell) {
$value = $cell->getElementsByTagName('Data')->item(0)->nodeValue;
$ind = $cell->getAttribute('ss:Index');
Expand Down Expand Up @@ -195,7 +197,7 @@ public function getRowXml(array $row)
$xmlData = [];
$xmlData[] = '<Row>';
foreach ($row as $value) {
$this->_xmlElement->row = htmlspecialchars($value);
$this->_xmlElement->row = htmlspecialchars((string) $value);
$value = str_replace($xmlHeader, '', $this->_xmlElement->asXML());
$value = preg_replace($xmlRegexp, '\\1', $value);
$dataType = 'String';
Expand Down

0 comments on commit 8033a6e

Please sign in to comment.