php8.0 버전 호환 코드 적용 및 PHP 끝 태그 삭제 일괄적용
This commit is contained in:
@ -768,7 +768,7 @@ class PHPExcel_Calculation_Engineering
|
||||
// Split the input into its Real and Imaginary components
|
||||
$leadingSign = 0;
|
||||
if (strlen($workString) > 0) {
|
||||
$leadingSign = (($workString{0} == '+') || ($workString{0} == '-')) ? 1 : 0;
|
||||
$leadingSign = (($workString[0] == '+') || ($workString[0] == '-')) ? 1 : 0;
|
||||
}
|
||||
$power = '';
|
||||
$realNumber = strtok($workString, '+-');
|
||||
@ -809,16 +809,16 @@ class PHPExcel_Calculation_Engineering
|
||||
*/
|
||||
private static function cleanComplex($complexNumber)
|
||||
{
|
||||
if ($complexNumber{0} == '+') {
|
||||
if ($complexNumber[0] == '+') {
|
||||
$complexNumber = substr($complexNumber, 1);
|
||||
}
|
||||
if ($complexNumber{0} == '0') {
|
||||
if ($complexNumber[0] == '0') {
|
||||
$complexNumber = substr($complexNumber, 1);
|
||||
}
|
||||
if ($complexNumber{0} == '.') {
|
||||
if ($complexNumber[0] == '.') {
|
||||
$complexNumber = '0'.$complexNumber;
|
||||
}
|
||||
if ($complexNumber{0} == '+') {
|
||||
if ($complexNumber[0] == '+') {
|
||||
$complexNumber = substr($complexNumber, 1);
|
||||
}
|
||||
return $complexNumber;
|
||||
|
||||
@ -159,7 +159,7 @@ class PHPExcel_Calculation_FormulaParser
|
||||
|
||||
// Check if the formula has a valid starting =
|
||||
$formulaLength = strlen($this->formula);
|
||||
if ($formulaLength < 2 || $this->formula{0} != '=') {
|
||||
if ($formulaLength < 2 || $this->formula[0] != '=') {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@ -318,10 +318,10 @@ class PHPExcel_Calculation_Functions
|
||||
public static function ifCondition($condition)
|
||||
{
|
||||
$condition = PHPExcel_Calculation_Functions::flattenSingleValue($condition);
|
||||
if (!isset($condition{0})) {
|
||||
if (!isset($condition[0])) {
|
||||
$condition = '=""';
|
||||
}
|
||||
if (!in_array($condition{0}, array('>', '<', '='))) {
|
||||
if (!in_array($condition[0], array('>', '<', '='))) {
|
||||
if (!is_numeric($condition)) {
|
||||
$condition = PHPExcel_Calculation::wrapResult(strtoupper($condition));
|
||||
}
|
||||
@ -559,7 +559,7 @@ class PHPExcel_Calculation_Functions
|
||||
return (integer) $value;
|
||||
case 'string':
|
||||
// Errors
|
||||
if ((strlen($value) > 0) && ($value{0} == '#')) {
|
||||
if ((strlen($value) > 0) && ($value[0] == '#')) {
|
||||
return $value;
|
||||
}
|
||||
break;
|
||||
@ -609,7 +609,7 @@ class PHPExcel_Calculation_Functions
|
||||
return 64;
|
||||
} elseif (is_string($value)) {
|
||||
// Errors
|
||||
if ((strlen($value) > 0) && ($value{0} == '#')) {
|
||||
if ((strlen($value) > 0) && ($value[0] == '#')) {
|
||||
return 16;
|
||||
}
|
||||
return 2;
|
||||
|
||||
@ -40,19 +40,19 @@ class PHPExcel_Calculation_TextData
|
||||
|
||||
private static function unicodeToOrd($c)
|
||||
{
|
||||
if (ord($c{0}) >=0 && ord($c{0}) <= 127) {
|
||||
return ord($c{0});
|
||||
} elseif (ord($c{0}) >= 192 && ord($c{0}) <= 223) {
|
||||
return (ord($c{0})-192)*64 + (ord($c{1})-128);
|
||||
} elseif (ord($c{0}) >= 224 && ord($c{0}) <= 239) {
|
||||
return (ord($c{0})-224)*4096 + (ord($c{1})-128)*64 + (ord($c{2})-128);
|
||||
} elseif (ord($c{0}) >= 240 && ord($c{0}) <= 247) {
|
||||
return (ord($c{0})-240)*262144 + (ord($c{1})-128)*4096 + (ord($c{2})-128)*64 + (ord($c{3})-128);
|
||||
} elseif (ord($c{0}) >= 248 && ord($c{0}) <= 251) {
|
||||
return (ord($c{0})-248)*16777216 + (ord($c{1})-128)*262144 + (ord($c{2})-128)*4096 + (ord($c{3})-128)*64 + (ord($c{4})-128);
|
||||
} elseif (ord($c{0}) >= 252 && ord($c{0}) <= 253) {
|
||||
return (ord($c{0})-252)*1073741824 + (ord($c{1})-128)*16777216 + (ord($c{2})-128)*262144 + (ord($c{3})-128)*4096 + (ord($c{4})-128)*64 + (ord($c{5})-128);
|
||||
} elseif (ord($c{0}) >= 254 && ord($c{0}) <= 255) {
|
||||
if (ord($c[0]) >=0 && ord($c[0]) <= 127) {
|
||||
return ord($c[0]);
|
||||
} elseif (ord($c[0]) >= 192 && ord($c[0]) <= 223) {
|
||||
return (ord($c[0])-192)*64 + (ord($c[1])-128);
|
||||
} elseif (ord($c[0]) >= 224 && ord($c[0]) <= 239) {
|
||||
return (ord($c[0])-224)*4096 + (ord($c[1])-128)*64 + (ord($c[2])-128);
|
||||
} elseif (ord($c[0]) >= 240 && ord($c[0]) <= 247) {
|
||||
return (ord($c[0])-240)*262144 + (ord($c[1])-128)*4096 + (ord($c[2])-128)*64 + (ord($c[3])-128);
|
||||
} elseif (ord($c[0]) >= 248 && ord($c[0]) <= 251) {
|
||||
return (ord($c[0])-248)*16777216 + (ord($c[1])-128)*262144 + (ord($c[2])-128)*4096 + (ord($c[3])-128)*64 + (ord($c[4])-128);
|
||||
} elseif (ord($c[0]) >= 252 && ord($c[0]) <= 253) {
|
||||
return (ord($c[0])-252)*1073741824 + (ord($c[1])-128)*16777216 + (ord($c[2])-128)*262144 + (ord($c[3])-128)*4096 + (ord($c[4])-128)*64 + (ord($c[5])-128);
|
||||
} elseif (ord($c[0]) >= 254 && ord($c[0]) <= 255) {
|
||||
// error
|
||||
return PHPExcel_Calculation_Functions::VALUE();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user