Fix for deprecated eregi function calls
git-svn-id: https://svn.php.net/repository/pear/packages/Spreadsheet_Excel_Writer/trunk@290685 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
366794efd7
commit
0691506313
|
|
@ -1213,7 +1213,7 @@ class Spreadsheet_Excel_Writer_Parser extends PEAR
|
||||||
default:
|
default:
|
||||||
// if it's a reference
|
// if it's a reference
|
||||||
if (preg_match('/^\$?[A-Ia-i]?[A-Za-z]\$?[0-9]+$/',$token) and
|
if (preg_match('/^\$?[A-Ia-i]?[A-Za-z]\$?[0-9]+$/',$token) and
|
||||||
!ereg("[0-9]",$this->_lookahead) and
|
!preg_match("/[0-9]/",$this->_lookahead) and
|
||||||
($this->_lookahead != ':') and ($this->_lookahead != '.') and
|
($this->_lookahead != ':') and ($this->_lookahead != '.') and
|
||||||
($this->_lookahead != '!'))
|
($this->_lookahead != '!'))
|
||||||
{
|
{
|
||||||
|
|
@ -1221,39 +1221,39 @@ class Spreadsheet_Excel_Writer_Parser extends PEAR
|
||||||
}
|
}
|
||||||
// If it's an external reference (Sheet1!A1 or Sheet1:Sheet2!A1)
|
// If it's an external reference (Sheet1!A1 or Sheet1:Sheet2!A1)
|
||||||
elseif (preg_match("/^\w+(\:\w+)?\![A-Ia-i]?[A-Za-z][0-9]+$/u",$token) and
|
elseif (preg_match("/^\w+(\:\w+)?\![A-Ia-i]?[A-Za-z][0-9]+$/u",$token) and
|
||||||
!ereg("[0-9]",$this->_lookahead) and
|
!preg_match("/[0-9]/",$this->_lookahead) and
|
||||||
($this->_lookahead != ':') and ($this->_lookahead != '.'))
|
($this->_lookahead != ':') and ($this->_lookahead != '.'))
|
||||||
{
|
{
|
||||||
return $token;
|
return $token;
|
||||||
}
|
}
|
||||||
// If it's an external reference ('Sheet1'!A1 or 'Sheet1:Sheet2'!A1)
|
// If it's an external reference ('Sheet1'!A1 or 'Sheet1:Sheet2'!A1)
|
||||||
elseif (preg_match("/^'[\w -]+(\:[\w -]+)?'\![A-Ia-i]?[A-Za-z][0-9]+$/u",$token) and
|
elseif (preg_match("/^'[\w -]+(\:[\w -]+)?'\![A-Ia-i]?[A-Za-z][0-9]+$/u",$token) and
|
||||||
!ereg("[0-9]",$this->_lookahead) and
|
!preg_match("/[0-9]/",$this->_lookahead) and
|
||||||
($this->_lookahead != ':') and ($this->_lookahead != '.'))
|
($this->_lookahead != ':') and ($this->_lookahead != '.'))
|
||||||
{
|
{
|
||||||
return $token;
|
return $token;
|
||||||
}
|
}
|
||||||
// if it's a range (A1:A2)
|
// if it's a range (A1:A2)
|
||||||
elseif (preg_match("/^(\$)?[A-Ia-i]?[A-Za-z](\$)?[0-9]+:(\$)?[A-Ia-i]?[A-Za-z](\$)?[0-9]+$/",$token) and
|
elseif (preg_match("/^(\$)?[A-Ia-i]?[A-Za-z](\$)?[0-9]+:(\$)?[A-Ia-i]?[A-Za-z](\$)?[0-9]+$/",$token) and
|
||||||
!ereg("[0-9]",$this->_lookahead))
|
!preg_match("/[0-9]/",$this->_lookahead))
|
||||||
{
|
{
|
||||||
return $token;
|
return $token;
|
||||||
}
|
}
|
||||||
// if it's a range (A1..A2)
|
// if it's a range (A1..A2)
|
||||||
elseif (preg_match("/^(\$)?[A-Ia-i]?[A-Za-z](\$)?[0-9]+\.\.(\$)?[A-Ia-i]?[A-Za-z](\$)?[0-9]+$/",$token) and
|
elseif (preg_match("/^(\$)?[A-Ia-i]?[A-Za-z](\$)?[0-9]+\.\.(\$)?[A-Ia-i]?[A-Za-z](\$)?[0-9]+$/",$token) and
|
||||||
!ereg("[0-9]",$this->_lookahead))
|
!preg_match("/[0-9]/",$this->_lookahead))
|
||||||
{
|
{
|
||||||
return $token;
|
return $token;
|
||||||
}
|
}
|
||||||
// If it's an external range like Sheet1!A1 or Sheet1:Sheet2!A1:B2
|
// If it's an external range like Sheet1!A1 or Sheet1:Sheet2!A1:B2
|
||||||
elseif (preg_match("/^\w+(\:\w+)?\!([A-Ia-i]?[A-Za-z])?[0-9]+:([A-Ia-i]?[A-Za-z])?[0-9]+$/u",$token) and
|
elseif (preg_match("/^\w+(\:\w+)?\!([A-Ia-i]?[A-Za-z])?[0-9]+:([A-Ia-i]?[A-Za-z])?[0-9]+$/u",$token) and
|
||||||
!ereg("[0-9]",$this->_lookahead))
|
!preg_match("/[0-9]/",$this->_lookahead))
|
||||||
{
|
{
|
||||||
return $token;
|
return $token;
|
||||||
}
|
}
|
||||||
// If it's an external range like 'Sheet1'!A1 or 'Sheet1:Sheet2'!A1:B2
|
// If it's an external range like 'Sheet1'!A1 or 'Sheet1:Sheet2'!A1:B2
|
||||||
elseif (preg_match("/^'[\w -]+(\:[\w -]+)?'\!([A-Ia-i]?[A-Za-z])?[0-9]+:([A-Ia-i]?[A-Za-z])?[0-9]+$/u",$token) and
|
elseif (preg_match("/^'[\w -]+(\:[\w -]+)?'\!([A-Ia-i]?[A-Za-z])?[0-9]+:([A-Ia-i]?[A-Za-z])?[0-9]+$/u",$token) and
|
||||||
!ereg("[0-9]",$this->_lookahead))
|
!preg_match("/[0-9]/",$this->_lookahead))
|
||||||
{
|
{
|
||||||
return $token;
|
return $token;
|
||||||
}
|
}
|
||||||
|
|
@ -1265,12 +1265,12 @@ class Spreadsheet_Excel_Writer_Parser extends PEAR
|
||||||
return $token;
|
return $token;
|
||||||
}
|
}
|
||||||
// If it's a string (of maximum 255 characters)
|
// If it's a string (of maximum 255 characters)
|
||||||
elseif (ereg("^\"[^\"]{0,255}\"$",$token))
|
elseif (preg_match("/^\"[^\"]{0,255}\"$/",$token))
|
||||||
{
|
{
|
||||||
return $token;
|
return $token;
|
||||||
}
|
}
|
||||||
// if it's a function call
|
// if it's a function call
|
||||||
elseif (eregi("^[A-Z0-9\xc0-\xdc\.]+$",$token) and ($this->_lookahead == "("))
|
elseif (preg_match("/^[A-Z0-9\xc0-\xdc\.]+$/i",$token) and ($this->_lookahead == "("))
|
||||||
{
|
{
|
||||||
return $token;
|
return $token;
|
||||||
}
|
}
|
||||||
|
|
@ -1377,7 +1377,7 @@ class Spreadsheet_Excel_Writer_Parser extends PEAR
|
||||||
function _expression()
|
function _expression()
|
||||||
{
|
{
|
||||||
// If it's a string return a string node
|
// If it's a string return a string node
|
||||||
if (ereg("^\"[^\"]{0,255}\"$", $this->_current_token)) {
|
if (preg_match("/^\"[^\"]{0,255}\"$/", $this->_current_token)) {
|
||||||
$result = $this->_createTree($this->_current_token, '', '');
|
$result = $this->_createTree($this->_current_token, '', '');
|
||||||
$this->_advance();
|
$this->_advance();
|
||||||
return $result;
|
return $result;
|
||||||
|
|
@ -1535,7 +1535,7 @@ class Spreadsheet_Excel_Writer_Parser extends PEAR
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
// if it's a function call
|
// if it's a function call
|
||||||
elseif (eregi("^[A-Z0-9\xc0-\xdc\.]+$",$this->_current_token))
|
elseif (preg_match("/^[A-Z0-9\xc0-\xdc\.]+$/i",$this->_current_token))
|
||||||
{
|
{
|
||||||
$result = $this->_func();
|
$result = $this->_func();
|
||||||
return $result;
|
return $result;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue