Improved processDimensionStartingNode regular expression

This commit is contained in:
Lito 2017-01-04 12:33:17 +01:00
parent d82ab994d2
commit a8e3e5449c

View File

@ -220,7 +220,7 @@ class RowIterator implements IteratorInterface
{
// Read dimensions of the sheet
$dimensionRef = $xmlReader->getAttribute(self::XML_ATTRIBUTE_REF); // returns 'A1:M13' for instance (or 'A1' for empty sheet)
if (preg_match('/[A-Z]+\d+:([A-Z]+\d+)/', $dimensionRef, $matches)) {
if (preg_match('/^[A-Z]+\d+:([A-Z]+\d+)$/', $dimensionRef, $matches)) {
$this->numColumns = CellHelper::getColumnIndexFromCellIndex($matches[1]) + 1;
}