fixing possible bug

git-svn-id: https://svn.php.net/repository/pear/packages/Spreadsheet_Excel_Writer/trunk@124985 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Xavier Noguer Gallego 2003-04-28 21:08:04 +00:00
parent 43f1993e60
commit 54f0757e09
1 changed files with 4 additions and 4 deletions

View File

@ -524,13 +524,13 @@ class Spreadsheet_Excel_Writer_Parser extends PEAR
*/ */
function _convert($token) function _convert($token)
{ {
if(is_numeric($token)) if (preg_match("/^\"[^\"]{0,255}\"$/", $token))
{ {
return($this->_convertNumber($token)); return $this->_convertString($token);
} }
elseif(preg_match("/^\"[^\"]{0,255}\"$/", $token)) elseif (is_numeric($token))
{ {
return($this->_convertString($token)); return $this->_convertNumber($token);
} }
// match references like A1 or $A$1 // match references like A1 or $A$1
elseif(preg_match('/^\$?([A-I]?[A-Z])\$?(\d+)$/',$token)) elseif(preg_match('/^\$?([A-I]?[A-Z])\$?(\d+)$/',$token))