| Server IP : 31.214.179.12 / Your IP : 216.73.216.141 Web Server : Apache System : Linux hostingsrv123.dondominio.com 6.12.118+deb13-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.12.118-1 (2026-11-20) x86_64 User : ( 801593) PHP Version : 8.5.13 Disable Function : system,passthru,popen,proc_close,proc_get_status,proc_nice,proc_open,proc_terminate,shell_exec,exec,ini_alter,show_source,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,mail,eval MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /hosting/www/tarifatuna.com/public/wp-content/plugins/jetpack-boost-git/app/lib/minify/ |
Upload File : |
<?php
namespace Automattic\Jetpack_Boost\Lib\Minify;
class Utils {
/**
* Indicates whether to use the WordPress functions.
*
* @var bool $use_wp Whether to use WordPress functions.
*/
private $use_wp;
/**
* Utils constructor.
*
* @param bool $use_wp Whether to use WordPress functions. Default is true.
*/
public function __construct( $use_wp = true ) {
$this->use_wp = $use_wp;
}
/**
* Encodes a value to JSON.
*
* @param mixed $value The value to encode.
*
* @return string The JSON-encoded string.
*/
public function json_encode( $value ) {
if ( $this->use_wp ) {
return wp_json_encode( $value );
}
// phpcs:ignore WordPress.WP.AlternativeFunctions.json_encode_json_encode
return json_encode( $value );
}
/**
* Removes slashes from a string or an array of strings.
*
* @param mixed $value The string or array of strings to remove slashes from.
*
* @return mixed The string or array of strings with slashes removed.
*/
public function unslash( $value ) {
if ( $this->use_wp ) {
return wp_unslash( $value );
}
return is_string( $value ) ? stripslashes( $value ) : $value;
}
/**
* Parses a URL and returns its components.
*
* @param string $url The URL to parse.
* @param int $component Optional. The specific component to retrieve.
* Use one of the PHP_URL_* constants. Default is -1 (all components).
*
* @return mixed|array|string|null The parsed URL component(s), or the entire URL string if $component is -1.
*/
public function parse_url( $url, $component = -1 ) {
if ( $this->use_wp ) {
return wp_parse_url( $url, $component );
}
// phpcs:ignore WordPress.WP.AlternativeFunctions.parse_url_parse_url
return parse_url( $url, $component );
}
}