!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)

/uploads/script/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/   drwxr-xr-x
Free 13.39 GB of 57.97 GB (23.1%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


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

namespace PhpOffice\PhpSpreadsheet\Cell;

use 
PhpOffice\PhpSpreadsheet\Calculation\Calculation;
use 
PhpOffice\PhpSpreadsheet\Calculation\Functions;
use 
PhpOffice\PhpSpreadsheet\Exception;

/**
 * Validate a cell value according to its validation rules.
 */
class DataValidator
{
    
/**
     * Does this cell contain valid value?
     *
     * @param Cell $cell Cell to check the value
     *
     * @return bool
     */
    
public function isValid(Cell $cell)
    {
        if (!
$cell->hasDataValidation()) {
            return 
true;
        }

        
$cellValue $cell->getValue();
        
$dataValidation $cell->getDataValidation();

        if (!
$dataValidation->getAllowBlank() && ($cellValue === null || $cellValue === '')) {
            return 
false;
        }

        
// TODO: write check on all cases
        
switch ($dataValidation->getType()) {
            case 
DataValidation::TYPE_LIST:
                return 
$this->isValueInList($cell);
        }

        return 
false;
    }

    
/**
     * Does this cell contain valid value, based on list?
     *
     * @param Cell $cell Cell to check the value
     *
     * @return bool
     */
    
private function isValueInList(Cell $cell)
    {
        
$cellValue $cell->getValue();
        
$dataValidation $cell->getDataValidation();

        
$formula1 $dataValidation->getFormula1();
        if (!empty(
$formula1)) {
            
// inline values list
            
if ($formula1[0] === '"') {
                return 
in_array(strtolower($cellValue), explode(','strtolower(trim($formula1'"'))), true);
            } elseif (
strpos($formula1':') > 0) {
                
// values list cells
                
$matchFormula '=MATCH(' $cell->getCoordinate() . ', ' $formula1 ', 0)';
                
$calculation Calculation::getInstance($cell->getWorksheet()->getParent());

                try {
                    
$result $calculation->calculateFormula($matchFormula$cell->getCoordinate(), $cell);

                    return 
$result !== Functions::NA();
                } catch (
Exception $ex) {
                    return 
false;
                }
            }
        }

        return 
true;
    }
}

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