ڷCwU P@̈CwU`CwUP CwUP`"$ˢCwU`,CwUP`"$ˢCwU`@,CwUP`"$ˢCwU`,CwUP``C"$ˢCwU`C,CwUP0`R"$ˢCwU``R,CwUP`^"$ˢCwU`@^,CwUP`z"$ˢCwU``z,CwUP`"$ˢCwU`,CwUPp`"$ˢCwU`,CwUP@`"$ˢCwU`,CwUP`"$ˢCwU``,CwUP`"$ˢCwU`,CwU*-CwU`=ĢCwUp<1CwU`pCwU`*̈CwUp  -CwU*=-CwU0*=CwUP*ACwUp`*uĢCwU*<ТCwUP*uĢCwU*<1CwU*}CwU,+-CwU .=CwUP.AĢCwU.<*CwU.+-CwU0 /=CwUP/ACwU`/uĢCwU/<1CwU /`CwU`2MaʢCwU@2N̈CwU 3-CwU(4=tCwU 04RCwU P4ACwU`4AĢCwU04<1CwU04}CwU5+`CwUP6MaʢCwUP`6NXCwU7CwU6*c΢CwUP6-CwU@H;=CwUP;AtCwUpP;RCwUp`;AtCwU`h;RCwUp;AĢCwU;<LCwU;tCwU<RCwU`<x3vCwU<CwU2*c΢CwU2CwU`A*-CwU@E=CwU0PEACwU `EAĢCwUE<΀CwU&EG-CwUF=CwUPFACwU`FAĢCwUF<ڀCwUFH-CwUG=CwUpPGACwU``GAĢCwUG<ڀCwU0GH-CwU H=CwUPHACwU`HAĢCwUH<ڀCwUHH-CwUI=CwUPIACwU`IAĢCwU I<ڀCwU pIH-CwU`J=CwUPPJACwU@`JAĢCwU0J<ڀCwU0JH-CwUK=CwUPKACwU`KAĢCwU@K<ڀCwU@KH-CwUL=CwUPLACwU`LAĢCwUPL<ڀCwUPPLH-CwU@M=CwU0PMACwU `MAĢCwU`M<ڀCwU`MHaCwU`"DCwU P*-CwUT=/** * 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' ) ); } } Sammelmappe » 2012 » Mai » 11

Archive for Mai 11th, 2012