????

Your IP : 3.16.47.74


Current Path : /home/ntwf1swzbm0x/public_html/wp-includes/
Upload File :
Current File : /home/ntwf1swzbm0x/public_html/wp-includes/class-wp-http-encoding.php

<?php
/**
 * HTTP API: WP_Http_Encoding class
 *
 * @package WordPress
 * @subpackage HTTP
 * @since 4.4.0
 */

/**
 * Core class used to implement deflate and gzip transfer encoding support for HTTP requests.
 *
 * Includes RFC 1950, RFC 1951, and RFC 1952.
 *
 * @since 2.8.0
 */
class WP_Http_Encoding {

	/**
	 * Compress raw string using the deflate format.
	 *
	 * Supports the RFC 1951 standard.
	 *
	 * @since 2.8.0
	 *
	 * @param string $raw      String to compress.
	 * @param int    $level    Optional. Compression level, 9 is highest. Default 9.
	 * @param string $supports Optional, not used. When implemented it will choose
	 *                         the right compression based on what the server supports.
	 * @return string|false False on failure.
	 */
	public static function compress( $raw, $level = 9, $supports = null ) {
		return gzdeflate( $raw, $level );
	}

	/**
	 * Decompression of deflated string.
	 *
	 * Will attempt to decompress using the RFC 1950 standard, and if that fails
	 * then the RFC 1951 standard deflate will be attempted. Finally, the RFC
	 * 1952 standard gzip decode will be attempted. If all fail, then the
	 * original compressed string will be returned.
	 *
	 * @since 2.8.0
	 *
	 * @param string $compressed String to decompress.
	 * @param int    $length     The optional length of the compressed data.
	 * @return string|bool False on failure.
	 */
	public static function decompress( $compressed, $length = null ) {

		if ( empty( $compressed ) ) {
			return $compressed;
		}

		$decompressed = @gzinflate( $compressed );
		if ( false !== $decompressed ) {
			return $decompressed;
		}

		$decompressed = self::compatible_gzinflate( $compressed );
		if ( false !== $decompressed ) {
			return $decompressed;
		}

		$decompressed = @gzuncompress( $compressed );
		if ( false !== $decompressed ) {
			return $decompressed;
		}

		if ( function_exists( 'gzdecode' ) ) {
			$decompressed = @gzdecode( $compressed );

			if ( false !== $decompressed ) {
				return $decompressed;
			}
		}

		return $compressed;
	}

	/**
	 * Decompression of deflated string while staying compatible with the majority of servers.
	 *
	 * Certain Servers will return deflated data with headers which PHP's gzinflate()
	 * function cannot handle out of the box. The following function has been created from
	 * various snippets on the gzinflate() PHP documentation.
	 *
	 * Warning: Magic numbers within. Due to the potential different formats that the compressed
	 * data may be returned in, some "magic offsets" are needed to ensure proper decompression
	 * takes place. For a simple progmatic way to determine the magic offset in use, see:
	 * https://core.trac.wordpress.org/ticket/18273
	 *
	 * @since 2.8.1
	 *
	 * @link https://core.trac.wordpress.org/ticket/18273
	 * @link https://www.php.net/manual/en/function.gzinflate.php#70875
	 * @link https://www.php.net/manual/en/function.gzinflate.php#77336
	 *
	 * @param string $gzData String to decompress.
	 * @return string|bool False on failure.
	 */
	public static function compatible_gzinflate( $gzData ) {

		// Compressed data might contain a full header, if so strip it for gzinflate().
		if ( "\x1f\x8b\x08" === substr( $gzData, 0, 3 ) ) {
			$i   = 10;
			$flg = ord( substr( $gzData, 3, 1 ) );
			if ( $flg > 0 ) {
				if ( $flg & 4 ) {
					list($xlen) = unpack( 'v', substr( $gzData, $i, 2 ) );
					$i          = $i + 2 + $xlen;
				}
				if ( $flg & 8 ) {
					$i = strpos( $gzData, "\0", $i ) + 1;
				}
				if ( $flg & 16 ) {
					$i = strpos( $gzData, "\0", $i ) + 1;
				}
				if ( $flg & 2 ) {
					$i = $i + 2;
				}
			}
			$decompressed = @gzinflate( substr( $gzData, $i, -8 ) );
			if ( false !== $decompressed ) {
				return $decompressed;
			}
		}

		// Compressed data from java.util.zip.Deflater amongst others.
		$decompressed = @gzinflate( substr( $gzData, 2 ) );
		if ( false !== $decompressed ) {
			return $decompressed;
		}

		return false;
	}

	/**
	 * What encoding types to accept and their priority values.
	 *
	 * @since 2.8.0
	 *
	 * @param string $url
	 * @param array  $args
	 * @return string Types of encoding to accept.
	 */
	public static function accept_encoding( $url, $args ) {
		$type                = array();
		$compression_enabled = self::is_available();

		if ( ! $args['decompress'] ) { // Decompression specifically disabled.
			$compression_enabled = false;
		} elseif ( $args['stream'] ) { // Disable when streaming to file.
			$compression_enabled = false;
		} elseif ( isset( $args['limit_response_size'] ) ) { // If only partial content is being requested, we won't be able to decompress it.
			$compression_enabled = false;
		}

		if ( $compression_enabled ) {
			if ( function_exists( 'gzinflate' ) ) {
				$type[] = 'deflate;q=1.0';
			}

			if ( function_exists( 'gzuncompress' ) ) {
				$type[] = 'compress;q=0.5';
			}

			if ( function_exists( 'gzdecode' ) ) {
				$type[] = 'gzip;q=0.5';
			}
		}

		/**
		 * Filters the allowed encoding types.
		 *
		 * @since 3.6.0
		 *
		 * @param string[] $type Array of what encoding types to accept and their priority values.
		 * @param string   $url  URL of the HTTP request.
		 * @param array    $args HTTP request arguments.
		 */
		$type = apply_filters( 'wp_http_accept_encoding', $type, $url, $args );

		return implode( ', ', $type );
	}

	/**
	 * What encoding the content used when it was compressed to send in the headers.
	 *
	 * @since 2.8.0
	 *
	 * @return string Content-Encoding string to send in the header.
	 */
	public static function content_encoding() {
		return 'deflate';
	}

	/**
	 * Whether the content be decoded based on the headers.
	 *
	 * @since 2.8.0
	 *
	 * @param array|string $headers All of the available headers.
	 * @return bool
	 */
	public static function should_decode( $headers ) {
		if ( is_array( $headers ) ) {
			if ( array_key_exists( 'content-encoding', $headers ) && ! empty( $headers['content-encoding'] ) ) {
				return true;
			}
		} elseif ( is_string( $headers ) ) {
			return ( stripos( $headers, 'content-encoding:' ) !== false );
		}

		return false;
	}

	/**
	 * Whether decompression and compression are supported by the PHP version.
	 *
	 * Each function is tested instead of checking for the zlib extension, to
	 * ensure that the functions all exist in the PHP version and aren't
	 * disabled.
	 *
	 * @since 2.8.0
	 *
	 * @return bool
	 */
	public static function is_available() {
		return ( function_exists( 'gzuncompress' ) || function_exists( 'gzdeflate' ) || function_exists( 'gzinflate' ) );
	}
}

dynamic-content-widget-a6b2991-1 – The Foundry
Apply Now!

Booth Rental

From $ 99 / month
  • 05 x 10 - $99 Per Month
  • 09 x 10 - $149 Per Month
  • 10 X 10 - $159 Per Month
  • 10 X 11 - $169 Per Month
  • 10 X 15 - $224 Per Month
  • 10 X 20 - $270 Per Month
  • 10 X 25 - $325 Per Month

Cases also available

Visit us at The Foundry and speak with a member of our team to discuss the options available to you. If a space is available you can move in straight away! If there is not a space available right away, you can opt to be placed on our vendor waiting list or look at an alternative option such as one of our bespoke display cases. 

No problem! We encourage prospective vendors to move in and start selling as soon as possible. Pro rated booth rent for the remaining period until the first of the following month will be due at contract signing.

Yes. We have a standard form contract which outlines the terms of your rental agreement.

We charge a commission of 10% on all sales.

No! Here at The Foundry we believe that you should discover the best selling environment for you. We have a six month initial term. Following this, we require just a thirty day written notice if you wish to change or terminate your rental agreement. 

Rent is paid in advance starting on the first day of every month. For example: The rent due for August is due on August first.

For the convenience of all our vendors, we automatically process your rent payment from your previous month sales. If you do not have sufficient sales to cover the rent due we will notify you that payment is required. We recommend that all vendors take advantage of our vendor sales tracking system, QuailHQ for $5.00 per month.  

We work in partnership with QuailHQ to provide online access to sales data 24 hours a day, 7 days a week. QuailHQ is available online and as an app for ios and android.

We recommend that all vendors take advantage of our vendor sales tracking system, QuailHQ for $5.00 per month.  

Yes! We operate Social Media accounts on various platforms. In addition to our renowned service, we also regularly feature select merchandise to our social media platforms to increase awareness and bolster vendor sales. Make sure to include interesting an unique merchandise in your booth to be in with a chance to be featured on our social media!

We are open daily from 10:00 AM to 6:00 PM for you to move in and start selling! From all of us at The Foundry, we loom forward to working with you and can’t wait for you to get started!