WS_OK_7.4.33 HEX
HEX
Server: nginx/1.21.4
System: Linux v12674 6.8.0-85-generic #85-Ubuntu SMP PREEMPT_DYNAMIC Thu Sep 18 15:26:59 UTC 2025 x86_64
User: endtheignorance (1014)
PHP: 7.4.33
Disabled: exec,passthru,shell_exec,system,proc_open,popen,parse_ini_file,show_source
Upload Files
File: /storage/v12674/lcalosangeles/public_html/wp-content/plugins/autoupdater/lib/Helper/Version.php
<?php
defined('AUTOUPDATER_LIB') or die;



class AutoUpdater_Helper_Version
{
    public static function format($version, $length = 3, $parts_length = 3)
    {
        // Match only sets of digits separated by a full stop
        $regex = '/^([0-9]+(?:\.[0-9]+)*)([^.]+.*)?$/i';
        $version_match = array();
        preg_match($regex, $version, $version_match);
        if (!$version_match || empty($version_match[1])) {
            return $version;
        }

        $parts = explode('.', $version_match[1]);
        $parts = array_map(function ($item) use ($length) {
            return str_pad($item, $length, '0', STR_PAD_LEFT);
        }, $parts);

        while (count($parts) < $parts_length) {
            array_push($parts, str_pad('', $length, '0'));
        }

        return implode('.', $parts) . (empty($version_match[2]) ? '' : $version_match[2]);
    }

    public static function filterHTML($string)
    {
        return utf8_encode(trim(wp_strip_all_tags(html_entity_decode($string, ENT_QUOTES, 'UTF-8'))));
    }

    public static function fix($version)
    {
        $version = strtolower(self::filterHTML($version));
        $version = substr($version, 0, 20);

        if ($version[0] === 'v') {
            $version = substr($version, 1, 20);
        }

        if (!preg_match('/\d/', $version)) {
            $version = '0.0.0';
        }

        return $version;
    }

    public static function fixAndFormat($version)
    {
        return self::format(self::fix($version));
    }
}