SILENT KILLERPanel

Current Path: > home > codekrsu > > ameliagraphics.com > wp-content > plugins > extendify > app > Shared > > Services


Operation   : Linux premium131.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64
Software     : Apache
Server IP    : 162.0.232.56 | Your IP: 216.73.216.111
Domains      : 1034 Domain(s)
Permission   : [ 0755 ]

Files and Folders in: /home/codekrsu//ameliagraphics.com/wp-content/plugins/extendify/app/Shared//Services

NameTypeSizeLast ModifiedActions
ApexDomain Directory - -
Import Directory - -
PluginDependencies Directory - -
Escaper.php File 753 bytes May 22 2025 22:26:12.
HttpClient.php File 4846 bytes July 16 2025 19:39:24.
Sanitizer.php File 3343 bytes May 22 2025 22:26:12.
VersionMigrator.php File 5120 bytes May 22 2025 22:26:12.

Reading File: /home/codekrsu//ameliagraphics.com/wp-content/plugins/extendify/app/Shared//Services/Sanitizer.php

<?php

/**
 * The Sanitizer class
 */

namespace Extendify\Shared\Services;

defined('ABSPATH') || die('No direct access.');

/**
 * Class for sanitizing various data types.
 */

class Sanitizer
{
    /**
     * This function will sanitize a value.
     *
     * @param mixed $data - The data we need to sanitize.
     * @return array|string
     */
    public static function sanitizeUnknown($data)
    {
        return is_array($data) ? self::sanitizeArray($data) : self::sanitizeText($data);
    }
    /**
     * This function will sanitize a multidimensional array,
     * if the value is number it will be returned as is.
     *
     * @param array $array - The array we need to sanitize.
     * @return array
     */
    public static function sanitizeArray($array)
    {
        return array_map(function ($value) {
            if (is_array($value)) {
                return self::sanitizeArray($value);
            } elseif (is_int($value) || is_float($value)) {
                return $value;
            } else {
                return \sanitize_text_field($value);
            }
        }, $array);
    }

    /**
     * This function will sanitize the user selections.
     *
     * @param array $array - The array we need to sanitize.
     * @return array
     */
    public static function sanitizeUserSelections($array)
    {
        return array_map(function ($value) {
            if (is_array($value)) {
                return self::sanitizeUserSelections($value);
            }

            if (is_int($value) || is_float($value)) {
                return $value;
            }

            return self::sanitizePostContent($value);
        }, $array);
    }

    /**
     * This function will sanitize a text field.
     *
     * @param string $text - The string we need to sanitize.
     * @return string
     */
    public static function sanitizeText($text)
    {
        return \sanitize_text_field($text);
    }

    /**
     * This function will sanitize a text field that may contain
     * the <strong>, <em> and <del> HTML tags, allowing the tags in
     * the final result.
     *
     * @param string $text - The string we need to sanitize.
     * @return string
     */
    public static function sanitizeTextWithFormattingTags($text)
    {
        $allowedTags = [
            'strong'  => [],
            'em'      => [],
            'del'     => [],
        ];

        return \wp_kses($text, $allowedTags);
    }

    /**
     * This function will sanitize a textarea field.
     *
     * @param string $text - The strings we need to sanitize.
     * @return string
     */
    public static function sanitizeTextarea($text)
    {
        return \sanitize_textarea_field($text);
    }

    /**
     * This function will sanitize a gutenberg block.
     *
     * @param string $blockString - The strings we need to sanitize.
     * @return string
     */
    public static function sanitizeBlocks($blockString)
    {
        $parsed = parse_blocks($blockString);
        return \serialize_blocks($parsed);
    }

    /**
     * This function will sanitize the post content.
     *
     * @param string $content - The post content we need to sanitize.
     * @return string
     */
    public static function sanitizePostContent($content)
    {
        return \wp_kses_post($content ? $content : '');
    }
}

SILENT KILLER Tool