Skip to content

Commit 1640fa1

Browse files
authored
Merge pull request macellan#3 from mortenscheel/patch-1
Fix typo and array access
2 parents 5a117c5 + 83c4909 commit 1640fa1

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Classes/PHPExcel/Calculation.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3212,7 +3212,7 @@ private function _parseFormula($formula, PHPExcel_Cell $pCell = null)
32123212
}
32133213
}
32143214
$d = $stack->last(2);
3215-
if (preg_match('/^'.self::CALCULATION_REGEXP_FUNCTION.'$/i', $d['value'], $matches)) { // Did this parenthesis just close a function?
3215+
if (is_array($d) && preg_match('/^'.self::CALCULATION_REGEXP_FUNCTION.'$/i', $d['value'], $matches)) { // Did this parenthesis just close a function?
32163216
$functionName = $matches[1]; // Get the function name
32173217
//echo 'Closed Function is '.$functionName, PHP_EOL;
32183218
$d = $stack->pop();

Classes/PHPExcel/Writer/Excel2007/Worksheet.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -768,7 +768,7 @@ private function writeAutoFilter(PHPExcel_Shared_XMLWriter $objWriter = null, PH
768768
$objWriter->writeAttribute('ref', str_replace('$', '', $range));
769769

770770
$columns = $pSheet->getAutoFilter()->getColumns();
771-
if (count($columns > 0)) {
771+
if (count($columns) > 0) {
772772
foreach ($columns as $columnID => $column) {
773773
$rules = $column->getRules();
774774
if (count($rules) > 0) {
@@ -1114,7 +1114,7 @@ private function writeCell(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel
11141114
break;
11151115
case 'f': // Formula
11161116
$attributes = $pCell->getFormulaAttributes();
1117-
if ($attributes['t'] == 'array') {
1117+
if (is_array($attributes) && $attributes['t'] == 'array') {
11181118
$objWriter->startElement('f');
11191119
$objWriter->writeAttribute('t', 'array');
11201120
$objWriter->writeAttribute('ref', $pCellAddress);

0 commit comments

Comments
 (0)