Skip to content

Commit

Permalink
PHP 8.0 PHP 엑셀 삭제된 split() 함수 대체
Browse files Browse the repository at this point in the history
lib/Excel/php_writeexcel 는
영카트에서는 PHP 5.2 이하일 때만 쓰고 있으나
유저들이 씁니다.
  • Loading branch information
kitrio committed May 26, 2022
1 parent 767c3c5 commit 30c9a54
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lib/Excel/php_writeexcel/class.writeexcel_formula.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -663,10 +663,10 @@ function _convertRange2d($range)

// Split the range into 2 cell refs
if (preg_match('/^\$?([A-Ia-i]?[A-Za-z])\$?(\d+)\:\$?([A-Ia-i]?[A-Za-z])\$?(\d+)$/',$range)) {
list($cell1, $cell2) = split(':', $range);
list($cell1, $cell2) = explode(':', $range);
}
elseif (preg_match('/^\$?([A-Ia-i]?[A-Za-z])\$?(\d+)\.\.\$?([A-Ia-i]?[A-Za-z])\$?(\d+)$/',$range)) {
list($cell1, $cell2) = split('\.\.', $range);
list($cell1, $cell2) = preg_split('/\.\./', $range);
}
else {
// TODO: use real error codes
Expand Down Expand Up @@ -714,7 +714,7 @@ function _convertRange3d($token)
$class = 2; // as far as I know, this is magick.

// Split the ref at the ! symbol
list($ext_ref, $range) = split('!', $token);
list($ext_ref, $range) = explode('!', $token);

// Convert the external reference part
$ext_ref = $this->_packExtRef($ext_ref);
Expand All @@ -723,7 +723,7 @@ function _convertRange3d($token)
}

// Split the range into 2 cell refs
list($cell1, $cell2) = split(':', $range);
list($cell1, $cell2) = explode(':', $range);

// Convert the cell references
if (preg_match('/^(\$)?[A-Ia-i]?[A-Za-z](\$)?(\d+)$/', $cell1))
Expand Down Expand Up @@ -812,7 +812,7 @@ function _convertRef3d($cell)
$class = 2; // as far as I know, this is magick.

// Split the ref at the ! symbol
list($ext_ref, $cell) = split('!', $cell);
list($ext_ref, $cell) = explode('!', $cell);

// Convert the external reference part
$ext_ref = $this->_packExtRef($ext_ref);
Expand Down Expand Up @@ -853,7 +853,7 @@ function _packExtRef($ext_ref) {
// Check if there is a sheet range eg., Sheet1:Sheet2.
if (preg_match("/:/", $ext_ref))
{
list($sheet_name1, $sheet_name2) = split(':', $ext_ref);
list($sheet_name1, $sheet_name2) = explode(':', $ext_ref);

$sheet1 = $this->_getSheetIndex($sheet_name1);
if ($sheet1 == -1) {
Expand Down

0 comments on commit 30c9a54

Please sign in to comment.