diff --git a/Classes/PHPExcel/Calculation/Functions.php b/Classes/PHPExcel/Calculation/Functions.php index c9ac97b..df21ac4 100644 --- a/Classes/PHPExcel/Calculation/Functions.php +++ b/Classes/PHPExcel/Calculation/Functions.php @@ -316,7 +316,12 @@ class PHPExcel_Calculation_Functions { } else { preg_match('/([<>=]+)(.*)/',$condition,$matches); list(,$operator,$operand) = $matches; - if (!is_numeric($operand)) { $operand = PHPExcel_Calculation::_wrapResult(strtoupper($operand)); } + + if (!is_numeric($operand)) { + $operand = str_replace('"', '""', $operand); + $operand = PHPExcel_Calculation::_wrapResult(strtoupper($operand)); + } + return $operator.$operand; } } // function _ifCondition() diff --git a/unitTests/Classes/PHPExcel/Calculation/MathTrigTest.php b/unitTests/Classes/PHPExcel/Calculation/MathTrigTest.php index d6eaba0..e3d8c9d 100644 --- a/unitTests/Classes/PHPExcel/Calculation/MathTrigTest.php +++ b/unitTests/Classes/PHPExcel/Calculation/MathTrigTest.php @@ -521,7 +521,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase array('"text with quotes"'), array(2), ), - '=""text with quotes""', + '="text with quotes"', array( array(10), array(100), @@ -533,13 +533,25 @@ class MathTrigTest extends PHPUnit_Framework_TestCase array('"text with quotes"'), array(''), ), - '>""', // Compare to the single characater " (double quote) + '>"', // Compare to the single characater " (double quote) array( array(10), array(100), ), 10 ), + array( + array( + array(''), + array('anything'), + ), + '>"', // Compare to the single characater " (double quote) + array( + array(10), + array(100), + ), + 100 + ), ); }