Skip to content

Commit c770117

Browse files
author
Mark Baker
committed
Validation fix to mathematical matrix functions
1 parent 938ce8d commit c770117

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

Classes/PHPExcel/Calculation/MathTrig.php

+4
Original file line numberDiff line numberDiff line change
@@ -530,6 +530,7 @@ public static function MDETERM($matrixValues) {
530530

531531
$row = $maxColumn = 0;
532532
foreach($matrixValues as $matrixRow) {
533+
if (!is_array($matrixRow)) { $matrixRow = array($matrixRow); }
533534
$column = 0;
534535
foreach($matrixRow as $matrixCell) {
535536
if ((is_string($matrixCell)) || ($matrixCell === null)) {
@@ -571,6 +572,7 @@ public static function MINVERSE($matrixValues) {
571572

572573
$row = $maxColumn = 0;
573574
foreach($matrixValues as $matrixRow) {
575+
if (!is_array($matrixRow)) { $matrixRow = array($matrixRow); }
574576
$column = 0;
575577
foreach($matrixRow as $matrixCell) {
576578
if ((is_string($matrixCell)) || ($matrixCell === null)) {
@@ -607,6 +609,7 @@ public static function MMULT($matrixData1,$matrixData2) {
607609

608610
$rowA = 0;
609611
foreach($matrixData1 as $matrixRow) {
612+
if (!is_array($matrixRow)) { $matrixRow = array($matrixRow); }
610613
$columnA = 0;
611614
foreach($matrixRow as $matrixCell) {
612615
if ((is_string($matrixCell)) || ($matrixCell === null)) {
@@ -621,6 +624,7 @@ public static function MMULT($matrixData1,$matrixData2) {
621624
$matrixA = new PHPExcel_Shared_JAMA_Matrix($matrixAData);
622625
$rowB = 0;
623626
foreach($matrixData2 as $matrixRow) {
627+
if (!is_array($matrixRow)) { $matrixRow = array($matrixRow); }
624628
$columnB = 0;
625629
foreach($matrixRow as $matrixCell) {
626630
if ((is_string($matrixCell)) || ($matrixCell === null)) {
Binary file not shown.

0 commit comments

Comments
 (0)