mirror of
https://github.com/retailcrm/PHPExcel.git
synced 2024-11-26 07:16:03 +03:00
Additional regexp handling for UTF-8 strings
This commit is contained in:
parent
518fbc1d36
commit
538fbcd2e8
@ -2920,11 +2920,11 @@ class PHPExcel_Calculation {
|
|||||||
// echo 'Element with value '.$val.' is an Operand, Variable, Constant, String, Number, Cell Reference or Function<br />';
|
// echo 'Element with value '.$val.' is an Operand, Variable, Constant, String, Number, Cell Reference or Function<br />';
|
||||||
|
|
||||||
if (preg_match('/^'.self::CALCULATION_REGEXP_FUNCTION.'$/i', $val, $matches)) {
|
if (preg_match('/^'.self::CALCULATION_REGEXP_FUNCTION.'$/i', $val, $matches)) {
|
||||||
$val = preg_replace('/\s/','',$val);
|
$val = preg_replace('/\s/u','',$val);
|
||||||
// echo 'Element '.$val.' is a Function<br />';
|
// echo 'Element '.$val.' is a Function<br />';
|
||||||
if (isset(self::$_PHPExcelFunctions[strtoupper($matches[1])]) || isset(self::$_controlFunctions[strtoupper($matches[1])])) { // it's a function
|
if (isset(self::$_PHPExcelFunctions[strtoupper($matches[1])]) || isset(self::$_controlFunctions[strtoupper($matches[1])])) { // it's a function
|
||||||
$stack->push('Function', strtoupper($val));
|
$stack->push('Function', strtoupper($val));
|
||||||
$ax = preg_match('/^\s*(\s*\))/i', substr($formula, $index+$length), $amatch);
|
$ax = preg_match('/^\s*(\s*\))/ui', substr($formula, $index+$length), $amatch);
|
||||||
if ($ax) {
|
if ($ax) {
|
||||||
$stack->push('Operand Count for Function '.strtoupper($val).')', 0);
|
$stack->push('Operand Count for Function '.strtoupper($val).')', 0);
|
||||||
$expectingOperator = TRUE;
|
$expectingOperator = TRUE;
|
||||||
|
@ -723,7 +723,7 @@ class PHPExcel_Helper_HTML
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected function parseTextNode(DOMText $textNode) {
|
protected function parseTextNode(DOMText $textNode) {
|
||||||
$domText = preg_replace('/\s+/', ' ', ltrim($textNode->nodeValue));
|
$domText = preg_replace('/\s+/u', ' ', ltrim($textNode->nodeValue));
|
||||||
$this->stringData .= $domText;
|
$this->stringData .= $domText;
|
||||||
$this->buildTextRun();
|
$this->buildTextRun();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user