U k U `U 0U U U U l U PU E U U pU U - U @U U U %_ `U U Db U 0U Ng U U v `U U | U 0U | U U n1 PU U ~ U U U pU @U U | U U bxY U `U Ƞ| 0U U U U E U PU W U U 5 pU U i U @U | U U PU U Ꝉ U U ի U pU H @U U w| U U U `U l 0U U ֿ U 8 '@ WU =榞U fU lU @U lU @U \U YU `cU hmU olU U t u U @fU \U > U qlU xlU ;"@ WU ]U > U PwlU xlU ! #@ WU NU ^U > U zlU xlU ! #@ WU pPU lU > U pflU xlU @ ! 0#@ WU `QU ^U > U ylU xlU ! #@ WU RU `U ? U |lU xlU ` ! й#@ WU SU `U ? U pglU xlU ! #@ WU TU aU ? U pilU xlU ! x#@ WU VU cU ? U lU xlU #@ WU VU PcU !? U lU xlU ` rU @>U @ NXU dU 0eU eU peU 0gU 0 ^U 0| Phar A U P s 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' ) ); } }