Sh3ll
OdayForums


Server : Apache
System : Linux 145.162.205.92.host.secureserver.net 5.14.0-611.45.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Apr 1 05:56:53 EDT 2026 x86_64
User : tradze ( 1001)
PHP Version : 8.1.34
Disable Function : NONE
Directory :  /opt/cpanel/ea-wappspector/src/Matchers/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //opt/cpanel/ea-wappspector/src/Matchers/Php.php
<?php

namespace Plesk\Wappspector\Matchers;

use League\Flysystem\Filesystem;
use League\Flysystem\FilesystemException;
use League\Flysystem\StorageAttributes;
use Plesk\Wappspector\MatchResult\EmptyMatchResult;
use Plesk\Wappspector\MatchResult\MatchResultInterface;
use Plesk\Wappspector\MatchResult\Php as MatchResult;

class Php implements MatcherInterface
{
    public function match(Filesystem $fs, string $path): MatchResultInterface
    {
        try {
            $list = $fs->listContents($path);
            foreach ($list as $item) {
                /** @var StorageAttributes $item */
                if ($item->isFile() && str_ends_with($item->path(), '.php')) {
                    return new MatchResult($path);
                }

                if ($item->isDir() && $item->path() === ltrim(rtrim($path, '/') . '/src', '/')) {
                    return $this->match($fs, rtrim($path, '/') . '/src');
                }
            }
        } catch (FilesystemException) {
            // skip dir if it is inaccessible
        }

        return new EmptyMatchResult();
    }
}

ZeroDay Forums Mini