Merge branch 'php81-jw'

This commit is contained in:
kjh
2022-05-31 07:38:17 +00:00
82 changed files with 452 additions and 502 deletions

View File

@ -181,8 +181,8 @@ class PHPExcel_Calculation_FormulaParser
// embeds are doubled
// end marks token
if ($inString) {
if ($this->formula{$index} == PHPExcel_Calculation_FormulaParser::QUOTE_DOUBLE) {
if ((($index + 2) <= $formulaLength) && ($this->formula{$index + 1} == PHPExcel_Calculation_FormulaParser::QUOTE_DOUBLE)) {
if ($this->formula[$index] == PHPExcel_Calculation_FormulaParser::QUOTE_DOUBLE) {
if ((($index + 2) <= $formulaLength) && ($this->formula[$index + 1] == PHPExcel_Calculation_FormulaParser::QUOTE_DOUBLE)) {
$value .= PHPExcel_Calculation_FormulaParser::QUOTE_DOUBLE;
++$index;
} else {
@ -191,7 +191,7 @@ class PHPExcel_Calculation_FormulaParser
$value = "";
}
} else {
$value .= $this->formula{$index};
$value .= $this->formula[$index];
}
++$index;
continue;
@ -201,15 +201,15 @@ class PHPExcel_Calculation_FormulaParser
// embeds are double
// end does not mark a token
if ($inPath) {
if ($this->formula{$index} == PHPExcel_Calculation_FormulaParser::QUOTE_SINGLE) {
if ((($index + 2) <= $formulaLength) && ($this->formula{$index + 1} == PHPExcel_Calculation_FormulaParser::QUOTE_SINGLE)) {
if ($this->formula[$index] == PHPExcel_Calculation_FormulaParser::QUOTE_SINGLE) {
if ((($index + 2) <= $formulaLength) && ($this->formula[$index + 1] == PHPExcel_Calculation_FormulaParser::QUOTE_SINGLE)) {
$value .= PHPExcel_Calculation_FormulaParser::QUOTE_SINGLE;
++$index;
} else {
$inPath = false;
}
} else {
$value .= $this->formula{$index};
$value .= $this->formula[$index];
}
++$index;
continue;
@ -219,10 +219,10 @@ class PHPExcel_Calculation_FormulaParser
// no embeds (changed to "()" by Excel)
// end does not mark a token
if ($inRange) {
if ($this->formula{$index} == PHPExcel_Calculation_FormulaParser::BRACKET_CLOSE) {
if ($this->formula[$index] == PHPExcel_Calculation_FormulaParser::BRACKET_CLOSE) {
$inRange = false;
}
$value .= $this->formula{$index};
$value .= $this->formula[$index];
++$index;
continue;
}
@ -230,7 +230,7 @@ class PHPExcel_Calculation_FormulaParser
// error values
// end marks a token, determined from absolute list of values
if ($inError) {
$value .= $this->formula{$index};
$value .= $this->formula[$index];
++$index;
if (in_array($value, $ERRORS)) {
$inError = false;
@ -241,10 +241,10 @@ class PHPExcel_Calculation_FormulaParser
}
// scientific notation check
if (strpos(PHPExcel_Calculation_FormulaParser::OPERATORS_SN, $this->formula{$index}) !== false) {
if (strpos(PHPExcel_Calculation_FormulaParser::OPERATORS_SN, $this->formula[$index]) !== false) {
if (strlen($value) > 1) {
if (preg_match("/^[1-9]{1}(\.[0-9]+)?E{1}$/", $this->formula{$index}) != 0) {
$value .= $this->formula{$index};
if (preg_match("/^[1-9]{1}(\.[0-9]+)?E{1}$/", $this->formula[$index]) != 0) {
$value .= $this->formula[$index];
++$index;
continue;
}
@ -254,7 +254,7 @@ class PHPExcel_Calculation_FormulaParser
// independent character evaluation (order not important)
// establish state-dependent character evaluations
if ($this->formula{$index} == PHPExcel_Calculation_FormulaParser::QUOTE_DOUBLE) {
if ($this->formula[$index] == PHPExcel_Calculation_FormulaParser::QUOTE_DOUBLE) {
if (strlen($value > 0)) {
// unexpected
$tokens1[] = new PHPExcel_Calculation_FormulaToken($value, PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_UNKNOWN);
@ -265,7 +265,7 @@ class PHPExcel_Calculation_FormulaParser
continue;
}
if ($this->formula{$index} == PHPExcel_Calculation_FormulaParser::QUOTE_SINGLE) {
if ($this->formula[$index] == PHPExcel_Calculation_FormulaParser::QUOTE_SINGLE) {
if (strlen($value) > 0) {
// unexpected
$tokens1[] = new PHPExcel_Calculation_FormulaToken($value, PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_UNKNOWN);
@ -276,14 +276,14 @@ class PHPExcel_Calculation_FormulaParser
continue;
}
if ($this->formula{$index} == PHPExcel_Calculation_FormulaParser::BRACKET_OPEN) {
if ($this->formula[$index] == PHPExcel_Calculation_FormulaParser::BRACKET_OPEN) {
$inRange = true;
$value .= PHPExcel_Calculation_FormulaParser::BRACKET_OPEN;
++$index;
continue;
}
if ($this->formula{$index} == PHPExcel_Calculation_FormulaParser::ERROR_START) {
if ($this->formula[$index] == PHPExcel_Calculation_FormulaParser::ERROR_START) {
if (strlen($value) > 0) {
// unexpected
$tokens1[] = new PHPExcel_Calculation_FormulaToken($value, PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_UNKNOWN);
@ -296,7 +296,7 @@ class PHPExcel_Calculation_FormulaParser
}
// mark start and end of arrays and array rows
if ($this->formula{$index} == PHPExcel_Calculation_FormulaParser::BRACE_OPEN) {
if ($this->formula[$index] == PHPExcel_Calculation_FormulaParser::BRACE_OPEN) {
if (strlen($value) > 0) {
// unexpected
$tokens1[] = new PHPExcel_Calculation_FormulaToken($value, PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_UNKNOWN);
@ -315,7 +315,7 @@ class PHPExcel_Calculation_FormulaParser
continue;
}
if ($this->formula{$index} == PHPExcel_Calculation_FormulaParser::SEMICOLON) {
if ($this->formula[$index] == PHPExcel_Calculation_FormulaParser::SEMICOLON) {
if (strlen($value) > 0) {
$tokens1[] = new PHPExcel_Calculation_FormulaToken($value, PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERAND);
$value = "";
@ -337,7 +337,7 @@ class PHPExcel_Calculation_FormulaParser
continue;
}
if ($this->formula{$index} == PHPExcel_Calculation_FormulaParser::BRACE_CLOSE) {
if ($this->formula[$index] == PHPExcel_Calculation_FormulaParser::BRACE_CLOSE) {
if (strlen($value) > 0) {
$tokens1[] = new PHPExcel_Calculation_FormulaToken($value, PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERAND);
$value = "";
@ -358,14 +358,14 @@ class PHPExcel_Calculation_FormulaParser
}
// trim white-space
if ($this->formula{$index} == PHPExcel_Calculation_FormulaParser::WHITESPACE) {
if ($this->formula[$index] == PHPExcel_Calculation_FormulaParser::WHITESPACE) {
if (strlen($value) > 0) {
$tokens1[] = new PHPExcel_Calculation_FormulaToken($value, PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERAND);
$value = "";
}
$tokens1[] = new PHPExcel_Calculation_FormulaToken("", PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_WHITESPACE);
++$index;
while (($this->formula{$index} == PHPExcel_Calculation_FormulaParser::WHITESPACE) && ($index < $formulaLength)) {
while (($this->formula[$index] == PHPExcel_Calculation_FormulaParser::WHITESPACE) && ($index < $formulaLength)) {
++$index;
}
continue;
@ -385,29 +385,29 @@ class PHPExcel_Calculation_FormulaParser
}
// standard infix operators
if (strpos(PHPExcel_Calculation_FormulaParser::OPERATORS_INFIX, $this->formula{$index}) !== false) {
if (strpos(PHPExcel_Calculation_FormulaParser::OPERATORS_INFIX, $this->formula[$index]) !== false) {
if (strlen($value) > 0) {
$tokens1[] =new PHPExcel_Calculation_FormulaToken($value, PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERAND);
$value = "";
}
$tokens1[] = new PHPExcel_Calculation_FormulaToken($this->formula{$index}, PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERATORINFIX);
$tokens1[] = new PHPExcel_Calculation_FormulaToken($this->formula[$index], PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERATORINFIX);
++$index;
continue;
}
// standard postfix operators (only one)
if (strpos(PHPExcel_Calculation_FormulaParser::OPERATORS_POSTFIX, $this->formula{$index}) !== false) {
if (strpos(PHPExcel_Calculation_FormulaParser::OPERATORS_POSTFIX, $this->formula[$index]) !== false) {
if (strlen($value) > 0) {
$tokens1[] = new PHPExcel_Calculation_FormulaToken($value, PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERAND);
$value = "";
}
$tokens1[] = new PHPExcel_Calculation_FormulaToken($this->formula{$index}, PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERATORPOSTFIX);
$tokens1[] = new PHPExcel_Calculation_FormulaToken($this->formula[$index], PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERATORPOSTFIX);
++$index;
continue;
}
// start subexpression or function
if ($this->formula{$index} == PHPExcel_Calculation_FormulaParser::PAREN_OPEN) {
if ($this->formula[$index] == PHPExcel_Calculation_FormulaParser::PAREN_OPEN) {
if (strlen($value) > 0) {
$tmp = new PHPExcel_Calculation_FormulaToken($value, PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_FUNCTION, PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_START);
$tokens1[] = $tmp;
@ -423,7 +423,7 @@ class PHPExcel_Calculation_FormulaParser
}
// function, subexpression, or array parameters, or operand unions
if ($this->formula{$index} == PHPExcel_Calculation_FormulaParser::COMMA) {
if ($this->formula[$index] == PHPExcel_Calculation_FormulaParser::COMMA) {
if (strlen($value) > 0) {
$tokens1[] = new PHPExcel_Calculation_FormulaToken($value, PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERAND);
$value = "";
@ -444,7 +444,7 @@ class PHPExcel_Calculation_FormulaParser
}
// stop subexpression
if ($this->formula{$index} == PHPExcel_Calculation_FormulaParser::PAREN_CLOSE) {
if ($this->formula[$index] == PHPExcel_Calculation_FormulaParser::PAREN_CLOSE) {
if (strlen($value) > 0) {
$tokens1[] = new PHPExcel_Calculation_FormulaToken($value, PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERAND);
$value = "";
@ -460,7 +460,7 @@ class PHPExcel_Calculation_FormulaParser
}
// token accumulation
$value .= $this->formula{$index};
$value .= $this->formula[$index];
++$index;
}

View File

@ -346,7 +346,7 @@ class PHPExcel_Calculation_Statistical
$y = $x;
if ($y > 0.0 && $y <= LOG_GAMMA_X_MAX_VALUE) {
if ($y <= EPS) {
$res = -log(y);
$res = -log($y);
} elseif ($y <= 1.5) {
// ---------------------
// EPS .LT. X .LE. 1.5
@ -677,7 +677,7 @@ class PHPExcel_Calculation_Statistical
$q = $p - 0.5;
// computation for p close to 0.5
if (abs($q) <= split1) {
if (abs($q) <= $split1) {
$R = $const1 - $q * $q;
$z = $q * ((((((($a7 * $R + $a6) * $R + $a5) * $R + $a4) * $R + $a3) * $R + $a2) * $R + $a1) * $R + $a0) /
((((((($b7 * $R + $b6) * $R + $b5) * $R + $b4) * $R + $b3) * $R + $b2) * $R + $b1) * $R + 1);

View File

@ -280,16 +280,16 @@ class PHPExcel_Reader_Excel5_Escher
$foDelay = PHPExcel_Reader_Excel5::getInt4d($recordData, 28);
// offset: 32; size: 1; unused1
$unused1 = ord($recordData{32});
$unused1 = ord($recordData[32]);
// offset: 33; size: 1; size of nameData in bytes (including null terminator)
$cbName = ord($recordData{33});
$cbName = ord($recordData[33]);
// offset: 34; size: 1; unused2
$unused2 = ord($recordData{34});
$unused2 = ord($recordData[34]);
// offset: 35; size: 1; unused3
$unused3 = ord($recordData{35});
$unused3 = ord($recordData[35]);
// offset: 36; size: $cbName; nameData
$nameData = substr($recordData, 36, $cbName);
@ -331,7 +331,7 @@ class PHPExcel_Reader_Excel5_Escher
}
// offset: var; size: 1; tag
$tag = ord($recordData{$pos});
$tag = ord($recordData[$pos]);
$pos += 1;
// offset: var; size: var; the raw image data
@ -372,7 +372,7 @@ class PHPExcel_Reader_Excel5_Escher
}
// offset: var; size: 1; tag
$tag = ord($recordData{$pos});
$tag = ord($recordData[$pos]);
$pos += 1;
// offset: var; size: var; the raw image data

View File

@ -535,7 +535,7 @@ class PHPExcel_Reader_OOCalc extends PHPExcel_Reader_Abstract implements PHPExce
array_push($dataArray, $pData);
}
}
$allCellDataText = implode($dataArray, "\n");
$allCellDataText = implode("\n", $dataArray);
// echo 'Value Type is '.$cellDataOfficeAttributes['value-type'].'<br />';
switch ($cellDataOfficeAttributes['value-type']) {