/home/techb158/public_html/wp-content/plugins/kirki/app
Edit: /home/techb158/public_html/wp-content/plugins/kirki/app/helpers.php (4363B)
0;
}
}
if (!function_exists('Kirki\App\get_editor_mode')) {
/**
* Get editor mode value
*
* @return string
*/
function get_editor_mode()
{
return 'kirki';
}
}
if (!function_exists('Kirki\App\soft_flush_rewrite_rules')) {
/**
* Soft flush rewrite rules
*
* @return void
*/
function soft_flush_rewrite_rules()
{
flush_rewrite_rules(false);
}
}
if (!function_exists('Kirki\App\get_request_header')) {
/**
* Get request header by header name with sanitization
*
* @param string $header_name
*
* @return string|null
*/
function get_request_header(string $header_name)
{
if (function_exists('getallheaders')) {
$headers = getallheaders();
return Sanitizer::apply_rule($headers[$header_name] ?? null, Sanitizer::TEXT);
}
// Fallback because `getallheaders()` is not guaranteed to exist in every PHP environment
$normalized_name = strtolower(trim($header_name));
$content_headers = ['content-type', 'content-length', 'content-md5'];
$header_key = in_array($normalized_name, $content_headers, true)
? str_replace('-', '_', strtoupper($normalized_name))
: 'HTTP_' . str_replace('-', '_', strtoupper($normalized_name));
$value = filter_input(INPUT_SERVER, $header_key, FILTER_UNSAFE_RAW);
if (is_null($value) || $value === '' || $value === false) {
return null;
}
return Sanitizer::apply_rule($value, Sanitizer::TEXT);
}
}
if (!function_exists('Kirki\App\ensure_array')) {
/**
* Ensure that the value is an array.
*
* @param mixed $value
*
* @return array
*/
function ensure_array($value)
{
if (is_array($value)) {
return $value;
}
if (is_string($value)) {
$decoded = json_decode($value, true);
return is_array($decoded) ? $decoded : $value;
}
return $value;
}
}