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/ |
<?php
declare(strict_types=1);
namespace Plesk\Wappspector\Matchers;
use League\Flysystem\Filesystem;
use Plesk\Wappspector\Helper\InspectorHelper;
use Plesk\Wappspector\MatchResult\EmptyMatchResult;
use Plesk\Wappspector\MatchResult\MatchResultInterface;
use Plesk\Wappspector\MatchResult\Sitepro as MatchResult;
class Sitepro implements MatcherInterface
{
public function match(Filesystem $fs, string $path): MatchResultInterface
{
$rTrimPath = rtrim($path, '/');
$siteproFolderPath = $rTrimPath . '/sitepro';
if (!$fs->directoryExists($siteproFolderPath)) {
return new EmptyMatchResult();
}
$inspectorHelper = new InspectorHelper();
return $inspectorHelper->fileContainsString($fs, $rTrimPath . '/web.config', 'sitepro')
|| $inspectorHelper->fileContainsString($fs, $rTrimPath . '/.htaccess', 'sitepro')
? new MatchResult($path)
: new EmptyMatchResult();
}
}