- WordPress core y plugins - Tema Twenty Twenty-Four configurado - Plugin allow-unfiltered-html.php simplificado - .gitignore configurado para excluir wp-config.php y uploads 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
34 lines
1.7 KiB
PHP
Executable File
34 lines
1.7 KiB
PHP
Executable File
<?php
|
|
|
|
declare (strict_types=1);
|
|
namespace Google\Site_Kit_Dependencies\GuzzleHttp\Psr7;
|
|
|
|
use Google\Site_Kit_Dependencies\Psr\Http\Message\StreamInterface;
|
|
/**
|
|
* Uses PHP's zlib.inflate filter to inflate zlib (HTTP deflate, RFC1950) or gzipped (RFC1952) content.
|
|
*
|
|
* This stream decorator converts the provided stream to a PHP stream resource,
|
|
* then appends the zlib.inflate filter. The stream is then converted back
|
|
* to a Guzzle stream resource to be used as a Guzzle stream.
|
|
*
|
|
* @see https://datatracker.ietf.org/doc/html/rfc1950
|
|
* @see https://datatracker.ietf.org/doc/html/rfc1952
|
|
* @see https://www.php.net/manual/en/filters.compression.php
|
|
*/
|
|
final class InflateStream implements \Google\Site_Kit_Dependencies\Psr\Http\Message\StreamInterface
|
|
{
|
|
use StreamDecoratorTrait;
|
|
/** @var StreamInterface */
|
|
private $stream;
|
|
public function __construct(\Google\Site_Kit_Dependencies\Psr\Http\Message\StreamInterface $stream)
|
|
{
|
|
$resource = \Google\Site_Kit_Dependencies\GuzzleHttp\Psr7\StreamWrapper::getResource($stream);
|
|
// Specify window=15+32, so zlib will use header detection to both gzip (with header) and zlib data
|
|
// See https://www.zlib.net/manual.html#Advanced definition of inflateInit2
|
|
// "Add 32 to windowBits to enable zlib and gzip decoding with automatic header detection"
|
|
// Default window size is 15.
|
|
\stream_filter_append($resource, 'zlib.inflate', \STREAM_FILTER_READ, ['window' => 15 + 32]);
|
|
$this->stream = $stream->isSeekable() ? new \Google\Site_Kit_Dependencies\GuzzleHttp\Psr7\Stream($resource) : new \Google\Site_Kit_Dependencies\GuzzleHttp\Psr7\NoSeekStream(new \Google\Site_Kit_Dependencies\GuzzleHttp\Psr7\Stream($resource));
|
|
}
|
|
}
|