? GR0V Shell

GR0V shell

Linux server122.web-hosting.com 4.18.0-513.18.1.lve.el8.x86_64 #1 SMP Thu Feb 22 12:55:50 UTC 2024 x86_64

Path : /usr/local/lsws/add-ons/webcachemgr/src/ThirdParty/Polyfill/
File Upload :
Current File : //usr/local/lsws/add-ons/webcachemgr/src/ThirdParty/Polyfill/Utf8.php

<?php

/**
 * This file contains paired-down/modified code originally found in Symfony
 * package file Php72.php, used here as a PHP standard replacement for now
 * deprecated PHP functions utf8_encode() and utf8_decode().
 *
 * Modified by: Michael Alegre (LiteSpeed Technologies, Inc.), 2023
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Lsc\Wp\ThirdParty\Polyfill;

/**
 * @since 1.16.1
 */
class Utf8
{
    /**
     *
     * @since 1.16.1
     *
     * @param $s
     *
     * @return false|string
     */
    public static function encode($s)
    {
        $s .= $s;
        $len = strlen($s);

        for ($i = $len >> 1, $j = 0; $i < $len; ++$i, ++$j) {

            if ( $s[$i] < "\x80" ) {
                $s[$j] = $s[$i];
            }
            elseif ( $s[$i] < "\xC0" ) {
                $s[$j] = "\xC2";
                $s[++$j] = $s[$i];
            }
            else {
                $s[$j] = "\xC3";
                $s[++$j] = chr(ord($s[$i]) - 64);
            }
        }

        return substr($s, 0, $j);
    }

    /**
     *
     * @since 1.16.1
     *
     * @param $s
     *
     * @return false|string
     */
    public static function decode($s)
    {
        $s = (string) $s;
        $len = strlen($s);

        for ($i = 0, $j = 0; $i < $len; ++$i, ++$j) {

            switch ($s[$i] & "\xF0") {
                case "\xC0":
                case "\xD0":
                    $c = (ord($s[$i] & "\x1F") << 6) | ord($s[++$i] & "\x3F");
                    $s[$j] = $c < 256 ? chr($c) : '?';
                    break;

                case "\xF0":
                    ++$i;
                // fallthrough

                case "\xE0":
                    $s[$j] = '?';
                    $i += 2;
                    break;

                default:
                    $s[$j] = $s[$i];
            }
        }

        return substr($s, 0, $j);
    }

}

T1KUS90T
  root-grov@198.54.114.191:~$