From d65f933cb2e84b274858545de0f61bbd32ffe534 Mon Sep 17 00:00:00 2001 From: Janis Date: Fri, 19 May 2023 16:43:51 +0300 Subject: [PATCH] wip --- src/PhpSpreadsheet/Calculation/Calculation.php | 4 ++-- src/PhpSpreadsheet/Calculation/Functions.php | 2 +- src/PhpSpreadsheet/Shared/StringHelper.php | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/PhpSpreadsheet/Calculation/Calculation.php b/src/PhpSpreadsheet/Calculation/Calculation.php index 08eb887f6d..45a987e87b 100644 --- a/src/PhpSpreadsheet/Calculation/Calculation.php +++ b/src/PhpSpreadsheet/Calculation/Calculation.php @@ -4908,7 +4908,7 @@ private function executeBinaryComparisonOperation($cellID, $operand1, $operand2, } elseif ($useLowercaseFirstComparison) { $result = $this->strcmpLowercaseFirst($operand1, $operand2) >= 0; } else { - $result = strcmp($operand1, $operand2) >= 0; + $result = strcmp("$operand1", "$operand2") >= 0; } break; @@ -4919,7 +4919,7 @@ private function executeBinaryComparisonOperation($cellID, $operand1, $operand2, } elseif ($useLowercaseFirstComparison) { $result = $this->strcmpLowercaseFirst($operand1, $operand2) <= 0; } else { - $result = strcmp($operand1, $operand2) <= 0; + $result = strcmp("$operand1", $operand2) <= 0; } break; diff --git a/src/PhpSpreadsheet/Calculation/Functions.php b/src/PhpSpreadsheet/Calculation/Functions.php index 2e8a7ecfcc..62fb6445ab 100644 --- a/src/PhpSpreadsheet/Calculation/Functions.php +++ b/src/PhpSpreadsheet/Calculation/Functions.php @@ -255,7 +255,7 @@ public static function ifCondition($condition) if (!is_string($condition) || !in_array($condition[0], ['>', '<', '='])) { if (!is_numeric($condition)) { - $condition = Calculation::wrapResult(strtoupper($condition)); + $condition = Calculation::wrapResult(strtoupper("$condition")); } return str_replace('""""', '""', '=' . $condition); diff --git a/src/PhpSpreadsheet/Shared/StringHelper.php b/src/PhpSpreadsheet/Shared/StringHelper.php index 9ae324132d..3ddcf46473 100644 --- a/src/PhpSpreadsheet/Shared/StringHelper.php +++ b/src/PhpSpreadsheet/Shared/StringHelper.php @@ -464,7 +464,7 @@ public static function convertEncoding($value, $to, $from) */ public static function countCharacters($value, $enc = 'UTF-8') { - return mb_strlen($value, $enc); + return mb_strlen("$value", $enc); } /**