!C99Shell v. 2.5 [PHP 8 Update] [24.05.2025]!

Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 

uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 

uid=33(www-data) gid=33(www-data) groups=33(www-data) 

Safe-mode: OFF (not secure)

/var/www/html/main_file/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Ods/   drwxr-xr-x
Free 13.14 GB of 57.97 GB (22.67%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     FormulaTranslator.php (3.58 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php

namespace PhpOffice\PhpSpreadsheet\Reader\Ods;

use 
PhpOffice\PhpSpreadsheet\Calculation\Calculation;

class 
FormulaTranslator
{
    public static function 
convertToExcelAddressValue(string $openOfficeAddress): string
    
{
        
$excelAddress $openOfficeAddress;

        
// Cell range 3-d reference
        // As we don't support 3-d ranges, we're just going to take a quick and dirty approach
        //  and assume that the second worksheet reference is the same as the first
        
$excelAddress = (string) preg_replace(
            [
                
'/\$?([^\.]+)\.([^\.]+):\$?([^\.]+)\.([^\.]+)/miu',
                
'/\$?([^\.]+)\.([^\.]+):\.([^\.]+)/miu'// Cell range reference in another sheet
                
'/\$?([^\.]+)\.([^\.]+)/miu'// Cell reference in another sheet
                
'/\.([^\.]+):\.([^\.]+)/miu'// Cell range reference
                
'/\.([^\.]+)/miu'// Simple cell reference
            
],
            [
                
'$1!$2:$4',
                
'$1!$2:$3',
                
'$1!$2',
                
'$1:$2',
                
'$1',
            ],
            
$excelAddress
        
);

        return 
$excelAddress;
    }

    public static function 
convertToExcelFormulaValue(string $openOfficeFormula): string
    
{
        
$temp explode(Calculation::FORMULA_STRING_QUOTE$openOfficeFormula);
        
$tKey false;
        
$inMatrixBracesLevel 0;
        
$inFunctionBracesLevel 0;
        foreach (
$temp as &$value) {
            
// @var string $value
            // Only replace in alternate array entries (i.e. non-quoted blocks)
            //      so that conversion isn't done in string values
            
$tKey $tKey === false;
            if (
$tKey) {
                
$value = (string) preg_replace(
                    [
                        
'/\[\$?([^\.]+)\.([^\.]+):\.([^\.]+)\]/miu'// Cell range reference in another sheet
                        
'/\[\$?([^\.]+)\.([^\.]+)\]/miu'// Cell reference in another sheet
                        
'/\[\.([^\.]+):\.([^\.]+)\]/miu'// Cell range reference
                        
'/\[\.([^\.]+)\]/miu'// Simple cell reference
                    
],
                    [
                        
'$1!$2:$3',
                        
'$1!$2',
                        
'$1:$2',
                        
'$1',
                    ],
                    
$value
                
);
                
// Convert references to defined names/formulae
                
$value str_replace('$$'''$value);

                
// Convert ODS function argument separators to Excel function argument separators
                
$value Calculation::translateSeparator(';'','$value$inFunctionBracesLevel);

                
// Convert ODS matrix separators to Excel matrix separators
                
$value Calculation::translateSeparator(
                    
';',
                    
',',
                    
$value,
                    
$inMatrixBracesLevel,
                    
Calculation::FORMULA_OPEN_MATRIX_BRACE,
                    
Calculation::FORMULA_CLOSE_MATRIX_BRACE
                
);
                
$value Calculation::translateSeparator(
                    
'|',
                    
';',
                    
$value,
                    
$inMatrixBracesLevel,
                    
Calculation::FORMULA_OPEN_MATRIX_BRACE,
                    
Calculation::FORMULA_CLOSE_MATRIX_BRACE
                
);

                
$value = (string) preg_replace('/COM\.MICROSOFT\./ui'''$value);
            }
        }

        
// Then rebuild the formula string
        
$excelFormula implode('"'$temp);

        return 
$excelFormula;
    }
}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0222 ]--